mirror of
https://github.com/reactivecircus/android-emulator-runner.git
synced 2026-08-31 17:49:33 +00:00
Support non-integer API level (#317)
* Support non-integer API level * update lib * Add test * No need to install platforms. Mostly application will use different SDK platform. * Update lib
This commit is contained in:
@@ -6,6 +6,8 @@ exports.VALID_TARGETS = ['default', 'google_apis', 'aosp_atd', 'google_atd', 'go
|
||||
exports.VALID_ARCHS = ['x86', 'x86_64', 'arm64-v8a'];
|
||||
exports.VALID_CHANNELS = ['stable', 'beta', 'dev', 'canary'];
|
||||
function checkApiLevel(apiLevel) {
|
||||
if (apiLevel.startsWith('UpsideDownCake') || apiLevel === 'TiramisuPrivacySandbox')
|
||||
return;
|
||||
if (isNaN(Number(apiLevel)) || !Number.isInteger(Number(apiLevel))) {
|
||||
throw new Error(`Unexpected API level: '${apiLevel}'.`);
|
||||
}
|
||||
|
||||
+2
-3
@@ -61,9 +61,8 @@ function run() {
|
||||
}
|
||||
}
|
||||
// API level of the platform and system image
|
||||
const apiLevelInput = core.getInput('api-level', { required: true });
|
||||
(0, input_validator_1.checkApiLevel)(apiLevelInput);
|
||||
const apiLevel = Number(apiLevelInput);
|
||||
const apiLevel = core.getInput('api-level', { required: true });
|
||||
(0, input_validator_1.checkApiLevel)(apiLevel);
|
||||
console.log(`API level: ${apiLevel}`);
|
||||
// target of the system image
|
||||
const targetInput = core.getInput('target');
|
||||
|
||||
@@ -68,7 +68,7 @@ function installAndroidSdk(apiLevel, target, arch, channelId, emulatorBuild, ndk
|
||||
// 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"`);
|
||||
yield exec.exec(`sh -c \\"sdkmanager --install 'build-tools;${BUILD_TOOLS_VERSION}' platform-tools > /dev/null"`);
|
||||
console.log('Installing latest emulator.');
|
||||
yield exec.exec(`sh -c \\"sdkmanager --install emulator --channel=${channelId} > /dev/null"`);
|
||||
if (emulatorBuild) {
|
||||
|
||||
Reference in New Issue
Block a user