зеркало из https://github.com/DeGsoft/maui-linux.git
Add additional parameters to android build and fix iOS cake build (#11010)
* Fix iOS cake build and upload dsym * - all the files * - things * - dsym * - config * - builds * - remove yml property * - provision more * - provision more * - provision more * - just build ios proj not sln * - just build ios proj not sln * - just build ios proj not sln * - just build ios proj not sln * - fix typo * - cleanup for merge * - fix typo * - fix provisionator * - build android tests
This commit is contained in:
Родитель
1c5aec6854
Коммит
a9e84bb578
|
@ -2,7 +2,7 @@
|
|||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{39B3457F-01D8-43D0-8E84-D8C4F73CF48D}</ProjectGuid>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<Import Condition="'$(EnvironmentBuildPropsImported)' != 'True'" Project="..\Environment.Build.props" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
|
||||
<Platform Condition=" '$(Platform)' == '' ">iPhone</Platform>
|
||||
<ProjectGuid>{C7131F14-274F-4B55-ACA9-E81731AD012F}</ProjectGuid>
|
||||
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<OutputType>Exe</OutputType>
|
||||
|
@ -13,6 +13,7 @@
|
|||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
||||
<RestorePackages>true</RestorePackages>
|
||||
<DefineConstants Condition="'$(Use2017)' != 'true'">__XCODE11__;$(DefineConstants);</DefineConstants>
|
||||
<MtouchExtraArgs>--nolinkaway --optimize=experimental-xforms-product-type</MtouchExtraArgs>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
|
@ -40,7 +41,6 @@
|
|||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
<CodesignProvision />
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<MtouchExtraArgs>--nolinkaway</MtouchExtraArgs>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
|
||||
<DebugType>none</DebugType>
|
||||
|
@ -70,7 +70,6 @@
|
|||
</CodesignEntitlements>
|
||||
<MtouchLink>SdkOnly</MtouchLink>
|
||||
<MtouchProfiling>False</MtouchProfiling>
|
||||
<MtouchExtraArgs>--nolinkaway --optimize=experimental-xforms-product-type</MtouchExtraArgs>
|
||||
<MtouchFastDev>False</MtouchFastDev>
|
||||
<MtouchEnableGenericValueTypeSharing>True</MtouchEnableGenericValueTypeSharing>
|
||||
<MtouchUseLlvm>False</MtouchUseLlvm>
|
||||
|
@ -98,10 +97,10 @@
|
|||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<MtouchLink>Full</MtouchLink>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(TF_BUILD)' == 'true' OR '$(CI)' == 'true'">
|
||||
<MtouchLink>Full</MtouchLink>
|
||||
<MtouchExtraArgs>--nolinkaway --optimize=experimental-xforms-product-type</MtouchExtraArgs>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(RunConfiguration)' == 'Default' ">
|
||||
<AppExtensionDebugBundleId />
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{ABA078C4-F9BB-4924-8B2B-10FE0D2F5491}</ProjectGuid>
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
variables:
|
||||
- name: DefaultBuildConfiguration
|
||||
value: Debug
|
||||
- name: DefaultBuildPlatform
|
||||
value: 'any cpu'
|
||||
- name: ApkName
|
||||
value: AndroidControlGallery.AndroidControlGallery.apk
|
||||
- name: IpaName
|
||||
value: XamarinFormsControlGalleryiOS.ipa
|
||||
- name: SolutionFile
|
||||
value: Xamarin.Forms.sln
|
||||
- name: BuildVersion
|
||||
|
@ -155,6 +151,7 @@ stages:
|
|||
parameters:
|
||||
vmImage: $(macOSXVmImage)
|
||||
provisionatorPath : 'build/provisioning/provisioning.csx'
|
||||
buildConfiguration : $(DefaultBuildConfiguration)
|
||||
|
||||
|
||||
- stage: build_osx
|
||||
|
|
40
build.cake
40
build.cake
|
@ -34,10 +34,11 @@ PowerShell:
|
|||
// ARGUMENTS
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
var target = Argument("target", "Default");
|
||||
|
||||
var ANDROID_RENDERERS = Argument("ANDROID_RENDERERS", "FAST");
|
||||
var XamarinFormsVersion = Argument("XamarinFormsVersion", "");
|
||||
var target = Argument("target", "Default");
|
||||
var configuration = Argument("configuration", "Debug");
|
||||
var configuration = Argument("BUILD_CONFIGURATION", "Debug");
|
||||
var packageVersion = Argument("packageVersion", "");
|
||||
var releaseChannelArg = Argument("CHANNEL", "Stable");
|
||||
releaseChannelArg = EnvironmentVariable("CHANNEL") ?? releaseChannelArg;
|
||||
|
@ -47,11 +48,13 @@ string agentName = EnvironmentVariable("AGENT_NAME", "");
|
|||
bool isHostedAgent = agentName.StartsWith("Azure Pipelines");
|
||||
bool isCIBuild = !String.IsNullOrWhiteSpace(agentName);
|
||||
string artifactStagingDirectory = EnvironmentVariable("BUILD_ARTIFACTSTAGINGDIRECTORY", ".");
|
||||
|
||||
var ANDROID_HOME = EnvironmentVariable("ANDROID_HOME") ??
|
||||
(IsRunningOnWindows () ? "C:\\Program Files (x86)\\Android\\android-sdk\\" : "");
|
||||
|
||||
string[] androidSdkManagerInstalls = new [] { "platforms;android-28", "platforms;android-29", "build-tools;29.0.3"};
|
||||
|
||||
var IOS_BUILD_IPA = Argument("IOS_BUILD_IPA", false || isCIBuild);
|
||||
|
||||
(string name, string location)[] windowsSdksInstalls = new (string name, string location)[]
|
||||
{
|
||||
("10.0.19041.0", "https://go.microsoft.com/fwlink/p/?linkid=2120843"),
|
||||
|
@ -63,7 +66,9 @@ string[] androidSdkManagerInstalls = new [] { "platforms;android-28", "platforms
|
|||
string[] netFrameworkSdksLocalInstall = new string[]
|
||||
{
|
||||
"https://go.microsoft.com/fwlink/?linkid=2099470", //NET461 SDK
|
||||
"https://go.microsoft.com/fwlink/?linkid=874338" //NET472 SDK
|
||||
"https://go.microsoft.com/fwlink/?linkid=874338", //NET472 SDK
|
||||
"https://go.microsoft.com/fwlink/?linkid=2099465", //NET47
|
||||
"https://download.microsoft.com/download/A/1/D/A1D07600-6915-4CB8-A931-9A980EF47BB7/NDP47-DevPack-KB3186612-ENU.exe" //net47 targeting pack
|
||||
};
|
||||
|
||||
// these don't run on CI
|
||||
|
@ -614,7 +619,7 @@ Task("cg-android")
|
|||
};
|
||||
|
||||
buildSettings.BinaryLogger = binaryLogger;
|
||||
binaryLogger.FileName = $"{artifactStagingDirectory}/android-{ANDROID_RENDERERS}.binlog";
|
||||
binaryLogger.FileName = $"{artifactStagingDirectory}/android-{ANDROID_RENDERERS}_{buildForVS2017}.binlog";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -637,7 +642,26 @@ Task("cg-ios")
|
|||
.IsDependentOn("BuildTasks")
|
||||
.Does(() =>
|
||||
{
|
||||
MSBuild("./Xamarin.Forms.ControlGallery.iOS/Xamarin.Forms.ControlGallery.iOS.csproj", GetMSBuildSettings().WithRestore());
|
||||
var buildSettings =
|
||||
GetMSBuildSettings(null)
|
||||
.WithProperty("BuildIpa", $"{IOS_BUILD_IPA}");
|
||||
|
||||
if(isCIBuild)
|
||||
{
|
||||
var binaryLogger = new MSBuildBinaryLogSettings {
|
||||
Enabled = true
|
||||
};
|
||||
|
||||
buildSettings.BinaryLogger = binaryLogger;
|
||||
binaryLogger.FileName = $"{artifactStagingDirectory}/ios-cg-2017_{buildForVS2017}.binlog";
|
||||
}
|
||||
else
|
||||
{
|
||||
buildSettings = buildSettings.WithRestore();
|
||||
}
|
||||
|
||||
MSBuild("./Xamarin.Forms.ControlGallery.iOS/Xamarin.Forms.ControlGallery.iOS.csproj",
|
||||
buildSettings);
|
||||
});
|
||||
|
||||
Task("cg-ios-vs")
|
||||
|
@ -721,10 +745,10 @@ void StartVisualStudio(string sln = "Xamarin.Forms.sln")
|
|||
StartProcess("open", new ProcessSettings{ Arguments = "Xamarin.Forms.sln" });
|
||||
}
|
||||
|
||||
MSBuildSettings GetMSBuildSettings()
|
||||
MSBuildSettings GetMSBuildSettings(PlatformTarget? platformTarget = PlatformTarget.MSIL)
|
||||
{
|
||||
var buildSettings = new MSBuildSettings {
|
||||
PlatformTarget = PlatformTarget.MSIL,
|
||||
PlatformTarget = platformTarget,
|
||||
MSBuildPlatform = Cake.Common.Tools.MSBuild.MSBuildPlatform.x86,
|
||||
Configuration = configuration,
|
||||
};
|
||||
|
|
|
@ -48,8 +48,8 @@ if (IsMac)
|
|||
if(releaseChannel == "Beta")
|
||||
{
|
||||
Console.WriteLine("Installing Beta Channel");
|
||||
await ResolveUrl ("https://xamci.azurewebsites.net/dl/xamarin/xamarin-macios/d16-6/PKG-Xamarin.Mac-notarized");
|
||||
await ResolveUrl ("https://xamci.azurewebsites.net/dl/xamarin/xamarin-macios/d16-6/PKG-Xamarin.iOS-notarized");
|
||||
await ResolveUrl ("https://xamci.azurewebsites.net/dl/xamarin/xamarin-macios/d16-6-xcode11.6/PKG-Xamarin.Mac-notarized");
|
||||
await ResolveUrl ("https://xamci.azurewebsites.net/dl/xamarin/xamarin-macios/d16-6-xcode11.6/PKG-Xamarin.iOS-notarized");
|
||||
}
|
||||
else if(releaseChannel == "Preview")
|
||||
{
|
||||
|
@ -63,9 +63,17 @@ if (IsMac)
|
|||
|
||||
async System.Threading.Tasks.Task ResolveUrl (string url)
|
||||
{
|
||||
using (var response = await client.GetAsync (url, System.Net.Http.HttpCompletionOption.ResponseHeadersRead)) {
|
||||
response.EnsureSuccessStatusCode ();
|
||||
Item(response.RequestMessage.RequestUri.ToString());
|
||||
// When downloading a package using the xamci we have to use the following code to
|
||||
// install updates otherwise provionator can't tell the difference between a new package or an old one
|
||||
try
|
||||
{
|
||||
using (var response = await client.GetAsync (url, System.Net.Http.HttpCompletionOption.ResponseHeadersRead)) {
|
||||
response.EnsureSuccessStatusCode ();
|
||||
Item(response.RequestMessage.RequestUri.ToString());
|
||||
}
|
||||
}
|
||||
catch{
|
||||
Item(url);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ jobs:
|
|||
inputs:
|
||||
targetType: 'filePath'
|
||||
filePath: 'build.sh'
|
||||
arguments: --target cg-android --ANDROID_RENDERERS="$(renderers)" --GoogleMapsAPIKey="$(GoogleMapsAPIKey)"
|
||||
arguments: --target cg-android --ANDROID_RENDERERS="$(renderers)" --GoogleMapsAPIKey="$(GoogleMapsAPIKey)" --buildForVS2017=false --BUILD_CONFIGURATION=${{ parameters.buildConfiguration }} --MSBuildArguments='${{ variables.MSBuildArguments_cg_android }}'
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy $(renderers)'
|
||||
|
|
|
@ -49,14 +49,6 @@ steps:
|
|||
feedsToUse: config
|
||||
nugetConfigPath: 'DevopsNuget.config'
|
||||
|
||||
- task: Bash@3
|
||||
displayName: 'Build solution Xamarin.Forms.Build.Tasks/Xamarin.Forms.Build.Tasks.csproj'
|
||||
condition: or(eq(variables['provisioningCake'], 'true'), eq(variables['buildForVS2017'], 'true'))
|
||||
inputs:
|
||||
targetType: 'filePath'
|
||||
filePath: 'build.sh'
|
||||
arguments: --target BuildTasks
|
||||
|
||||
- task: InstallAppleCertificate@2
|
||||
displayName: 'Install an Apple certificate'
|
||||
inputs:
|
||||
|
@ -68,13 +60,26 @@ steps:
|
|||
inputs:
|
||||
provProfileSecureFile: 'Xamarin Forms iOS Provisioning.mobileprovision'
|
||||
|
||||
- task: XamariniOS@2
|
||||
displayName: 'Build Xamarin.iOS solution $(slnPath)'
|
||||
- task: Bash@3
|
||||
displayName: 'Build Control Gallery IPA'
|
||||
inputs:
|
||||
solutionFile: $(slnPath)
|
||||
configuration: $(buildConfiguration)
|
||||
args: /bl:$(Build.ArtifactStagingDirectory)/ios-2017_$(buildForVS2017).binlog
|
||||
targetType: 'filePath'
|
||||
filePath: 'build.sh'
|
||||
arguments: --target cg-ios --buildForVS2017=$(buildForVS2017) --BUILD_CONFIGURATION=$(buildConfiguration) --MSBuildArguments='${{ variables.MSBuildArguments_cg_ios }}'
|
||||
|
||||
- task: MSBuild@1
|
||||
displayName: 'Build iOS Tests'
|
||||
inputs:
|
||||
solution: 'Xamarin.Forms.Core.iOS.UITests/Xamarin.Forms.Core.iOS.UITests.csproj'
|
||||
configuration: $(buildConfiguration)
|
||||
msbuildArguments: /bl:$(Build.ArtifactStagingDirectory)/ios-uitests-2017_$(buildForVS2017).binlog
|
||||
|
||||
- task: MSBuild@1
|
||||
displayName: 'Build Android Tests'
|
||||
inputs:
|
||||
solution: 'Xamarin.Forms.Core.Android.UITests/Xamarin.Forms.Core.Android.UITests.csproj'
|
||||
configuration: $(buildConfiguration)
|
||||
msbuildArguments: /bl:$(Build.ArtifactStagingDirectory)/android-uitests-2017_$(buildForVS2017).binlog
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy test-cloud.exe'
|
||||
|
@ -86,13 +91,13 @@ steps:
|
|||
OverWrite: true
|
||||
flattenFolders: true
|
||||
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy iOS Files for UITest'
|
||||
condition: eq(variables['buildForVS2017'], 'false')
|
||||
inputs:
|
||||
Contents: |
|
||||
**/$(IpaName)
|
||||
**/XamarinFormsControlGalleryiOS.ipa
|
||||
**/*.dSYM
|
||||
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.*
|
||||
|
|
|
@ -48,7 +48,7 @@ steps:
|
|||
feedsToUse: config
|
||||
nugetConfigPath: 'DevopsNuget.config'
|
||||
|
||||
- script: build.cmd -Target BuildForNuget -ScriptArgs '-configuration="$(BuildConfiguration)"','-Build_ArtifactStagingDirectory="$(Build.ArtifactStagingDirectory)"'
|
||||
- script: build.cmd -Target BuildForNuget -ScriptArgs '-BUILD_CONFIGURATION="$(BuildConfiguration)"','-Build_ArtifactStagingDirectory="$(Build.ArtifactStagingDirectory)"'
|
||||
name: winbuild
|
||||
displayName: 'Build Projects For Nuget'
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче