Skip to content

Commit

Permalink
Merge branch 'master' into release/v2
Browse files Browse the repository at this point in the history
* master:
  Prepare for release 2.10.0.
  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.
  • Loading branch information
ychescale9 committed Jun 12, 2020
2 parents e93c997 + 9ef7536 commit b62c970
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 9 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,22 @@ jobs:
matrix:
os: [macos-latest, ubuntu-latest]
api-level: [16, 23, 29]
target: [default, google_apis]
exclude:
- os: ubuntu-latest
api-level: 23
- os: ubuntu-latest
api-level: 29
- target: google_apis
api-level: 16
- target: google_apis
api-level: 23
- target: google_apis
api-level: 29
include:
- os: macos-latest
api-level: 30
target: google_apis
steps:
- name: checkout
uses: actions/checkout@v2
Expand Down Expand Up @@ -49,7 +60,7 @@ jobs:
uses: ./
with:
api-level: ${{ matrix.api-level }}
target: default
target: ${{ matrix.target }}
arch: x86
profile: Nexus 6
avd-name: test
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## v2.10.0

* Support Android 11 (API 30) system images.
* Bump build tools to `30.0.0`.

## v2.9.0

* Updated to SDK command-line tools `2.0`.
Expand Down
8 changes: 6 additions & 2 deletions lib/sdk-installer.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
Object.defineProperty(exports, "__esModule", { value: true });
const core = __importStar(require("@actions/core"));
const exec = __importStar(require("@actions/exec"));
const BUILD_TOOLS_VERSION = '29.0.3';
const BUILD_TOOLS_VERSION = '30.0.0';
const CMDLINE_TOOLS_URL_MAC = 'https://dl.google.com/android/repository/commandlinetools-mac-6514223_latest.zip';
const CMDLINE_TOOLS_URL_LINUX = 'https://dl.google.com/android/repository/commandlinetools-linux-6514223_latest.zip';
/**
Expand All @@ -37,9 +37,13 @@ function installAndroidSdk(apiLevel, target, arch, emulatorBuild, ndkVersion, cm
core.addPath(`${process.env.ANDROID_HOME}/cmdline-tools/tools:${process.env.ANDROID_HOME}/cmdline-tools/tools/bin:${process.env.ANDROID_HOME}/platform-tools`);
// additional permission and license requirements for Linux
if (!isOnMac) {
yield exec.exec(`sh -c \\"sudo chmod -R 777 ${process.env.ANDROID_HOME}"`);
yield exec.exec(`sh -c \\"sudo chown $USER:$USER ${process.env.ANDROID_HOME} -R`);
yield exec.exec(`sh -c \\"echo -e '\n84831b9409646a918e30573bab4c9c91346d8abd' > ${process.env.ANDROID_HOME}/licenses/android-sdk-preview-license"`);
}
// license required for API 30 system images
if (apiLevel == 30) {
yield exec.exec(`sh -c \\"echo -e '\n859f317696f67ef3d7f30a50a5560e7834b43903' > ${process.env.ANDROID_HOME}/licenses/android-sdk-arm-dbt-license"`);
}
console.log('Installing latest build tools, platform tools, and platform.');
yield exec.exec(`sh -c \\"sdkmanager --install 'build-tools;${BUILD_TOOLS_VERSION}' platform-tools 'platforms;android-${apiLevel}' > /dev/null"`);
if (emulatorBuild) {
Expand Down
8 changes: 6 additions & 2 deletions src/sdk-installer.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as core from '@actions/core';
import * as exec from '@actions/exec';

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

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

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

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

Expand Down
6 changes: 3 additions & 3 deletions test-fixture/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
compileSdkVersion 30
buildToolsVersion "30.0.0"

defaultConfig {
applicationId "com.example.testapp"
minSdkVersion 15
targetSdkVersion 29
targetSdkVersion 30
versionCode 1
versionName "1.0"

Expand Down
2 changes: 1 addition & 1 deletion test-fixture/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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-6.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip

0 comments on commit b62c970

Please sign in to comment.