From 6351caa8f414507f6f912948e8226dbb76ab469b Mon Sep 17 00:00:00 2001 From: Rui Marinho Date: Thu, 31 Oct 2019 17:06:42 +0000 Subject: [PATCH] [Build] Clean repos, update vs image (#8339) --- azure-pipelines.yml | 6 ++---- build.cake | 12 +++++++++--- build/provisioning/provisioning.csx | 4 +++- build/steps/build-android.yml | 1 + build/steps/build-osx.yml | 1 + build/steps/build-windows.yml | 8 +++++--- 6 files changed, 21 insertions(+), 11 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3858145..b304802 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -15,9 +15,7 @@ variables: value: 5.0.2 - name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE value: true -- name: winVmImage - value: Hosted VS2017 - + resources: repositories: - repository: xamarin-templates @@ -57,7 +55,7 @@ jobs: buildConfiguration: $(DefaultBuildConfiguration) buildPlatform: $(DefaultBuildPlatform) provisionatorPath : 'build/provisioning/provisioning.csx' - + - template: build/steps/build-android.yml parameters: name: android_legacy diff --git a/build.cake b/build.cake index 3199a8b..2764fe1 100644 --- a/build.cake +++ b/build.cake @@ -51,7 +51,7 @@ string monoPatchVersion = "177"; string monoVersion = $"{monoMajorVersion}.{monoPatchVersion}"; string monoSDK_windows = $"https://download.mono-project.com/archive/{monoMajorVersion}/windows-installer/mono-{monoVersion}-x64-0.msi"; -string androidSDK_windows = "https://aka.ms/xamarin-android-commercial-d15-9-windows"; +string androidSDK_windows = "";//"https://aka.ms/xamarin-android-commercial-d15-9-windows"; string iOSSDK_windows = "https://download.visualstudio.microsoft.com/download/pr/71f33151-5db4-49cc-ac70-ba835a9f81e2/d256c6c50cd80ec0207783c5c7a4bc2f/xamarin.visualstudio.apple.sdk.4.12.3.83.vsix"; string macSDK_windows = ""; @@ -65,7 +65,7 @@ string monoSDK = IsRunningOnWindows() ? monoSDK_windows : monoSDK_macos; string iosSDK = IsRunningOnWindows() ? "" : iOSSDK_macos; string macSDK = IsRunningOnWindows() ? "" : macSDK_macos; -string[] androidSdkManagerInstalls = new string[0]; //new [] { "platforms;android-29"}; +string[] androidSdkManagerInstalls = new string[0];//new [] { "platforms;android-24", "platforms;android-28"}; ////////////////////////////////////////////////////////////////////// // TASKS @@ -98,6 +98,7 @@ Task("provision-iossdk") }); Task("provision-androidsdk") + .Description("Install Xamarin.Android SDK") .Does(async () => { Information ("ANDROID_HOME: {0}", ANDROID_HOME); @@ -109,7 +110,12 @@ Task("provision-androidsdk") SkipVersionCheck = true }; - try { AcceptLicenses (androidSdkSettings); } catch { } + + AcceptLicenses (androidSdkSettings); + + AndroidSdkManagerUpdateAll (androidSdkSettings); + + AcceptLicenses (androidSdkSettings); AndroidSdkManagerInstall (androidSdkManagerInstalls, androidSdkSettings); } diff --git a/build/provisioning/provisioning.csx b/build/provisioning/provisioning.csx index 86f4c62..298dc05 100644 --- a/build/provisioning/provisioning.csx +++ b/build/provisioning/provisioning.csx @@ -67,6 +67,8 @@ else } Item(XreItem.Java_OpenJDK_1_8_0_25); +AndroidSdk ().ApiLevel((AndroidApiLevel)24); +AndroidSdk ().ApiLevel((AndroidApiLevel)28); AndroidSdk ().ApiLevel((AndroidApiLevel)29); void ln (string source, string destination) @@ -74,4 +76,4 @@ void ln (string source, string destination) Console.WriteLine ($"ln -sf {source} {destination}"); if (!Config.DryRun) Exec ("/bin/ln", "-sf", source, destination); -} \ No newline at end of file +} diff --git a/build/steps/build-android.yml b/build/steps/build-android.yml index 6618505..231e6d6 100644 --- a/build/steps/build-android.yml +++ b/build/steps/build-android.yml @@ -26,6 +26,7 @@ jobs: dependsOn: ${{ parameters.dependsOn }} steps: - checkout: self + clean: true - task: xamops.azdevex.provisionator-task.provisionator@1 displayName: 'Provisionator' diff --git a/build/steps/build-osx.yml b/build/steps/build-osx.yml index f3d316a..0ea81ac 100644 --- a/build/steps/build-osx.yml +++ b/build/steps/build-osx.yml @@ -1,5 +1,6 @@ steps: - checkout: self + clean: true - task: xamops.azdevex.provisionator-task.provisionator@1 displayName: 'Provisionator' diff --git a/build/steps/build-windows.yml b/build/steps/build-windows.yml index 46c7b2e..ec0fc5a 100644 --- a/build/steps/build-windows.yml +++ b/build/steps/build-windows.yml @@ -33,10 +33,12 @@ jobs: BuildConfiguration: ${{ parameters.releaseBuildConfiguration }} BuildPlatform: ${{ parameters.buildPlatform }} steps: - - script: build.cmd -Target provision + - checkout: self + clean: true + - script: build.cmd -Target provision --verbosity=diagnostic displayName: 'Cake Provision' condition: eq(variables['provisioning'], 'false') - + - task: xamops.azdevex.provisionator-task.provisionator@1 displayName: 'Provisionator' condition: eq(variables['provisioning'], 'true') @@ -73,7 +75,7 @@ jobs: solution: ${{ parameters.slnPath }} platform: '$(BuildPlatform)' configuration: '$(BuildConfiguration)' - msbuildArguments: ${{ parameters.msbuildExtraArguments }} /p:JavaSdkDirectory="$(JAVA_HOME_8_X64)" + msbuildArguments: ${{ parameters.msbuildExtraArguments }} - task: VSTest@2 displayName: 'Unit Tests' -- 2.7.4