Add support for configuring hardware profile and running custom script.

This commit is contained in:
Yang Chen
2019-11-08 19:51:51 +11:00
parent 34df1eaf0e
commit 0f9b17b151
12 changed files with 150 additions and 81 deletions
+5 -5
View File
@@ -2,7 +2,7 @@
Object.defineProperty(exports, "__esModule", { value: true });
exports.MIN_API_LEVEL = 21;
exports.VALID_TARGETS = ['default', 'google_apis'];
exports.VALID_ABIS = ['x86', 'x86_64'];
exports.VALID_ARCHS = ['x86', 'x86_64'];
function checkApiLevel(apiLevel) {
if (isNaN(Number(apiLevel)) || !Number.isInteger(Number(apiLevel))) {
throw new Error(`Unexpected API level: '${apiLevel}'.`);
@@ -18,12 +18,12 @@ function checkTarget(target) {
}
}
exports.checkTarget = checkTarget;
function checkAbi(abi) {
if (!exports.VALID_ABIS.includes(abi)) {
throw new Error(`Value for input.abi '${abi}' is unknown. Supported options: ${exports.VALID_ABIS}.`);
function checkArch(arch) {
if (!exports.VALID_ARCHS.includes(arch)) {
throw new Error(`Value for input.arch '${arch}' is unknown. Supported options: ${exports.VALID_ARCHS}.`);
}
}
exports.checkAbi = checkAbi;
exports.checkArch = checkArch;
function checkHeadless(headless) {
if (headless !== 'true' && headless !== 'false') {
throw new Error(`Input for input.headless should be either 'true' or 'false'.`);