Skip to content

Commit

Permalink
[various] Update Java compatibility version to 11 (#7795)
Browse files Browse the repository at this point in the history
Now that `stable` requires AGP 7.0, which in turn requires Java 11+, we should be able to set our compatibility version to 11 (setting the min Flutter SDK version to current stable).

Also removes the gradle conditionals for setting namespace (and the repo tool checks that it is present), as that was only needed for AGP 4.1 compatibility.

Part of flutter/flutter#156111
  • Loading branch information
stuartmorgan authored Oct 5, 2024
1 parent aa741d1 commit 4afc383
Show file tree
Hide file tree
Showing 84 changed files with 250 additions and 288 deletions.
5 changes: 5 additions & 0 deletions packages/camera/camera_android/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.10.9+12

* Updates Java compatibility version to 11.
* Updates minimum supported SDK version to Flutter 3.24/Dart 3.5.

## 0.10.9+11

* Updates annotations lib to 1.8.2.
Expand Down
9 changes: 3 additions & 6 deletions packages/camera/camera_android/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ android {
buildFeatures {
buildConfig true
}
// Conditional for compatibility with AGP <4.2.
if (project.android.hasProperty("namespace")) {
namespace 'io.flutter.plugins.camera'
}
namespace 'io.flutter.plugins.camera'
compileSdk 34

defaultConfig {
Expand All @@ -46,8 +43,8 @@ buildFeatures {
disable 'AndroidGradlePluginVersion', 'InvalidPackage', 'GradleDependency', 'NewerVersionAvailable'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

testOptions {
Expand Down
4 changes: 2 additions & 2 deletions packages/camera/camera_android/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ description: Demonstrates how to use the camera plugin.
publish_to: none

environment:
sdk: ^3.4.0
flutter: ">=3.22.0"
sdk: ^3.5.0
flutter: ">=3.24.0"

dependencies:
camera_android:
Expand Down
6 changes: 3 additions & 3 deletions packages/camera/camera_android/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ description: Android implementation of the camera plugin.
repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_android
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22

version: 0.10.9+11
version: 0.10.9+12

environment:
sdk: ^3.4.0
flutter: ">=3.22.0"
sdk: ^3.5.0
flutter: ">=3.24.0"

flutter:
plugin:
Expand Down
4 changes: 4 additions & 0 deletions packages/camera/camera_android_camerax/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.6.9+2

* Updates Java compatibility version to 11.

## 0.6.9+1

* Bumps `com.google.guava:guava` from `33.3.0` to `33.3.1`.
Expand Down
9 changes: 3 additions & 6 deletions packages/camera/camera_android_camerax/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,13 @@ rootProject.allprojects {
apply plugin: 'com.android.library'

android {
// Conditional for compatibility with AGP <4.2.
if (project.android.hasProperty("namespace")) {
namespace 'io.flutter.plugins.camerax'
}
namespace 'io.flutter.plugins.camerax'
// CameraX dependencies require compilation against version 33 or later.
compileSdk 34

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

defaultConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ android {
ndkVersion flutter.ndkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

defaultConfig {
Expand Down
2 changes: 1 addition & 1 deletion packages/camera/camera_android_camerax/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: camera_android_camerax
description: Android implementation of the camera plugin using the CameraX library.
repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_android_camerax
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22
version: 0.6.9+1
version: 0.6.9+2

environment:
sdk: ^3.5.0
Expand Down
5 changes: 5 additions & 0 deletions packages/espresso/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.4.0+3

* Updates Java compatibility version to 11.
* Updates minimum supported SDK version to Flutter 3.24/Dart 3.5.

## 0.4.0+2

* Bumps `com.google.guava:guava` from `31.1` to `33.3.1`.
Expand Down
9 changes: 3 additions & 6 deletions packages/espresso/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ rootProject.allprojects {
apply plugin: 'com.android.library'

android {
// Conditional for compatibility with AGP <4.2.
if (project.android.hasProperty("namespace")) {
namespace 'com.example.espresso'
}
namespace 'com.example.espresso'
compileSdk 34

defaultConfig {
Expand All @@ -34,8 +31,8 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

lintOptions {
Expand Down
4 changes: 2 additions & 2 deletions packages/espresso/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ description: Demonstrates how to use the espresso plugin.
publish_to: none

environment:
sdk: ^3.4.0
flutter: ">=3.22.0"
sdk: ^3.5.0
flutter: ">=3.24.0"

dependencies:
flutter:
Expand Down
6 changes: 3 additions & 3 deletions packages/espresso/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ description: Java classes for testing Flutter apps using Espresso.
Allows driving Flutter widgets from a native Espresso test.
repository: https://github.com/flutter/packages/tree/main/packages/espresso
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+espresso%22
version: 0.4.0+2
version: 0.4.0+3

environment:
sdk: ^3.4.0
flutter: ">=3.22.0"
sdk: ^3.5.0
flutter: ">=3.24.0"

flutter:
plugin:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ android {
compileSdk flutter.compileSdkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

defaultConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ android {
ndkVersion flutter.ndkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = '1.8'
jvmTarget = '11'
}

sourceSets {
Expand Down
4 changes: 4 additions & 0 deletions packages/file_selector/file_selector_android/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.5.1+9

* Updates Java compatibility version to 11.

## 0.5.1+8

* Updates Pigeon for non-nullable collection type support.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,12 @@ rootProject.allprojects {
apply plugin: 'com.android.library'

android {
// Conditional for compatibility with AGP <4.2.
if (project.android.hasProperty("namespace")) {
namespace 'dev.flutter.packages.file_selector_android'
}
namespace 'dev.flutter.packages.file_selector_android'
compileSdk 34

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

defaultConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ android {
ndkVersion flutter.ndkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

defaultConfig {
Expand Down
2 changes: 1 addition & 1 deletion packages/file_selector/file_selector_android/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: file_selector_android
description: Android implementation of the file_selector package.
repository: https://github.com/flutter/packages/tree/main/packages/file_selector/file_selector_android
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+file_selector%22
version: 0.5.1+8
version: 0.5.1+9

environment:
sdk: ^3.5.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ android {
ndkVersion flutter.ndkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = '1.8'
jvmTarget = '11'
}

sourceSets {
Expand Down
6 changes: 3 additions & 3 deletions packages/flutter_image/example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ android {
ndkVersion flutter.ndkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = '1.8'
jvmTarget = '11'
}

sourceSets {
Expand Down
5 changes: 5 additions & 0 deletions packages/flutter_plugin_android_lifecycle/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 2.0.23

* Updates Java compatibility version to 11.
* Updates minimum supported SDK version to Flutter 3.24/Dart 3.5.

## 2.0.22

* Bumps `com.android.tools.build:gradle` from 7.2.1 to 8.5.1.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ rootProject.allprojects {
apply plugin: 'com.android.library'

android {
// Conditional for compatibility with AGP <4.2.
if (project.android.hasProperty("namespace")) {
namespace 'io.flutter.plugins.flutter_plugin_android_lifecycle'
}
namespace 'io.flutter.plugins.flutter_plugin_android_lifecycle'
compileSdk 34

defaultConfig {
Expand All @@ -35,8 +32,8 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

lintOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ description: Demonstrates how to use the flutter_plugin_android_lifecycle plugin
publish_to: none

environment:
sdk: ^3.4.0
flutter: ">=3.22.0"
sdk: ^3.5.0
flutter: ">=3.24.0"

dependencies:
flutter:
Expand Down
6 changes: 3 additions & 3 deletions packages/flutter_plugin_android_lifecycle/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: flutter_plugin_android_lifecycle
description: Flutter plugin for accessing an Android Lifecycle within other plugins.
repository: https://github.com/flutter/packages/tree/main/packages/flutter_plugin_android_lifecycle
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+flutter_plugin_android_lifecycle%22
version: 2.0.22
version: 2.0.23

environment:
sdk: ^3.4.0
flutter: ">=3.22.0"
sdk: ^3.5.0
flutter: ">=3.24.0"

flutter:
plugin:
Expand Down
6 changes: 3 additions & 3 deletions packages/go_router/example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ android {
compileSdk flutter.compileSdkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = '1.8'
jvmTarget = '11'
}

sourceSets {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 2.14.8

* Updates Java compatibility version to 11.
* Updates minimum supported SDK version to Flutter 3.24/Dart 3.5.

## 2.14.7

* Adds `PlatformPatternItem` pigeon class to convert `PlatformPolyline.pattern`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ rootProject.allprojects {
apply plugin: 'com.android.library'

android {
// Conditional for compatibility with AGP <4.2.
if (project.android.hasProperty("namespace")) {
namespace 'io.flutter.plugins.googlemaps'
}
namespace 'io.flutter.plugins.googlemaps'
compileSdk 34

defaultConfig {
Expand All @@ -52,8 +49,8 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

testOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ description: Demonstrates how to use the google_maps_flutter plugin.
publish_to: none

environment:
sdk: ^3.4.0
flutter: ">=3.22.0"
sdk: ^3.5.0
flutter: ">=3.24.0"

dependencies:
cupertino_icons: ^1.0.5
Expand Down
Loading

0 comments on commit 4afc383

Please sign in to comment.