Skip to content

Commit

Permalink
Merge branch 'main' into release/v2
Browse files Browse the repository at this point in the history
* main:
  Prepare for release 2.19.1.
  Accept all Android SDK Licenses
  Adds Norris to the list of projects
  • Loading branch information
ychescale9 committed Jul 20, 2021
2 parents ac874f3 + 5e487db commit 5de26e4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 28 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## v2.19.1

* Accept all Android SDL Licenses to fix `sdkmanager` installation. - [#172](https://github.com/ReactiveCircus/android-emulator-runner/pull/172) @marcuspridham.

## v2.19.0

* Add option to specify `ram-size` for the AVD. - [#165](https://github.com/ReactiveCircus/android-emulator-runner/pull/165).
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,5 +200,6 @@ These are some of the open-source projects using (or used) **Android Emulator Ru
- [wikimedia/apps-android-wikipedia](https://github.com/wikimedia/apps-android-wikipedia/blob/master/.github/workflows)
- [google/android-fhir](https://github.com/google/android-fhir/tree/master/.github/workflows)
- [google/accompanist](https://github.com/google/accompanist/blob/main/.github/workflows)
- [dotanuki-labs/norris](https://github.com/dotanuki-labs/norris/blob/master/.github/workflows/main.yml)

If you are using **Android Emulator Runner** and want your project included in the list, please feel free to create an issue or open a pull request.
15 changes: 2 additions & 13 deletions lib/sdk-installer.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,8 @@ function installAndroidSdk(apiLevel, target, arch, emulatorBuild, ndkVersion, cm
core.addPath(`${cmdlineToolsPath}/latest:${cmdlineToolsPath}/latest/bin:${process.env.ANDROID_SDK_ROOT}/platform-tools`);
// set standard AVD path
core.exportVariable('ANDROID_AVD_HOME', `${process.env.HOME}/.android/avd`);
// additional permission and license requirements for Linux
const sdkPreviewLicensePath = `${process.env.ANDROID_SDK_ROOT}/licenses/android-sdk-preview-license`;
if (!isOnMac && !fs.existsSync(sdkPreviewLicensePath)) {
fs.writeFileSync(sdkPreviewLicensePath, '\n84831b9409646a918e30573bab4c9c91346d8abd');
}
// license required for API 30 and non-default API 28 system images
const sdkArmDbtLicensePath = `${process.env.ANDROID_SDK_ROOT}/licenses/android-sdk-arm-dbt-license`;
if (requiresArmDbtLicense(apiLevel, target) && !fs.existsSync(sdkArmDbtLicensePath)) {
fs.writeFileSync(sdkArmDbtLicensePath, '\n859f317696f67ef3d7f30a50a5560e7834b43903');
}
// accept all Android SDK licenses
yield exec.exec(`sh -c \\"yes | sdkmanager --licenses > /dev/null"`);
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"`);
console.log('Installing latest emulator.');
Expand All @@ -94,6 +86,3 @@ function installAndroidSdk(apiLevel, target, arch, emulatorBuild, ndkVersion, cm
});
}
exports.installAndroidSdk = installAndroidSdk;
function requiresArmDbtLicense(apiLevel, target) {
return apiLevel === 30 || (apiLevel === 28 && target !== 'default');
}
17 changes: 2 additions & 15 deletions src/sdk-installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,8 @@ export async function installAndroidSdk(apiLevel: number, target: string, arch:
// set standard AVD path
core.exportVariable('ANDROID_AVD_HOME', `${process.env.HOME}/.android/avd`);

// additional permission and license requirements for Linux
const sdkPreviewLicensePath = `${process.env.ANDROID_SDK_ROOT}/licenses/android-sdk-preview-license`;
if (!isOnMac && !fs.existsSync(sdkPreviewLicensePath)) {
fs.writeFileSync(sdkPreviewLicensePath, '\n84831b9409646a918e30573bab4c9c91346d8abd');
}

// license required for API 30 and non-default API 28 system images
const sdkArmDbtLicensePath = `${process.env.ANDROID_SDK_ROOT}/licenses/android-sdk-arm-dbt-license`;
if (requiresArmDbtLicense(apiLevel, target) && !fs.existsSync(sdkArmDbtLicensePath)) {
fs.writeFileSync(sdkArmDbtLicensePath, '\n859f317696f67ef3d7f30a50a5560e7834b43903');
}
// accept all Android SDK licenses
await exec.exec(`sh -c \\"yes | sdkmanager --licenses > /dev/null"`);

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

Expand Down Expand Up @@ -73,7 +64,3 @@ export async function installAndroidSdk(apiLevel: number, target: string, arch:
await exec.exec(`sh -c \\"sdkmanager --install 'cmake;${cmakeVersion}' > /dev/null"`);
}
}

function requiresArmDbtLicense(apiLevel: number, target: string): boolean {
return apiLevel === 30 || (apiLevel === 28 && target !== 'default');
}

0 comments on commit 5de26e4

Please sign in to comment.