Setup more specific 2017 apk/ipas for testing lanes (#10569)
* set provisionator sdks from pipeline * - 2017 specific ui test builds * - env * - arg * - arg * - arg * - arg * - arg * - arg * - arg * - arg * - arg * - arg * - arg * - arg * - build configuration * - build configuration * - build configuration * - build configuration * - check for signVmImage before running nuget signing * Update provisioning.csx * - build downloads update
This commit is contained in:
Родитель
5062f53371
Коммит
4a64fa2fc1
|
@ -1,7 +1,7 @@
|
|||
<Project>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Xamarin.Build.Download">
|
||||
<Version>0.7.1</Version>
|
||||
<Version>0.10.0</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition="'$(TargetFrameworkVersion)' == 'v10.0'">
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
variables:
|
||||
- name: DefaultBuildConfiguration
|
||||
value: Debug
|
||||
- name: DefaultBuildPlatform
|
||||
value: 'any cpu'
|
||||
- name: ApkName
|
||||
|
@ -206,6 +204,23 @@ stages:
|
|||
parameters:
|
||||
vmImage: $(macOSXVmImage)
|
||||
provisionatorPath : 'build/provisioning/provisioning.csx'
|
||||
buildForVS2017: false
|
||||
buildConfiguration: $(DefaultBuildConfiguration)
|
||||
|
||||
- stage: android_2017
|
||||
displayName: Build Android 2017
|
||||
condition: eq(variables['System.TeamProject'], 'devdiv')
|
||||
${{ if eq(variables['System.TeamProject'], 'devdiv') }}:
|
||||
dependsOn: windows
|
||||
${{ if eq(variables['System.TeamProject'], 'public') }}:
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: build/steps/build-android.yml
|
||||
parameters:
|
||||
vmImage: 'macOS-10.14'
|
||||
provisionatorPath : 'build/provisioning/provisioning.csx'
|
||||
buildForVS2017: true
|
||||
buildConfiguration: $(DefaultBuildConfiguration)
|
||||
|
||||
- stage: build_osx
|
||||
displayName: Build OSX
|
||||
|
@ -274,6 +289,6 @@ stages:
|
|||
msbuild
|
||||
steps:
|
||||
- template: build/steps/build-sign.yml
|
||||
condition: and(succeeded(), or(eq(variables['Sign'], 'true'), or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), startsWith(variables['Build.SourceBranch'],'refs/tags/'))))
|
||||
condition: and(succeeded(), ne(variables['signVmImage'], ''), or(eq(variables['Sign'], 'true'), or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), startsWith(variables['Build.SourceBranch'],'refs/tags/'))))
|
||||
|
||||
|
||||
|
|
|
@ -40,7 +40,9 @@ var packageVersion = Argument("packageVersion", "");
|
|||
var releaseChannelArg = Argument("CHANNEL", "Stable");
|
||||
releaseChannelArg = EnvironmentVariable("CHANNEL") ?? releaseChannelArg;
|
||||
var teamProject = Argument("TeamProject", "");
|
||||
bool buildForVS2017 = Convert.ToBoolean(Argument("buildForVS2017", "false"));
|
||||
|
||||
var buildForVS2017Arg = EnvironmentVariable("buildForVS2017") ?? Argument("buildForVS2017", "false");
|
||||
bool buildForVS2017 = Convert.ToBoolean(buildForVS2017Arg);
|
||||
|
||||
string artifactStagingDirectory = Argument("Build_ArtifactStagingDirectory", (string)null) ?? EnvironmentVariable("Build.ArtifactStagingDirectory") ?? EnvironmentVariable("Build_ArtifactStagingDirectory") ?? ".";
|
||||
var ANDROID_HOME = EnvironmentVariable("ANDROID_HOME") ??
|
||||
|
@ -52,6 +54,8 @@ string[] androidSdkManagerInstalls = new string[0]; //new [] { "platforms;androi
|
|||
Information ("ANDROID_HOME: {0}", ANDROID_HOME);
|
||||
Information ("Team Project: {0}", teamProject);
|
||||
Information ("buildForVS2017: {0}", buildForVS2017);
|
||||
Information ("EnvironmentVariable buildForVS2017: {0}", EnvironmentVariable("buildForVS2017"));
|
||||
Information ("Argument buildForVS2017: {0}", Argument("buildForVS2017", "not set"));
|
||||
|
||||
var releaseChannel = ReleaseChannel.Stable;
|
||||
if(releaseChannelArg == "Preview")
|
||||
|
@ -69,7 +73,7 @@ string monoPatchVersion = "";
|
|||
string monoMajorVersion = "";
|
||||
string monoVersion = "";
|
||||
|
||||
if(buildForVS2017 || teamProject == "DevDiv")
|
||||
if(buildForVS2017)
|
||||
{
|
||||
// VS2017
|
||||
monoMajorVersion = "5.18.1";
|
||||
|
|
|
@ -14,6 +14,8 @@ string macSDK_macos = "";//$"https://download.visualstudio.microsoft.com/downloa
|
|||
|
||||
|
||||
|
||||
Console.WriteLine ("buildForVS2017: {0}", Environment.GetEnvironmentVariable ("buildForVS2017"));
|
||||
|
||||
if (IsMac)
|
||||
{
|
||||
if (!Directory.Exists ("/Library/Frameworks/Mono.framework/Versions/Current/Commands/"))
|
||||
|
@ -26,6 +28,10 @@ if (IsMac)
|
|||
Item (XreItem.Java_OpenJDK_1_8_0_25);
|
||||
|
||||
string releaseChannel = Environment.GetEnvironmentVariable ("CHANNEL");
|
||||
Console.WriteLine ("ANDROID_SDK_MAC: {0}", Environment.GetEnvironmentVariable ("ANDROID_SDK_MAC"));
|
||||
Console.WriteLine ("IOS_SDK_MAC: {0}", Environment.GetEnvironmentVariable ("IOS_SDK_MAC"));
|
||||
Console.WriteLine ("MONO_SDK_MAC: {0}", Environment.GetEnvironmentVariable ("MONO_SDK_MAC"));
|
||||
Console.WriteLine ("MAC_SDK_MAC: {0}", Environment.GetEnvironmentVariable ("MAC_SDK_MAC"));
|
||||
|
||||
if(releaseChannel == "Preview")
|
||||
{
|
||||
|
@ -35,6 +41,22 @@ if (IsMac)
|
|||
XamarinChannel("Stable");
|
||||
}
|
||||
|
||||
if(!String.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable ("ANDROID_SDK_MAC")))
|
||||
Item ("Xamarin.Android")
|
||||
.Source (_ => Environment.GetEnvironmentVariable ("ANDROID_SDK_MAC"));
|
||||
|
||||
if(!String.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable ("IOS_SDK_MAC")))
|
||||
Item ("Xamarin.iOS")
|
||||
.Source (_ => Environment.GetEnvironmentVariable ("IOS_SDK_MAC"));
|
||||
|
||||
if(!String.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable ("MONO_SDK_MAC")))
|
||||
Item ("Mono")
|
||||
.Source (_ => Environment.GetEnvironmentVariable ("MONO_SDK_MAC"));
|
||||
|
||||
if(!String.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable ("MAC_SDK_MAC")))
|
||||
Item ("Xamarin.Mac")
|
||||
.Source (_ => Environment.GetEnvironmentVariable ("MAC_SDK_MAC"));
|
||||
|
||||
if(!String.IsNullOrEmpty(monoSDK_macos))
|
||||
Item ("Mono", monoVersion)
|
||||
.Source (_ => monoSDK_macos);
|
||||
|
@ -53,6 +75,23 @@ if (IsMac)
|
|||
}
|
||||
else
|
||||
{
|
||||
|
||||
if(!String.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable ("ANDROID_SDK_WINDOWS")))
|
||||
Item ("Xamarin.Android")
|
||||
.Source (_ => Environment.GetEnvironmentVariable ("ANDROID_SDK_WINDOWS"));
|
||||
|
||||
if(!String.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable ("IOS_SDK_WINDOWS")))
|
||||
Item ("Xamarin.iOS")
|
||||
.Source (_ => Environment.GetEnvironmentVariable ("IOS_SDK_WINDOWS"));
|
||||
|
||||
if(!String.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable ("MONO_SDK_WINDOWS")))
|
||||
Item ("Mono")
|
||||
.Source (_ => Environment.GetEnvironmentVariable ("MONO_SDK_WINDOWS"));
|
||||
|
||||
if(!String.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable ("MAC_SDK_WINDOWS")))
|
||||
Item ("Xamarin.Mac")
|
||||
.Source (_ => Environment.GetEnvironmentVariable ("MAC_SDK_WINDOWS"));
|
||||
|
||||
if(!String.IsNullOrEmpty(androidSDK_windows))
|
||||
Item ("Xamarin.Android", "10.0.0.43")
|
||||
.Source (_ => androidSDK_windows);
|
||||
|
|
|
@ -29,30 +29,33 @@ jobs:
|
|||
android_legacy:
|
||||
renderers: 'LEGACY'
|
||||
outputfolder: 'legacyRenderers'
|
||||
buildForVS2017: ${{ parameters.buildForVS2017 }}
|
||||
android_preAppCompat:
|
||||
renderers: 'PREAPPCOMPAT'
|
||||
outputfolder: 'preAppCompat'
|
||||
buildForVS2017: ${{ parameters.buildForVS2017 }}
|
||||
android_newRenderers:
|
||||
renderers: 'FAST'
|
||||
outputfolder: 'newRenderers'
|
||||
buildForVS2017: ${{ parameters.buildForVS2017 }}
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
|
||||
- task: xamops.azdevex.provisionator-task.provisionator@1
|
||||
displayName: 'Provisionator'
|
||||
condition: eq(variables['provisioning'], 'true')
|
||||
condition: and(eq(variables['provisioning'], 'true'), eq(variables['buildForVS2017'], 'false'))
|
||||
inputs:
|
||||
provisioning_script: ${{ parameters.provisionatorPath }}
|
||||
provisioning_extra_args: ${{ parameters.provisionator.extraArguments }}
|
||||
|
||||
- task: Bash@3
|
||||
displayName: 'Cake Provision'
|
||||
condition: eq(variables['provisioningCake'], 'true')
|
||||
condition: or(eq(variables['provisioningCake'], 'true'), eq(variables['buildForVS2017'], 'true'))
|
||||
inputs:
|
||||
targetType: 'filePath'
|
||||
filePath: 'build.sh'
|
||||
arguments: --target provision --TeamProject="$(System.TeamProject)"
|
||||
arguments: --target provision --TeamProject="$(System.TeamProject)" --buildForVS2017=$(buildForVS2017)
|
||||
|
||||
- task: UseDotNet@2
|
||||
displayName: 'Install .net core $(DOTNET_VERSION)'
|
||||
|
@ -102,7 +105,7 @@ jobs:
|
|||
inputs:
|
||||
solution: ${{ parameters.androidProjectPath }}
|
||||
configuration: ${{ parameters.buildConfiguration }}
|
||||
msbuildArguments: '/t:"Rebuild;SignAndroidPackage" /p:ANDROID_RENDERERS="$(renderers)" /bl:$(Build.ArtifactStagingDirectory)/android-$(renderers).binlog'
|
||||
msbuildArguments: '/t:"Rebuild;SignAndroidPackage" /p:ANDROID_RENDERERS="$(renderers)" /bl:$(Build.ArtifactStagingDirectory)/android-$(renderers)-2017_$(buildForVS2017).binlog'
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy $(renderers)'
|
||||
|
@ -115,12 +118,22 @@ jobs:
|
|||
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy Android apk $(renderers) for UITest'
|
||||
condition: eq(variables['buildForVS2017'], 'false')
|
||||
inputs:
|
||||
Contents: |
|
||||
Xamarin.Forms.ControlGallery.Android/$(outputfolder)/$(ApkName)
|
||||
TargetFolder: '$(build.artifactstagingdirectory)/androidApp'
|
||||
CleanTargetFolder: true
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy Android apk $(renderers) for UITest 2017'
|
||||
condition: eq(variables['buildForVS2017'], 'true')
|
||||
inputs:
|
||||
Contents: |
|
||||
Xamarin.Forms.ControlGallery.Android/$(outputfolder)/$(ApkName)
|
||||
TargetFolder: '$(build.artifactstagingdirectory)/androidApp_2017'
|
||||
CleanTargetFolder: true
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: 'Publish Artifact: AndroidApps'
|
||||
condition: always()
|
||||
|
|
|
@ -53,7 +53,7 @@ steps:
|
|||
}
|
||||
failOnStderr: true
|
||||
displayName: 'Update nuspecs'
|
||||
condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), startsWith(variables['Build.SourceBranch'],'refs/tags/')))
|
||||
condition: and(succeeded(), or(eq(variables['DefaultBuildConfiguration'], 'Release'), eq(variables['Build.SourceBranch'], 'refs/heads/master'), startsWith(variables['Build.SourceBranch'],'refs/tags/')))
|
||||
|
||||
- task: NuGetCommand@2
|
||||
displayName: 'Make NuGet Package Release'
|
||||
|
@ -64,7 +64,7 @@ steps:
|
|||
packDestination: '$(Build.ArtifactStagingDirectory)/nuget/release'
|
||||
versioningScheme: byEnvVar
|
||||
versionEnvVar: nugetPackageVersion
|
||||
condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), startsWith(variables['Build.SourceBranch'],'refs/tags/')))
|
||||
condition: and(succeeded(), or(eq(variables['DefaultBuildConfiguration'], 'Release'), eq(variables['Build.SourceBranch'], 'refs/heads/master'), startsWith(variables['Build.SourceBranch'],'refs/tags/')))
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: 'Publish Artifact: nuget'
|
||||
|
|
|
@ -68,6 +68,7 @@ steps:
|
|||
displayName: 'Build solution Xamarin.Forms.Build.Tasks/Xamarin.Forms.Build.Tasks.csproj'
|
||||
inputs:
|
||||
solution: Xamarin.Forms.Build.Tasks/Xamarin.Forms.Build.Tasks.csproj
|
||||
configuration: $(buildConfiguration)
|
||||
msbuildArguments: /bl:$(Build.ArtifactStagingDirectory)/tasks.binlog
|
||||
|
||||
- task: InstallAppleCertificate@2
|
||||
|
@ -112,7 +113,6 @@ steps:
|
|||
OverWrite: true
|
||||
flattenFolders: true
|
||||
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy iOS Files for UITest'
|
||||
condition: eq(variables['buildForVS2017'], 'false')
|
||||
|
@ -129,6 +129,21 @@ steps:
|
|||
CleanTargetFolder: true
|
||||
flattenFolders: true
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy iOS Files for UITest 2017'
|
||||
condition: eq(variables['buildForVS2017'], 'true')
|
||||
inputs:
|
||||
Contents: |
|
||||
**/$(IpaName)
|
||||
Xamarin.Forms.Core.iOS.UITests/bin/$(BuildConfiguration)/Newtonsoft.Json.*
|
||||
Xamarin.Forms.Core.iOS.UITests/bin/$(BuildConfiguration)/nunit.*
|
||||
Xamarin.Forms.Core.iOS.UITests/bin/$(BuildConfiguration)/NUnit3.*
|
||||
Xamarin.Forms.Core.iOS.UITests/bin/$(BuildConfiguration)/Plugin.*
|
||||
Xamarin.Forms.Core.iOS.UITests/bin/$(BuildConfiguration)/Xamarin.*
|
||||
|
||||
TargetFolder: '$(build.artifactstagingdirectory)/ios_2017'
|
||||
CleanTargetFolder: true
|
||||
flattenFolders: true
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy Android Files for UITest'
|
||||
|
|
Загрузка…
Ссылка в новой задаче