mirror of
https://github.com/android-actions/setup-android
synced 2024-11-22 05:29:34 -08:00
run build
This commit is contained in:
parent
9e58d95cb5
commit
668f98f7ee
2 changed files with 15 additions and 3 deletions
16
dist/index.js
vendored
16
dist/index.js
vendored
|
@ -1405,6 +1405,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const core = __importStar(__webpack_require__(470));
|
const core = __importStar(__webpack_require__(470));
|
||||||
const path = __importStar(__webpack_require__(622));
|
const path = __importStar(__webpack_require__(622));
|
||||||
const tc = __importStar(__webpack_require__(533));
|
const tc = __importStar(__webpack_require__(533));
|
||||||
|
const fs = __importStar(__webpack_require__(747));
|
||||||
const matchers = [
|
const matchers = [
|
||||||
'android-lint-file-matcher.json',
|
'android-lint-file-matcher.json',
|
||||||
'android-lint-line-matcher.json',
|
'android-lint-line-matcher.json',
|
||||||
|
@ -1412,6 +1413,9 @@ const matchers = [
|
||||||
'kotlin-error-matcher.json',
|
'kotlin-error-matcher.json',
|
||||||
'kotlin-warning-matcher.json'
|
'kotlin-warning-matcher.json'
|
||||||
];
|
];
|
||||||
|
const licenses = {
|
||||||
|
'android-sdk-license': '\n24333f8a63b6825ea9c5514f83c2829b004d1fee'
|
||||||
|
};
|
||||||
let tempDirectory = process.env['RUNNER_TEMP'] || '';
|
let tempDirectory = process.env['RUNNER_TEMP'] || '';
|
||||||
const IS_WINDOWS = process.platform === 'win32';
|
const IS_WINDOWS = process.platform === 'win32';
|
||||||
const cmdToolsVersion = '6609375';
|
const cmdToolsVersion = '6609375';
|
||||||
|
@ -1445,11 +1449,19 @@ function run() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
const tempDir = path.join(tempDirectory, `temp_${Math.floor(Math.random() * 2000000000)}`);
|
const tempDir = path.join(tempDirectory, `temp_${Math.floor(Math.random() * 2000000000)}`);
|
||||||
const androidHome = path.join(tempDir, 'android');
|
const androidHome = path.join(tempDir, 'android');
|
||||||
|
const cmdlineTools = path.join(androidHome, 'cmdline-tools');
|
||||||
const cmdToolsZip = yield tc.downloadTool(`https://dl.google.com/android/repository/commandlinetools-${cmdToolsOS}-${cmdToolsVersion}_latest.zip`);
|
const cmdToolsZip = yield tc.downloadTool(`https://dl.google.com/android/repository/commandlinetools-${cmdToolsOS}-${cmdToolsVersion}_latest.zip`);
|
||||||
core.debug('extract android commandlinetools');
|
core.debug('extract android commandlinetools');
|
||||||
yield tc.extractZip(cmdToolsZip, androidHome);
|
yield tc.extractZip(cmdToolsZip, cmdlineTools);
|
||||||
core.exportVariable('ANDROID_HOME', androidHome);
|
core.exportVariable('ANDROID_HOME', androidHome);
|
||||||
core.addPath(path.join(androidHome, 'tools', 'bin'));
|
core.exportVariable('ANDROID_SDK_ROOT', androidHome);
|
||||||
|
core.addPath(path.join(cmdlineTools, 'tools', 'bin'));
|
||||||
|
const licenseDir = path.join(androidHome, 'licenses');
|
||||||
|
fs.existsSync(licenseDir) || fs.mkdirSync(licenseDir);
|
||||||
|
for (const [licenseName, licenseHash] of Object.entries(licenses)) {
|
||||||
|
const licenseFile = path.join(licenseDir, licenseName);
|
||||||
|
fs.appendFileSync(licenseFile, licenseHash);
|
||||||
|
}
|
||||||
core.debug('add matchers');
|
core.debug('add matchers');
|
||||||
const matchersPath = path.join(__dirname, '..', '.github');
|
const matchersPath = path.join(__dirname, '..', '.github');
|
||||||
for (const matcher of matchers) {
|
for (const matcher of matchers) {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import * as core from '@actions/core'
|
import * as core from '@actions/core'
|
||||||
import * as path from 'path'
|
import * as path from 'path'
|
||||||
import * as tc from '@actions/tool-cache'
|
import * as tc from '@actions/tool-cache'
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs'
|
||||||
|
|
||||||
const matchers = [
|
const matchers = [
|
||||||
'android-lint-file-matcher.json',
|
'android-lint-file-matcher.json',
|
||||||
|
|
Loading…
Reference in a new issue