From c4ae5da80562d965edf024319c89217c3b2390f1 Mon Sep 17 00:00:00 2001 From: Camille Simon Date: Mon, 28 Apr 2025 11:19:04 -0700 Subject: [PATCH 1/6] bump ap build compilesdk to 35 --- script/tool/lib/src/create_all_packages_app_command.dart | 4 ++-- script/tool/test/create_all_packages_app_command_test.dart | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/script/tool/lib/src/create_all_packages_app_command.dart b/script/tool/lib/src/create_all_packages_app_command.dart index 812c32133b25..2385af12657a 100644 --- a/script/tool/lib/src/create_all_packages_app_command.dart +++ b/script/tool/lib/src/create_all_packages_app_command.dart @@ -243,9 +243,9 @@ dependencies {} gradleFile, replacements: >{ if (gradleFileIsKotlin) - 'compileSdk': ['compileSdk = 34'] + 'compileSdk': ['compileSdk = 35'] else ...>{ - 'compileSdkVersion': ['compileSdk 34'], + 'compileSdkVersion': ['compileSdk 35'], } }, regexReplacements: >{ diff --git a/script/tool/test/create_all_packages_app_command_test.dart b/script/tool/test/create_all_packages_app_command_test.dart index 30ef798fff0a..386a9a07a499 100644 --- a/script/tool/test/create_all_packages_app_command_test.dart +++ b/script/tool/test/create_all_packages_app_command_test.dart @@ -339,7 +339,7 @@ android { buildGradle, containsAll([ contains('This is the legacy file'), - contains('compileSdk 34'), + contains('compileSdk 35'), ])); }); @@ -372,7 +372,7 @@ android { expect( buildGradle, containsAll([ - contains('compileSdk 34'), + contains('compileSdk 35'), contains('androidx.lifecycle:lifecycle-runtime'), ])); }); From 23bb9847de3baadb64807274473f9ad32fb9ae54 Mon Sep 17 00:00:00 2001 From: Camille Simon Date: Mon, 28 Apr 2025 11:41:44 -0700 Subject: [PATCH 2/6] bump AGP version --- .ci/legacy_project/all_packages/android/settings.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/legacy_project/all_packages/android/settings.gradle b/.ci/legacy_project/all_packages/android/settings.gradle index 02d009e408b1..f3d3df7186c2 100644 --- a/.ci/legacy_project/all_packages/android/settings.gradle +++ b/.ci/legacy_project/all_packages/android/settings.gradle @@ -19,7 +19,7 @@ pluginManagement { // See https://github.com/flutter/flutter/blob/master/docs/ecosystem/Plugins-and-Packages-repository-structure.md#gradle-structure for more info. plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "7.0.0" apply false + id "com.android.application" version "8.1.0" apply false id "org.jetbrains.kotlin.android" version "1.9.0" apply false } From e60578ed9a91a57c81ecf8136d36c2c00168aa95 Mon Sep 17 00:00:00 2001 From: Camille Simon Date: Mon, 28 Apr 2025 12:10:27 -0700 Subject: [PATCH 3/6] Bump Gradle version --- .../android/gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/legacy_project/all_packages/android/gradle/wrapper/gradle-wrapper.properties b/.ci/legacy_project/all_packages/android/gradle/wrapper/gradle-wrapper.properties index b8793d3c0d69..89e56bdb6006 100644 --- a/.ci/legacy_project/all_packages/android/gradle/wrapper/gradle-wrapper.properties +++ b/.ci/legacy_project/all_packages/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip From 9497fe6c61aae55bfeffa7c86348149d94c753fd Mon Sep 17 00:00:00 2001 From: Camille Simon Date: Tue, 29 Apr 2025 15:59:01 -0700 Subject: [PATCH 4/6] test java version bump, go back to look at todos --- .ci.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.ci.yaml b/.ci.yaml index 38ba297be117..553313d9e6eb 100644 --- a/.ci.yaml +++ b/.ci.yaml @@ -413,10 +413,9 @@ targets: # This file only builds a *legacy* version of the project. target_file: android_build_all_packages_legacy.yaml channel: master - # The legacy project build requires an older JDK. dependencies: >- [ - {"dependency": "open_jdk", "version": "version:11"} + {"dependency": "open_jdk", "version": "version:17"} ] env_variables: >- { @@ -445,10 +444,9 @@ targets: # This file only builds a *legacy* version of the project. target_file: android_build_all_packages_legacy.yaml channel: stable - # The legacy project build requires an older JDK. dependencies: >- [ - {"dependency": "open_jdk", "version": "version:11"} + {"dependency": "open_jdk", "version": "version:17"} ] env_variables: >- { From 04d9462385550cb928f1c83d8525021e274e75cd Mon Sep 17 00:00:00 2001 From: Camille Simon Date: Mon, 12 May 2025 10:02:49 -0700 Subject: [PATCH 5/6] attempt merging all_packages targets --- .ci.yaml | 41 +------------------ ...y.yaml => android_build_all_packages.yaml} | 13 +++++- .../android_build_all_packages_jdk17.yaml | 14 ------- 3 files changed, 13 insertions(+), 55 deletions(-) rename .ci/targets/{android_build_all_packages_legacy.yaml => android_build_all_packages.yaml} (58%) delete mode 100644 .ci/targets/android_build_all_packages_jdk17.yaml diff --git a/.ci.yaml b/.ci.yaml index 553313d9e6eb..7c4d54fe17a4 100644 --- a/.ci.yaml +++ b/.ci.yaml @@ -395,33 +395,13 @@ targets: properties: version_file: flutter_master.version # This builds the all_packages app only in a current JDK. - target_file: android_build_all_packages_jdk17.yaml + target_file: android_build_all_packages.yaml channel: master env_variables: >- { "CHANNEL": "master" } - - name: Linux_android android_build_all_packages_legacy master - recipe: packages/packages - timeout: 30 - properties: - version_file: flutter_master.version - # TODO(stuartmorgan): Once stable requires JDK 17, and the - # legacy project is updated accordingly, this entire target - # can be merged back into android_build_all_packages. - # This file only builds a *legacy* version of the project. - target_file: android_build_all_packages_legacy.yaml - channel: master - dependencies: >- - [ - {"dependency": "open_jdk", "version": "version:17"} - ] - env_variables: >- - { - "CHANNEL": "master" - } - - name: Linux_android android_build_all_packages stable recipe: packages/packages timeout: 30 @@ -429,30 +409,13 @@ targets: add_recipes_cq: "true" version_file: flutter_stable.version # This builds the all_packages app only in a current JDK. - target_file: android_build_all_packages_jdk17.yaml + target_file: android_build_all_packages.yaml channel: stable env_variables: >- { "CHANNEL": "stable" } - - name: Linux_android android_build_all_packages_legacy stable - recipe: packages/packages - timeout: 30 - properties: - version_file: flutter_stable.version - # This file only builds a *legacy* version of the project. - target_file: android_build_all_packages_legacy.yaml - channel: stable - dependencies: >- - [ - {"dependency": "open_jdk", "version": "version:17"} - ] - env_variables: >- - { - "CHANNEL": "stable" - } - - name: Linux_android android_platform_tests_shard_1 master recipe: packages/packages timeout: 60 diff --git a/.ci/targets/android_build_all_packages_legacy.yaml b/.ci/targets/android_build_all_packages.yaml similarity index 58% rename from .ci/targets/android_build_all_packages_legacy.yaml rename to .ci/targets/android_build_all_packages.yaml index 6c62e0c3d2a4..96a36475faf2 100644 --- a/.ci/targets/android_build_all_packages_legacy.yaml +++ b/.ci/targets/android_build_all_packages.yaml @@ -1,8 +1,17 @@ -# This only builds the legacy all_packages app, which requires jdk11 +# This builds the modern all_packages app and the legacy all_packages app. tasks: - name: prepare tool script: .ci/scripts/prepare_tool.sh infra_step: true # Note infra steps failing prevents "always" from running. + - name: create all_packages app + script: .ci/scripts/create_all_packages_app.sh + infra_step: true # Note infra steps failing prevents "always" from running. + - name: build all_packages for Android debug + script: .ci/scripts/build_all_packages_app.sh + args: ["apk", "debug"] + - name: build all_packages for Android release + script: .ci/scripts/build_all_packages_app.sh + args: ["apk", "release"] - name: create all_packages app - legacy version script: .ci/scripts/create_all_packages_app_legacy.sh # Output dir; must match the final argument to build_all_packages_app_legacy @@ -14,4 +23,4 @@ tasks: script: .ci/scripts/build_all_packages_app_legacy.sh # The final argument here must match the output directory passed to # create_all_packages_app_legacy above. - args: ["apk", "debug", "legacy"] + args: ["apk", "debug", "legacy"] \ No newline at end of file diff --git a/.ci/targets/android_build_all_packages_jdk17.yaml b/.ci/targets/android_build_all_packages_jdk17.yaml deleted file mode 100644 index 4843669b894f..000000000000 --- a/.ci/targets/android_build_all_packages_jdk17.yaml +++ /dev/null @@ -1,14 +0,0 @@ -# This only builds the modern all_packages app, which requires jdk17+ -tasks: - - name: prepare tool - script: .ci/scripts/prepare_tool.sh - infra_step: true # Note infra steps failing prevents "always" from running. - - name: create all_packages app - script: .ci/scripts/create_all_packages_app.sh - infra_step: true # Note infra steps failing prevents "always" from running. - - name: build all_packages for Android debug - script: .ci/scripts/build_all_packages_app.sh - args: ["apk", "debug"] - - name: build all_packages for Android release - script: .ci/scripts/build_all_packages_app.sh - args: ["apk", "release"] From ae0bb915214fa0e1a400867630450946e5165fb0 Mon Sep 17 00:00:00 2001 From: Camille Simon Date: Mon, 12 May 2025 13:06:18 -0700 Subject: [PATCH 6/6] add missing new line and update readme --- .ci/legacy_project/README.md | 23 +++++++++++---------- .ci/targets/android_build_all_packages.yaml | 2 +- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.ci/legacy_project/README.md b/.ci/legacy_project/README.md index 1ee7313e73dd..bea90a3fc318 100644 --- a/.ci/legacy_project/README.md +++ b/.ci/legacy_project/README.md @@ -37,16 +37,17 @@ and then deleting everything but `android/` from it: - Added license boilerplate. - Replaced `jcenter` in build.gradle with `mavenCentral`, due to the jcenter.bintray.com shutdown. -- Update `compileSdkVersion` from 30 to 33 to maintain compatibility - with plugins that use API 34. -- Updates `gradle-wrapper.properties` from `6.7` to `6.7.1`, to add - support for the Kotlin gradle plugin. If a user runs into this - error, the error message is clear on how to upgrade. -- Modifies `build.gradle` to upgrade the Android Gradle Plugin (AGP) - from version 4.1.0 to 7.0.0. If a user runs into an error with - the AGP version, the warning is clear on how to upgrade - the version to one that we support. +- Update `compileSdkVersion` from 30 to `flutter.compileSdkVersion` in + `build.gradle` to maintain compatibility with plugins that use + Flutter's most recently supported API version. - Modifies `gradle-wrapper.properties` to upgrade the Gradle version - from 6.7.1 to 7.0.2. If a user runs into an error with the Gradle + from 6.7 to 8.0. If a user runs into an error with the Gradle version, the warning is clear on how to upgrade the version to - one that we support. \ No newline at end of file + one that we support. +- Modifies `settings.gradle` to upgrade the Android Gradle Plugin (AGP) + from version 4.1.0 (originally set in `build.gradle`; see bullet below) + to 8.1.0. If a user runs into an error with the AGP version, the warning + is clear on how to upgrade the version to one that we support. +- Refactor plugin to use declarative Gradle apply instead of the + imperative apply (this includes moving where the Android Gradle + Plugin (AGP) version is set from `build.gradle` to `settings.gradle`). diff --git a/.ci/targets/android_build_all_packages.yaml b/.ci/targets/android_build_all_packages.yaml index 96a36475faf2..ee0a89e823eb 100644 --- a/.ci/targets/android_build_all_packages.yaml +++ b/.ci/targets/android_build_all_packages.yaml @@ -23,4 +23,4 @@ tasks: script: .ci/scripts/build_all_packages_app_legacy.sh # The final argument here must match the output directory passed to # create_all_packages_app_legacy above. - args: ["apk", "debug", "legacy"] \ No newline at end of file + args: ["apk", "debug", "legacy"]