setup-android/src/main.ts

27 lines
930 B
TypeScript
Raw Normal View History

2020-07-14 08:41:00 -07:00
import * as core from '@actions/core'
import * as path from 'path'
2020-07-25 09:07:39 -07:00
import {ANDROID_SDK_ROOT, ANNOTATION_MATCHERS} from './constants'
import {preGradleCache, preAndroidCache, preGradleWrapper} from './cache'
import {install} from './install'
2020-07-14 08:41:00 -07:00
async function run(): Promise<void> {
2020-07-25 09:07:39 -07:00
// process all caching but wait for them to all complete
await Promise.all([preGradleWrapper(), preGradleCache(), preAndroidCache()])
2020-07-14 08:41:00 -07:00
2020-07-25 09:07:39 -07:00
await install()
2020-07-14 08:41:00 -07:00
2020-07-25 09:07:39 -07:00
core.exportVariable('ANDROID_HOME', ANDROID_SDK_ROOT)
core.exportVariable('ANDROID_SDK_ROOT', ANDROID_SDK_ROOT)
2020-07-14 08:41:00 -07:00
2020-07-25 09:07:39 -07:00
core.addPath(path.join(ANDROID_SDK_ROOT, 'tools', 'bin'))
core.addPath(path.join(ANDROID_SDK_ROOT, 'platform-tools'))
2020-07-14 08:41:00 -07:00
core.debug('add matchers')
2020-07-25 09:07:39 -07:00
const matchersPath = path.join(__dirname, '..', '..', '.github')
for (const matcher of ANNOTATION_MATCHERS) {
2020-07-14 08:41:00 -07:00
console.log(`##[add-matcher]${path.join(matchersPath, matcher)}`)
}
}
run()