From 3a18f5021676582060c2652cb1bc92d9821ff212 Mon Sep 17 00:00:00 2001 From: Yang Date: Mon, 7 Oct 2024 00:50:35 +1100 Subject: [PATCH] SDK build tools 35.0.0, command-line tools 16.0. (#408) --- .github/workflows/main.yml | 34 +++++++------------ .github/workflows/manually.yml | 13 +++---- README.md | 2 +- lib/sdk-installer.js | 8 ++--- src/sdk-installer.ts | 8 ++--- test-fixture/app/build.gradle | 15 ++++---- test-fixture/build.gradle | 4 +-- .../gradle/wrapper/gradle-wrapper.properties | 2 +- 8 files changed, 35 insertions(+), 51 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cbeaa2288..5967620c6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,42 +18,32 @@ jobs: timeout-minutes: 15 strategy: matrix: - os: [ubuntu-latest] - api-level: [23, 29] - target: [default, google_apis] - arch: [x86] - exclude: - - target: google_apis - api-level: 16 - - target: google_apis - api-level: 23 - - target: google_apis - api-level: 29 include: - os: ubuntu-latest - api-level: 24 - target: playstore + api-level: 23 + target: default arch: x86 - os: ubuntu-latest - api-level: 30 - target: aosp_atd + api-level: 24 + target: playstore arch: x86 - - os: macos-latest + - os: macos-13 api-level: 31 - target: google_apis + target: default arch: x86_64 - os: ubuntu-latest api-level: 34 target: aosp_atd arch: x86_64 + - os: ubuntu-latest + api-level: 35 + target: google_apis + arch: x86_64 steps: - name: checkout uses: actions/checkout@v4 - - name: validate gradle wrapper - uses: gradle/wrapper-validation-action@v2 - - name: build, test and lint run: | npm install @@ -64,7 +54,7 @@ jobs: - uses: actions/setup-java@v4 with: distribution: 'zulu' - java-version: 21 + java-version: 23 - uses: actions/cache@v4 id: avd-cache @@ -75,7 +65,7 @@ jobs: ~/.android/debug.keystore key: avd-${{ matrix.api-level }}-${{ matrix.os }}-${{ matrix.target }} - - uses: gradle/actions/setup-gradle@v3 + - uses: gradle/actions/setup-gradle@v4 - name: assemble tests working-directory: test-fixture diff --git a/.github/workflows/manually.yml b/.github/workflows/manually.yml index 9b8f9722a..a74e1b3dd 100644 --- a/.github/workflows/manually.yml +++ b/.github/workflows/manually.yml @@ -9,14 +9,14 @@ on: api-level: description: 'API level of the platform and system image' required: true - default: '30' + default: '34' target: description: 'target of the system image - default, google_apis, google_apis_playstore, aosp_atd, google_atd, android-wear, android-wear-cn, android-tv or google-tv' required: true default: 'default' arch: description: 'CPU architecture of the system image - x86, x86_64 or arm64-v8a' - default: 'x86' + default: 'x86_64' emulator-options: description: 'command-line options used when launching the emulator' default: '-no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim' @@ -41,9 +41,6 @@ jobs: - name: checkout uses: actions/checkout@v4 - - name: validate gradle wrapper - uses: gradle/wrapper-validation-action@v2 - - name: build, test and lint run: | npm install @@ -54,11 +51,9 @@ jobs: - uses: actions/setup-java@v4 with: distribution: 'zulu' - java-version: 21 + java-version: 23 - - uses: gradle/actions/setup-gradle@v3 - with: - gradle-home-cache-cleanup: true + - uses: gradle/actions/setup-gradle@v4 - name: enable KVM for linux runners if: runner.os == 'Linux' diff --git a/README.md b/README.md index f245ff388..980879213 100644 --- a/README.md +++ b/README.md @@ -121,7 +121,7 @@ jobs: We can significantly reduce emulator startup time by setting up AVD snapshot caching: -1. add a `gradle/actions/setup-gradle@v3` step for caching Gradle, more details see [#229](https://github.com/ReactiveCircus/android-emulator-runner/issues/229) +1. add a `gradle/actions/setup-gradle@v4` step for caching Gradle, more details see [#229](https://github.com/ReactiveCircus/android-emulator-runner/issues/229) 2. add an `actions/cache@v4` step for caching the `avd` 3. add a `reactivecircus/android-emulator-runner@v2` step to generate a clean snapshot - specify `emulator-options` without `no-snapshot` 4. add another `reactivecircus/android-emulator-runner@v2` step to run your tests using existing AVD / snapshot - specify `emulator-options` with `no-snapshot-save` diff --git a/lib/sdk-installer.js b/lib/sdk-installer.js index 89839b27f..feb6eb266 100644 --- a/lib/sdk-installer.js +++ b/lib/sdk-installer.js @@ -38,10 +38,10 @@ const exec = __importStar(require("@actions/exec")); const io = __importStar(require("@actions/io")); const tc = __importStar(require("@actions/tool-cache")); const fs = __importStar(require("fs")); -const BUILD_TOOLS_VERSION = '34.0.0'; -// SDK command-line tools 11.0 -const CMDLINE_TOOLS_URL_MAC = 'https://dl.google.com/android/repository/commandlinetools-mac-10406996_latest.zip'; -const CMDLINE_TOOLS_URL_LINUX = 'https://dl.google.com/android/repository/commandlinetools-linux-10406996_latest.zip'; +const BUILD_TOOLS_VERSION = '35.0.0'; +// SDK command-line tools 16.0 +const CMDLINE_TOOLS_URL_MAC = 'https://dl.google.com/android/repository/commandlinetools-mac-12266719_latest.zip'; +const CMDLINE_TOOLS_URL_LINUX = 'https://dl.google.com/android/repository/commandlinetools-linux-12266719_latest.zip'; /** * Installs & updates the Android SDK for the macOS platform, including SDK platform for the chosen API level, latest build tools, platform tools, Android Emulator, * and the system image for the chosen API level, CPU arch, and target. diff --git a/src/sdk-installer.ts b/src/sdk-installer.ts index 2b7364772..5c7a0f2c7 100644 --- a/src/sdk-installer.ts +++ b/src/sdk-installer.ts @@ -4,10 +4,10 @@ import * as io from '@actions/io'; import * as tc from '@actions/tool-cache'; import * as fs from 'fs'; -const BUILD_TOOLS_VERSION = '34.0.0'; -// SDK command-line tools 11.0 -const CMDLINE_TOOLS_URL_MAC = 'https://dl.google.com/android/repository/commandlinetools-mac-10406996_latest.zip'; -const CMDLINE_TOOLS_URL_LINUX = 'https://dl.google.com/android/repository/commandlinetools-linux-10406996_latest.zip'; +const BUILD_TOOLS_VERSION = '35.0.0'; +// SDK command-line tools 16.0 +const CMDLINE_TOOLS_URL_MAC = 'https://dl.google.com/android/repository/commandlinetools-mac-12266719_latest.zip'; +const CMDLINE_TOOLS_URL_LINUX = 'https://dl.google.com/android/repository/commandlinetools-linux-12266719_latest.zip'; /** * Installs & updates the Android SDK for the macOS platform, including SDK platform for the chosen API level, latest build tools, platform tools, Android Emulator, diff --git a/test-fixture/app/build.gradle b/test-fixture/app/build.gradle index 6e324c4c6..70f49e352 100644 --- a/test-fixture/app/build.gradle +++ b/test-fixture/app/build.gradle @@ -4,13 +4,13 @@ apply plugin: 'kotlin-android' android { namespace = "com.example.testapp" - compileSdkVersion 34 - buildToolsVersion "34.0.0" + compileSdkVersion 35 + buildToolsVersion "35.0.0" defaultConfig { applicationId "com.example.testapp" - minSdkVersion 15 - targetSdkVersion 34 + minSdkVersion 21 + targetSdkVersion 35 versionCode 1 versionName "1.0" @@ -30,8 +30,7 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { } dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'androidx.appcompat:appcompat:1.6.1' - androidTestImplementation 'androidx.test.ext:junit:1.1.5' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' + implementation 'androidx.appcompat:appcompat:1.7.0' + androidTestImplementation 'androidx.test.ext:junit:1.2.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' } diff --git a/test-fixture/build.gradle b/test-fixture/build.gradle index fdc214646..aaea38ec7 100644 --- a/test-fixture/build.gradle +++ b/test-fixture/build.gradle @@ -6,8 +6,8 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.2.0' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.21" + classpath 'com.android.tools.build:gradle:8.7.0' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:2.0.20" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/test-fixture/gradle/wrapper/gradle-wrapper.properties b/test-fixture/gradle/wrapper/gradle-wrapper.properties index 1af9e0930..df97d72b8 100644 --- a/test-fixture/gradle/wrapper/gradle-wrapper.properties +++ b/test-fixture/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME