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:
LoveSy
2023-02-09 20:07:08 +08:00
committed by GitHub
parent e1248ae048
commit 8e947e5bd6
8 changed files with 19 additions and 10 deletions
+2
View File
@@ -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}'.`);
}