ci: transfer the accepted workstation Android SDK license
Android acceptance / android (push) Failing after 10m26s

This commit is contained in:
2026-10-07 20:58:24 +03:00
parent 824f0a07e2
commit 004d4622c4
2 changed files with 9 additions and 4 deletions
@@ -0,0 +1,2 @@
24333f8a63b6825ea9c5514f83c2829b004d1fee
+7 -4
View File
@@ -26,10 +26,13 @@ Move-Item -LiteralPath $source -Destination $destination
$env:ANDROID_HOME = $sdkRoot $env:ANDROID_HOME = $sdkRoot
$env:ANDROID_SDK_ROOT = $sdkRoot $env:ANDROID_SDK_ROOT = $sdkRoot
$manager = Join-Path $destination 'bin\sdkmanager.bat' $manager = Join-Path $destination 'bin\sdkmanager.bat'
$answers = ('y' + [Environment]::NewLine) * 100 # Transfer the already accepted workstation license, as documented by Google:
$answers | & $manager "--sdk_root=$sdkRoot" --licenses | Out-Null # https://developer.android.com/studio/intro/update#download-with-gradle
if ($LASTEXITCODE -ne 0) { throw 'Android SDK license setup failed' } # The self-hosted runner does not reliably forward stdin to sdkmanager prompts.
$answers | & $manager "--sdk_root=$sdkRoot" 'platform-tools' 'platforms;android-37.0' 'build-tools;37.0.0' $licenses = Join-Path $sdkRoot 'licenses'
New-Item -ItemType Directory -Path $licenses -Force | Out-Null
Copy-Item -LiteralPath (Join-Path $PSScriptRoot 'android-licenses\android-sdk-license') -Destination $licenses
& $manager "--sdk_root=$sdkRoot" 'platform-tools' 'platforms;android-37.0' 'build-tools;37.0.0'
if ($LASTEXITCODE -ne 0) { throw 'Android SDK installation failed' } if ($LASTEXITCODE -ne 0) { throw 'Android SDK installation failed' }
foreach ($required in @('platforms\android-37.0\android.jar', 'build-tools\37.0.0\aapt2.exe', 'licenses\android-sdk-license')) { foreach ($required in @('platforms\android-37.0\android.jar', 'build-tools\37.0.0\aapt2.exe', 'licenses\android-sdk-license')) {
if (-not (Test-Path -LiteralPath (Join-Path $sdkRoot $required))) { if (-not (Test-Path -LiteralPath (Join-Path $sdkRoot $required))) {