Skip to content

Commit 8d0ce4c

Browse files
committed
Support API 30 system images and add API 30 to workflow. Update build tools to 30.0.0. Update test projec’s compileSdk and targetSdk to API 30.
1 parent fc17953 commit 8d0ce4c

File tree

5 files changed

+28
-9
lines changed

5 files changed

+28
-9
lines changed

.github/workflows/workflow.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,22 @@ jobs:
1515
matrix:
1616
os: [macos-latest, ubuntu-latest]
1717
api-level: [16, 23, 29]
18+
target: [default, google_apis]
1819
exclude:
1920
- os: ubuntu-latest
2021
api-level: 23
2122
- os: ubuntu-latest
2223
api-level: 29
24+
- target: google_apis
25+
api-level: 16
26+
- target: google_apis
27+
api-level: 23
28+
- target: google_apis
29+
api-level: 29
30+
include:
31+
- os: macos-latest
32+
api-level: 30
33+
target: google_apis
2334
steps:
2435
- name: checkout
2536
uses: actions/checkout@v2
@@ -49,7 +60,7 @@ jobs:
4960
uses: ./
5061
with:
5162
api-level: ${{ matrix.api-level }}
52-
target: default
63+
target: ${{ matrix.target }}
5364
arch: x86
5465
profile: Nexus 6
5566
avd-name: test

lib/sdk-installer.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
1717
Object.defineProperty(exports, "__esModule", { value: true });
1818
const core = __importStar(require("@actions/core"));
1919
const exec = __importStar(require("@actions/exec"));
20-
const BUILD_TOOLS_VERSION = '29.0.3';
20+
const BUILD_TOOLS_VERSION = '30.0.0';
2121
const CMDLINE_TOOLS_URL_MAC = 'https://dl.google.com/android/repository/commandlinetools-mac-6514223_latest.zip';
2222
const CMDLINE_TOOLS_URL_LINUX = 'https://dl.google.com/android/repository/commandlinetools-linux-6514223_latest.zip';
2323
/**
@@ -37,9 +37,13 @@ function installAndroidSdk(apiLevel, target, arch, emulatorBuild, ndkVersion, cm
3737
core.addPath(`${process.env.ANDROID_HOME}/cmdline-tools/tools:${process.env.ANDROID_HOME}/cmdline-tools/tools/bin:${process.env.ANDROID_HOME}/platform-tools`);
3838
// additional permission and license requirements for Linux
3939
if (!isOnMac) {
40-
yield exec.exec(`sh -c \\"sudo chmod -R 777 ${process.env.ANDROID_HOME}"`);
40+
yield exec.exec(`sh -c \\"sudo chown $USER:$USER ${process.env.ANDROID_HOME} -R`);
4141
yield exec.exec(`sh -c \\"echo -e '\n84831b9409646a918e30573bab4c9c91346d8abd' > ${process.env.ANDROID_HOME}/licenses/android-sdk-preview-license"`);
4242
}
43+
// license required for API 30 system images
44+
if (apiLevel == 30) {
45+
yield exec.exec(`sh -c \\"echo -e '\n859f317696f67ef3d7f30a50a5560e7834b43903' > ${process.env.ANDROID_HOME}/licenses/android-sdk-arm-dbt-license"`);
46+
}
4347
console.log('Installing latest build tools, platform tools, and platform.');
4448
yield exec.exec(`sh -c \\"sdkmanager --install 'build-tools;${BUILD_TOOLS_VERSION}' platform-tools 'platforms;android-${apiLevel}' > /dev/null"`);
4549
if (emulatorBuild) {

src/sdk-installer.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as core from '@actions/core';
22
import * as exec from '@actions/exec';
33

4-
const BUILD_TOOLS_VERSION = '29.0.3';
4+
const BUILD_TOOLS_VERSION = '30.0.0';
55
const CMDLINE_TOOLS_URL_MAC = 'https://dl.google.com/android/repository/commandlinetools-mac-6514223_latest.zip';
66
const CMDLINE_TOOLS_URL_LINUX = 'https://dl.google.com/android/repository/commandlinetools-linux-6514223_latest.zip';
77

@@ -23,9 +23,13 @@ export async function installAndroidSdk(apiLevel: number, target: string, arch:
2323

2424
// additional permission and license requirements for Linux
2525
if (!isOnMac) {
26-
await exec.exec(`sh -c \\"sudo chmod -R 777 ${process.env.ANDROID_HOME}"`);
26+
await exec.exec(`sh -c \\"sudo chown $USER:$USER ${process.env.ANDROID_HOME} -R`);
2727
await exec.exec(`sh -c \\"echo -e '\n84831b9409646a918e30573bab4c9c91346d8abd' > ${process.env.ANDROID_HOME}/licenses/android-sdk-preview-license"`);
2828
}
29+
// license required for API 30 system images
30+
if (apiLevel == 30) {
31+
await exec.exec(`sh -c \\"echo -e '\n859f317696f67ef3d7f30a50a5560e7834b43903' > ${process.env.ANDROID_HOME}/licenses/android-sdk-arm-dbt-license"`);
32+
}
2933

3034
console.log('Installing latest build tools, platform tools, and platform.');
3135

test-fixture/app/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ apply plugin: 'kotlin-android'
33
apply plugin: 'kotlin-android-extensions'
44

55
android {
6-
compileSdkVersion 29
7-
buildToolsVersion "29.0.3"
6+
compileSdkVersion 30
7+
buildToolsVersion "30.0.0"
88

99
defaultConfig {
1010
applicationId "com.example.testapp"
1111
minSdkVersion 15
12-
targetSdkVersion 29
12+
targetSdkVersion 30
1313
versionCode 1
1414
versionName "1.0"
1515

test-fixture/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-6.3-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip

0 commit comments

Comments
 (0)