mirror of
https://github.com/bitwarden/mobile.git
synced 2024-11-27 12:26:31 +01:00
update android sdks on appveyor
This commit is contained in:
parent
e62ff2fe36
commit
3e0097c22c
@ -155,6 +155,7 @@
|
||||
<ItemGroup>
|
||||
<None Include="8bit.keystore.enc" />
|
||||
<GoogleServicesJson Include="google-services.json" />
|
||||
<None Include="update-android.ps1" />
|
||||
<None Include="ci-build-apks.ps1" />
|
||||
<None Include="google-services.json.enc" />
|
||||
<None Include="Resources\AboutResources.txt" />
|
||||
|
28
src/Android/update-android.ps1
Normal file
28
src/Android/update-android.ps1
Normal file
@ -0,0 +1,28 @@
|
||||
$AndroidToolPath = "${env:ProgramFiles(x86)}\Android\android-sdk\tools\android"
|
||||
#$AndroidToolPath = "$env:localappdata\Android\android-sdk\tools\android"
|
||||
Function Get-AndroidSDKs() {
|
||||
$output = & $AndroidToolPath list sdk --all
|
||||
$sdks = $output |% {
|
||||
if ($_ -match '(?<index>\d+)- (?<sdk>.+), revision (?<revision>[\d\.]+)') {
|
||||
$sdk = New-Object PSObject
|
||||
Add-Member -InputObject $sdk -MemberType NoteProperty -Name Index -Value $Matches.index
|
||||
Add-Member -InputObject $sdk -MemberType NoteProperty -Name Name -Value $Matches.sdk
|
||||
Add-Member -InputObject $sdk -MemberType NoteProperty -Name Revision -Value $Matches.revision
|
||||
$sdk
|
||||
}
|
||||
}
|
||||
$sdks
|
||||
}
|
||||
Function Install-AndroidSDK() {
|
||||
[CmdletBinding()]
|
||||
Param(
|
||||
[Parameter(Mandatory=$true, Position=0)]
|
||||
[PSObject[]]$sdks
|
||||
)
|
||||
$sdkIndexes = $sdks |% { $_.Index }
|
||||
$sdkIndexArgument = [string]::Join(',', $sdkIndexes)
|
||||
Echo 'y' | & $AndroidToolPath update sdk -u -a -t $sdkIndexArgument
|
||||
}
|
||||
$sdks = Get-AndroidSDKs |? { $_.name -like 'sdk platform*API 28*' }
|
||||
Install-AndroidSDK -sdks $sdks
|
||||
dir "${env:ProgramFiles(x86)}\Android\android-sdk\platforms"
|
Loading…
Reference in New Issue
Block a user