From 7435ede254074919d996c6784b7f238ff2bd6499 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 20 Nov 2017 16:17:28 -0500 Subject: [PATCH] install android 26 --- appveyor.yml | 1 + bitwarden-mobile.sln | 11 ++++++++++- install-android26.ps1 | 30 ++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 install-android26.ps1 diff --git a/appveyor.yml b/appveyor.yml index b1db5027e..f6fea0a60 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,7 @@ skip_tags: true init: - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) + - ps: install-android26.ps1 on_finish: - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) before_build: diff --git a/bitwarden-mobile.sln b/bitwarden-mobile.sln index c957391e1..183126166 100644 --- a/bitwarden-mobile.sln +++ b/bitwarden-mobile.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.26730.16 +VisualStudioVersion = 15.0.27004.2009 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Android", "src\Android\Android.csproj", "{04B18ED2-B76D-4947-8474-191F8FD2B5E0}" EndProject @@ -33,6 +33,15 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UWP", "src\UWP\UWP.csproj", EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "UWP.Images", "src\UWP.Images\UWP.Images.shproj", "{0BE54BBB-7772-4289-BD51-1FDBB0CC2446}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{F0E2E596-C3DB-474A-9C88-7824662894FA}" + ProjectSection(SolutionItems) = preProject + .gitignore = .gitignore + appveyor.yml = appveyor.yml + crowdin.yml = crowdin.yml + README.md = README.md + SECURITY.md = SECURITY.md + EndProjectSection +EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution src\UWP.Images\UWP.Images.projitems*{0be54bbb-7772-4289-bd51-1fdbb0cc2446}*SharedItemsImports = 13 diff --git a/install-android26.ps1 b/install-android26.ps1 new file mode 100644 index 000000000..593c2a6a5 --- /dev/null +++ b/install-android26.ps1 @@ -0,0 +1,30 @@ +$AndroidToolPath = "${env:ProgramFiles(x86)}\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 +} + +# install android 26 +$sdks = Get-AndroidSDKs |? { $_.name -like 'sdk platform*API 26*' } +Install-AndroidSDK -sdks $sdks