From 26779818266e72414867fecfb8470628517f3832 Mon Sep 17 00:00:00 2001 From: David Iglesias Date: Fri, 12 Jul 2024 05:33:52 -0700 Subject: [PATCH] [ci] Split build_all_packages by JDK version. (#7106) This PR introduces a new `android_build_all_packages_legacy` in `master` and `stable` to build only the "legacy" version of an Android project using JDK11. This PR is required to resume rolling the flutter framework, like here: * https://github.com/flutter/packages/pull/7099 --- .ci.yaml | 48 +++++++++++++++++++ .ci/targets/android_build_all_packages.yaml | 2 + .../android_build_all_packages_jdk17.yaml | 14 ++++++ .../android_build_all_packages_legacy.yaml | 17 +++++++ 4 files changed, 81 insertions(+) create mode 100644 .ci/targets/android_build_all_packages_jdk17.yaml create mode 100644 .ci/targets/android_build_all_packages_legacy.yaml diff --git a/.ci.yaml b/.ci.yaml index 78b9751b5339..968e4adaedbc 100644 --- a/.ci.yaml +++ b/.ci.yaml @@ -376,12 +376,38 @@ targets: "CHANNEL": "master" } + - name: Linux_android android_build_all_packages_legacy master + # When making this `bringup: false`, update the task above to + # use target_file: android_build_all_packages_jdk17.yaml and + # remove its 'dependencies' section. + bringup: true # https://github.com/flutter/packages/pull/7099 + 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 + # The legacy project build requires an older JDK. + dependencies: >- + [ + {"dependency": "open_jdk", "version": "version:11"} + ] + env_variables: >- + { + "CHANNEL": "master" + } + - name: Linux_android android_build_all_packages stable recipe: packages/packages timeout: 30 properties: add_recipes_cq: "true" version_file: flutter_stable.version + # This builds both legacy, and "modern" projects. target_file: android_build_all_packages.yaml channel: stable # The legacy project build requires an older JDK. @@ -394,6 +420,28 @@ targets: "CHANNEL": "stable" } + - name: Linux_android android_build_all_packages_legacy stable + # When making this `bringup: false`, update the task above to + # use target_file: android_build_all_packages_jdk17.yaml and + # remove its 'dependencies' section. + bringup: true # https://github.com/flutter/packages/pull/7099 + 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 + # The legacy project build requires an older JDK. + dependencies: >- + [ + {"dependency": "open_jdk", "version": "version:11"} + ] + 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.yaml b/.ci/targets/android_build_all_packages.yaml index 5343cfb17961..64a02e8a6a26 100644 --- a/.ci/targets/android_build_all_packages.yaml +++ b/.ci/targets/android_build_all_packages.yaml @@ -1,3 +1,5 @@ +# This builds legacy and modern all_packages app, which requires jdk11 +# This will stop working in the next stable! tasks: - name: prepare tool script: .ci/scripts/prepare_tool.sh diff --git a/.ci/targets/android_build_all_packages_jdk17.yaml b/.ci/targets/android_build_all_packages_jdk17.yaml new file mode 100644 index 000000000000..4843669b894f --- /dev/null +++ b/.ci/targets/android_build_all_packages_jdk17.yaml @@ -0,0 +1,14 @@ +# 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"] diff --git a/.ci/targets/android_build_all_packages_legacy.yaml b/.ci/targets/android_build_all_packages_legacy.yaml new file mode 100644 index 000000000000..6c62e0c3d2a4 --- /dev/null +++ b/.ci/targets/android_build_all_packages_legacy.yaml @@ -0,0 +1,17 @@ +# This only builds the legacy all_packages app, which requires jdk11 +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 - legacy version + script: .ci/scripts/create_all_packages_app_legacy.sh + # Output dir; must match the final argument to build_all_packages_app_legacy + # below. + args: ["legacy"] + # Only build legacy in one mode, to minimize extra CI time. Debug is chosen + # somewhat arbitrarily as likely being slightly faster. + - name: build all_packages for Android - legacy version + 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"]