Skip to content

Commit 6e2acf7

Browse files
authored
[all_packages] Bump compileSdk version to 35 (#9168)
Bumps `all_packages` app to build with `compileSdk` version 35. Then, - Updates the Gradle and AGP versions to support this new Android SDK version - Refactors the legacy all_packages CI build target such that the regular `all_packages` CI build targets (master, stable) will build both the modern `all_packages` app and the legacy version with the same JDK 17 version, since the legacy version now also requires it (example successful builds: [master](https://ci.chromium.org/ui/p/flutter/builders/try/Linux_android%20android_build_all_packages%20master/17102/overview), [stable](https://ci.chromium.org/ui/p/flutter/builders/try/Linux_android%20android_build_all_packages%20stable/17086/overview)) - Updates legacy `all_packages` app `README.md` to more accurately describe how the app was transformed since its creation Prompted by #8414. ## Pre-Review Checklist [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
1 parent 459123d commit 6e2acf7

File tree

8 files changed

+30
-76
lines changed

8 files changed

+30
-76
lines changed

.ci.yaml

Lines changed: 2 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -395,69 +395,27 @@ targets:
395395
properties:
396396
version_file: flutter_master.version
397397
# This builds the all_packages app only in a current JDK.
398-
target_file: android_build_all_packages_jdk17.yaml
398+
target_file: android_build_all_packages.yaml
399399
channel: master
400400
env_variables: >-
401401
{
402402
"CHANNEL": "master"
403403
}
404404
405-
- name: Linux_android android_build_all_packages_legacy master
406-
recipe: packages/packages
407-
timeout: 30
408-
properties:
409-
version_file: flutter_master.version
410-
# TODO(stuartmorgan): Once stable requires JDK 17, and the
411-
# legacy project is updated accordingly, this entire target
412-
# can be merged back into android_build_all_packages.
413-
# This file only builds a *legacy* version of the project.
414-
target_file: android_build_all_packages_legacy.yaml
415-
channel: master
416-
# The legacy project build requires an older JDK.
417-
dependencies: >-
418-
[
419-
{"dependency": "open_jdk", "version": "version:11"}
420-
]
421-
env_variables: >-
422-
{
423-
"CHANNEL": "master"
424-
}
425-
426405
- name: Linux_android android_build_all_packages stable
427406
recipe: packages/packages
428407
timeout: 30
429408
properties:
430409
add_recipes_cq: "true"
431410
version_file: flutter_stable.version
432411
# This builds the all_packages app only in a current JDK.
433-
target_file: android_build_all_packages_jdk17.yaml
412+
target_file: android_build_all_packages.yaml
434413
channel: stable
435414
env_variables: >-
436415
{
437416
"CHANNEL": "stable"
438417
}
439418
440-
- name: Linux_android android_build_all_packages_legacy stable
441-
# Temporarily disabled to unblock roll to 3.32.
442-
# See https://github.com/flutter/flutter/issues/169290
443-
bringup: true
444-
recipe: packages/packages
445-
timeout: 30
446-
properties:
447-
version_file: flutter_stable.version
448-
# This file only builds a *legacy* version of the project.
449-
target_file: android_build_all_packages_legacy.yaml
450-
channel: stable
451-
# The legacy project build requires an older JDK.
452-
dependencies: >-
453-
[
454-
{"dependency": "open_jdk", "version": "version:11"}
455-
]
456-
env_variables: >-
457-
{
458-
"CHANNEL": "stable"
459-
}
460-
461419
- name: Linux_android android_platform_tests_shard_1 master
462420
recipe: packages/packages
463421
timeout: 60

.ci/legacy_project/README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,17 @@ and then deleting everything but `android/` from it:
3737
- Added license boilerplate.
3838
- Replaced `jcenter` in build.gradle with `mavenCentral`, due to the
3939
jcenter.bintray.com shutdown.
40-
- Update `compileSdkVersion` from 30 to 33 to maintain compatibility
41-
with plugins that use API 34.
42-
- Updates `gradle-wrapper.properties` from `6.7` to `6.7.1`, to add
43-
support for the Kotlin gradle plugin. If a user runs into this
44-
error, the error message is clear on how to upgrade.
45-
- Modifies `build.gradle` to upgrade the Android Gradle Plugin (AGP)
46-
from version 4.1.0 to 7.0.0. If a user runs into an error with
47-
the AGP version, the warning is clear on how to upgrade
48-
the version to one that we support.
40+
- Update `compileSdkVersion` from 30 to `flutter.compileSdkVersion` in
41+
`build.gradle` to maintain compatibility with plugins that use
42+
Flutter's most recently supported API version.
4943
- Modifies `gradle-wrapper.properties` to upgrade the Gradle version
50-
from 6.7.1 to 7.0.2. If a user runs into an error with the Gradle
44+
from 6.7 to 8.4. If a user runs into an error with the Gradle
5145
version, the warning is clear on how to upgrade the version to
52-
one that we support.
46+
one that we support.
47+
- Modifies `settings.gradle` to upgrade the Android Gradle Plugin (AGP)
48+
from version 4.1.0 (originally set in `build.gradle`; see bullet below)
49+
to 8.3.0. If a user runs into an error with the AGP version, the warning
50+
is clear on how to upgrade the version to one that we support.
51+
- Refactor plugin to use declarative Gradle apply instead of the
52+
imperative apply (this includes moving where the Android Gradle
53+
Plugin (AGP) version is set from `build.gradle` to `settings.gradle`).

.ci/legacy_project/all_packages/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip

.ci/legacy_project/all_packages/android/settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pluginManagement {
1919
// See https://github.com/flutter/flutter/blob/master/docs/ecosystem/Plugins-and-Packages-repository-structure.md#gradle-structure for more info.
2020
plugins {
2121
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
22-
id "com.android.application" version "7.0.0" apply false
22+
id "com.android.application" version "8.3.0" apply false
2323
id "org.jetbrains.kotlin.android" version "1.9.0" apply false
2424
}
2525

.ci/targets/android_build_all_packages_legacy.yaml renamed to .ci/targets/android_build_all_packages.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
1-
# This only builds the legacy all_packages app, which requires jdk11
1+
# This builds the modern all_packages app and the legacy all_packages app.
22
tasks:
33
- name: prepare tool
44
script: .ci/scripts/prepare_tool.sh
55
infra_step: true # Note infra steps failing prevents "always" from running.
6+
- name: create all_packages app
7+
script: .ci/scripts/create_all_packages_app.sh
8+
infra_step: true # Note infra steps failing prevents "always" from running.
9+
- name: build all_packages for Android debug
10+
script: .ci/scripts/build_all_packages_app.sh
11+
args: ["apk", "debug"]
12+
- name: build all_packages for Android release
13+
script: .ci/scripts/build_all_packages_app.sh
14+
args: ["apk", "release"]
615
- name: create all_packages app - legacy version
716
script: .ci/scripts/create_all_packages_app_legacy.sh
817
# Output dir; must match the final argument to build_all_packages_app_legacy

.ci/targets/android_build_all_packages_jdk17.yaml

Lines changed: 0 additions & 14 deletions
This file was deleted.

script/tool/lib/src/create_all_packages_app_command.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,9 @@ dependencies {}
243243
gradleFile,
244244
replacements: <String, List<String>>{
245245
if (gradleFileIsKotlin)
246-
'compileSdk': <String>['compileSdk = 34']
246+
'compileSdk': <String>['compileSdk = 35']
247247
else ...<String, List<String>>{
248-
'compileSdkVersion': <String>['compileSdk 34'],
248+
'compileSdkVersion': <String>['compileSdk 35'],
249249
}
250250
},
251251
regexReplacements: <RegExp, List<String>>{

script/tool/test/create_all_packages_app_command_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ android {
339339
buildGradle,
340340
containsAll(<Matcher>[
341341
contains('This is the legacy file'),
342-
contains('compileSdk 34'),
342+
contains('compileSdk 35'),
343343
]));
344344
});
345345

@@ -372,7 +372,7 @@ android {
372372
expect(
373373
buildGradle,
374374
containsAll(<Matcher>[
375-
contains('compileSdk 34'),
375+
contains('compileSdk 35'),
376376
contains('androidx.lifecycle:lifecycle-runtime'),
377377
]));
378378
});

0 commit comments

Comments
 (0)