Fix path to sdkmanager for all platforms

This commit is contained in:
Max Romanyuta 2020-12-03 16:10:59 +02:00 committed by Dave Olsthoorn
parent ec68242df7
commit 903dd50e8f
2 changed files with 5 additions and 5 deletions

2
dist/index.js vendored

File diff suppressed because one or more lines are too long

View file

@ -41,11 +41,11 @@ async function install(): Promise<string> {
} else if (process.platform === 'darwin') { } else if (process.platform === 'darwin') {
const cmdlineToolsZip = await tc.downloadTool(COMMANDLINE_TOOLS_MAC_URL) const cmdlineToolsZip = await tc.downloadTool(COMMANDLINE_TOOLS_MAC_URL)
const cmdlineTools = await tc.extractZip(cmdlineToolsZip) const cmdlineTools = await tc.extractZip(cmdlineToolsZip)
sdkManager = path.join(cmdlineTools, 'tools', 'bin', 'sdkmanager') sdkManager = path.join(cmdlineTools, 'cmdline-tools', 'bin', 'sdkmanager')
} else if (process.platform === 'win32') { } else if (process.platform === 'win32') {
const cmdlineToolsZip = await tc.downloadTool(COMMANDLINE_TOOLS_WIN_URL) const cmdlineToolsZip = await tc.downloadTool(COMMANDLINE_TOOLS_WIN_URL)
const cmdlineTools = await tc.extractZip(cmdlineToolsZip) const cmdlineTools = await tc.extractZip(cmdlineToolsZip)
sdkManager = path.join(cmdlineTools, 'tools', 'bin', 'sdkmanager.bat') sdkManager = path.join(cmdlineTools, 'cmdline-tools', 'bin', 'sdkmanager.bat')
} else { } else {
core.error(`Unsupported platform: ${process.platform}`) core.error(`Unsupported platform: ${process.platform}`)
} }
@ -58,7 +58,7 @@ async function install(): Promise<string> {
await exec.exec( await exec.exec(
sdkManager, sdkManager,
['--include_obsolete', `--sdk_root=${ANDROID_SDK_ROOT}`, 'tools'], ['--include_obsolete', `--sdk_root=${ANDROID_SDK_ROOT}`, 'cmdline-tools'],
{input: acceptBuffer} {input: acceptBuffer}
) )
@ -71,7 +71,7 @@ async function run(): Promise<void> {
core.exportVariable('ANDROID_HOME', ANDROID_SDK_ROOT) core.exportVariable('ANDROID_HOME', ANDROID_SDK_ROOT)
core.exportVariable('ANDROID_SDK_ROOT', ANDROID_SDK_ROOT) core.exportVariable('ANDROID_SDK_ROOT', ANDROID_SDK_ROOT)
core.addPath(path.join(ANDROID_SDK_ROOT, 'tools', 'bin')) core.addPath(path.join(ANDROID_SDK_ROOT, 'cmdline-tools', 'bin'))
core.addPath(path.join(ANDROID_SDK_ROOT, 'platform-tools')) core.addPath(path.join(ANDROID_SDK_ROOT, 'platform-tools'))
core.debug('add matchers') core.debug('add matchers')