diff --git a/appveyor.yml b/appveyor.yml index 7f3fcf575..c6541942e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -5,10 +5,10 @@ on_finish: install: - choco install cloc --no-progress - "cloc --vcs git --exclude-dir Resources,store,test,UWP,Properties --include-lang C#,JavaScript,TypeScript,PowerShell" - # - appveyor DownloadFile https://dist.nuget.org/win-x86-commandline/latest/nuget.exe - # - appveyor DownloadFile https://aka.ms/vs/15/release/vs_community.exe - # - vs_community.exe update --wait --quiet --norestart --installPath "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community" - # - ps: .\src\Android\update-android.ps1 + - appveyor DownloadFile https://dist.nuget.org/win-x86-commandline/latest/nuget.exe + - appveyor DownloadFile https://aka.ms/vs/15/release/vs_community.exe + - vs_community.exe update --wait --quiet --norestart --installPath "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community" + - ps: .\src\Android\update-android.ps1 before_build: - nuget restore - IF DEFINED keystore_dec_secret nuget install secure-file -ExcludeVersion diff --git a/src/Android/update-android.ps1 b/src/Android/update-android.ps1 index 4d4996655..5862a69df 100644 --- a/src/Android/update-android.ps1 +++ b/src/Android/update-android.ps1 @@ -1,28 +1,5 @@ -$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 '(?\d+)- (?.+), 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" \ No newline at end of file +cd "${env:ProgramFiles(x86)}\Android\android-sdk\tools\bin" +.\sdkmanager --list +Echo 'y' | .\sdkmanager "platforms;android-28" "build-tools;28.0.2" +Echo 'y' | .\sdkmanager --update +dir "${env:ProgramFiles(x86)}\Android\android-sdk\platforms"