Ios 2017 compatible Xamarin.Forms.Platform.iOS (#9760)
* if def out xcode10 * - setup ios targets * - fix ios 13 inclusion * - fix cake * - fix ArtifactStagingDirectory * - remove restore * - name the task * - fix cast * - fix cast * - fix cast * - fix cast * Update Xamarin.Forms.Platform.iOS/Xamarin.Forms.Platform.iOS.csproj * - add 2017 lane for osx validation * - fix cake * - 2017 netstandard * - remove build tasks for 2017 compatibility build * - more conditions * - apply swapping to mac target * - macos nuspec * - provisioning * - add macos 2017 build * - add cert back in * - type redirector * - fix platform dll nuspec location
This commit is contained in:
Родитель
f92dc78131
Коммит
1cb0656489
|
@ -58,7 +58,6 @@
|
|||
<reference file="Xamarin.Forms.Core.dll" />
|
||||
<reference file="Xamarin.Forms.Platform.dll" />
|
||||
<reference file="Xamarin.Forms.Xaml.dll" />
|
||||
<reference file="Xamarin.Forms.Platform.iOS.dll" />
|
||||
</group>
|
||||
<group targetFramework="MonoAndroid10.0">
|
||||
<reference file="Xamarin.Forms.Core.dll" />
|
||||
|
@ -88,7 +87,6 @@
|
|||
</group>
|
||||
<group targetFramework="Xamarin.Mac">
|
||||
<reference file="Xamarin.Forms.Core.dll" />
|
||||
<reference file="Xamarin.Forms.Platform.macOS.dll" />
|
||||
<reference file="Xamarin.Forms.Platform.dll" />
|
||||
<reference file="Xamarin.Forms.Xaml.dll" />
|
||||
</group>
|
||||
|
@ -207,9 +205,13 @@
|
|||
<file src="..\Stubs\Xamarin.Forms.Platform.Android\bin\$Configuration$\MonoAndroid10.0\Xamarin.Forms.Platform.dll" target="lib\MonoAndroid10.0" />
|
||||
|
||||
<!--iPhone Unified-->
|
||||
<file src="..\Xamarin.Forms.Platform.iOS\bin\$Configuration$\Xamarin.Forms.Platform.iOS.dll" target="lib\Xamarin.iOS10" />
|
||||
<file src="..\Xamarin.Forms.Platform.iOS\bin\$Configuration$\Xamarin.Forms.Platform.iOS.*pdb" target="lib\Xamarin.iOS10" />
|
||||
<file src="..\Xamarin.Forms.Platform.iOS\bin\$Configuration$\Xamarin.Forms.Platform.iOS.*mdb" target="lib\Xamarin.iOS10" />
|
||||
<file src="..\Xamarin.Forms.Platform.iOS\bin\$Configuration$\Xamarin.Forms.Platform.iOS.dll" target="build\XCODE11" />
|
||||
<file src="..\Xamarin.Forms.Platform.iOS\bin\$Configuration$\Xamarin.Forms.Platform.iOS.*pdb" target="build\XCODE11" />
|
||||
<file src="..\Xamarin.Forms.Platform.iOS\bin\$Configuration$\Xamarin.Forms.Platform.iOS.*mdb" target="build\XCODE11" />
|
||||
<file src="..\Xamarin.Forms.Platform.iOS\bin\$Configuration$\2017\Xamarin.Forms.Platform.iOS.dll" target="build\XCODE10" />
|
||||
<file src="..\Xamarin.Forms.Platform.iOS\bin\$Configuration$\2017\Xamarin.Forms.Platform.iOS.*pdb" target="build\XCODE10" />
|
||||
<file src="..\Xamarin.Forms.Platform.iOS\bin\$Configuration$\2017\Xamarin.Forms.Platform.iOS.*mdb" target="build\XCODE10" />
|
||||
|
||||
<file src="..\Xamarin.Forms.Core\bin\$Configuration$\netstandard2.0\Xamarin.Forms.Core.dll" target="lib\Xamarin.iOS10" />
|
||||
<file src="..\Xamarin.Forms.Core\bin\$Configuration$\netstandard2.0\Xamarin.Forms.Core.*pdb" target="lib\Xamarin.iOS10" />
|
||||
<file src="..\Xamarin.Forms.Core\bin\$Configuration$\netstandard2.0\Xamarin.Forms.Core.*mdb" target="lib\Xamarin.iOS10" />
|
||||
|
@ -296,8 +298,9 @@
|
|||
<!--Mac-->
|
||||
<file src="..\Xamarin.Forms.Core\bin\$Configuration$\netstandard2.0\Xamarin.Forms.Core.dll" target="lib\Xamarin.Mac" />
|
||||
<file src="..\Xamarin.Forms.Xaml\bin\$Configuration$\netstandard2.0\Xamarin.Forms.Xaml.dll" target="lib\Xamarin.Mac" />
|
||||
<file src="..\Xamarin.Forms.Platform.MacOS\bin\$Configuration$\Xamarin.Forms.Platform.macOS.dll" target="lib\Xamarin.Mac" />
|
||||
<file src="..\Xamarin.Forms.Platform.MacOS\bin\$Configuration$\Xamarin.Forms.Platform.dll" target="lib\Xamarin.Mac" />
|
||||
<file src="..\Xamarin.Forms.Platform.MacOS\bin\$Configuration$\Xamarin.Forms.Platform.macOS.dll" target="build\XCODE11" />
|
||||
<file src="..\Xamarin.Forms.Platform.MacOS\bin\$Configuration$\2017\Xamarin.Forms.Platform.macOS.dll" target="build\XCODE10" />
|
||||
|
||||
<!-- iOS Localized String Resource Assemblies -->
|
||||
<file src="..\Xamarin.Forms.Platform.iOS\bin\$Configuration$\ar\Xamarin.Forms.Platform.iOS.resources.dll" target="lib\Xamarin.iOS10\ar" />
|
||||
|
|
|
@ -183,7 +183,41 @@
|
|||
<Error Code="XF005" Condition="$(TargetFrameworkVersionWithoutV) < $(MinTargetFrameworkVersionForForms)"
|
||||
Text="The %24(TargetFrameworkVersion) for $(ProjectName) ($(TargetFrameworkVersion)) is less than the minimum required %24(TargetFrameworkVersion) for Xamarin.Forms ($(MinTargetFrameworkVersionForForms)). You need to increase the %24(TargetFrameworkVersion) for $(ProjectName)." />
|
||||
</Target>
|
||||
|
||||
|
||||
<!-- Xamarin iOS targets -->
|
||||
<PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == 'Xamarin.iOS' OR '$(TargetFrameworkIdentifier)' == 'Xamarin.Mac'">
|
||||
<CoreCompileDependsOn>
|
||||
IncludeCorrectXIOSReference;
|
||||
$(CoreCompileDependsOn);
|
||||
</CoreCompileDependsOn>
|
||||
<PrepareForBuildDependsOn>
|
||||
IncludeCorrectXIOSReference;
|
||||
$(PrepareForBuildDependsOn);
|
||||
</PrepareForBuildDependsOn>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
<Target Name="IncludeCorrectXIOSReference" Condition="'$(TargetFrameworkIdentifier)' == 'Xamarin.iOS' OR '$(TargetFrameworkIdentifier)' == 'Xamarin.Mac'">
|
||||
<PropertyGroup>
|
||||
<Use2017 Condition="'$(Use2017)' == '' AND '$(MSBuildRuntimeType)' == 'Mono'">$(FrameworkSDKRoot.Contains('/Versions/5'))</Use2017>
|
||||
<Use2017 Condition="'$(Use2017)' == '' AND '$(MSBuildAssemblyVersion)' < '16.0'">true</Use2017>
|
||||
<Use2017 Condition="'$(Use2017)' == ''">false</Use2017>
|
||||
<FrameworkDll Condition="'$(TargetFrameworkIdentifier)' == 'Xamarin.iOS'">Xamarin.Forms.Platform.iOS.dll</FrameworkDll>
|
||||
<FrameworkDll Condition="'$(TargetFrameworkIdentifier)' == 'Xamarin.Mac'">Xamarin.Forms.Platform.macOS.dll</FrameworkDll>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition="'$(Use2017)' != 'true'">
|
||||
<Reference Include="Xamarin.Forms.Platform.iOS">
|
||||
<HintPath>$(MSBuildThisFileDirectory)\XCODE11\$(FrameworkDll)</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition="'$(Use2017)' == 'true'">
|
||||
<Reference Include="Xamarin.Forms.Platform.iOS">
|
||||
<HintPath>$(MSBuildThisFileDirectory)\XCODE10\$(FrameworkDll)</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<!-- UWP Targets-->
|
||||
<Target Name="WinUICheckTargetPlatformVersion" BeforeTargets="PrepareForBuild"
|
||||
Condition="'$(TargetPlatformVersion)' != '' and '$(TargetPlatformMinVersion)' != ''">
|
||||
|
|
|
@ -57,6 +57,9 @@
|
|||
<Reference Include="Xamarin.iOS" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
||||
<ItemGroup Condition="'$(Use2017)' == 'true'">
|
||||
<Reference Include="netstandard" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Condition="'$(CI)' == 'true'" Include="Xamarin.Build.TypeRedirector" Version="0.1.2-preview" PrivateAssets="all" />
|
||||
</ItemGroup>
|
||||
|
|
|
@ -65,6 +65,9 @@
|
|||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
||||
<ItemGroup Condition="'$(Use2017)' == 'true'">
|
||||
<Reference Include="netstandard" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Condition="'$(CI)' == 'true'" Include="Xamarin.Build.TypeRedirector" Version="0.1.2-preview" PrivateAssets="all" />
|
||||
</ItemGroup>
|
||||
|
|
|
@ -94,6 +94,9 @@
|
|||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
||||
<ItemGroup Condition="'$(Use2017)' == 'true'">
|
||||
<Reference Include="netstandard" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Condition="'$(CI)' == 'true'" Include="Xamarin.Build.TypeRedirector" Version="0.1.2-preview" PrivateAssets="all" />
|
||||
</ItemGroup>
|
||||
|
|
|
@ -473,10 +473,13 @@ namespace Xamarin.Forms.Platform.MacOS
|
|||
(Source as ListViewDataSource)?.OnRowClicked();
|
||||
}
|
||||
|
||||
#if __XCODE11__
|
||||
public override bool ValidateProposedFirstResponder(NSResponder responder, NSEvent forEvent)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Condition="'$(EnvironmentBuildPropsImported)' != 'True'" Project="..\Environment.Build.props" />
|
||||
<PropertyGroup>
|
||||
<Description>macOS Backend for Xamarin.Forms</Description>
|
||||
<AssemblyName>Xamarin.Forms.Platform.macOS</AssemblyName>
|
||||
|
@ -60,6 +61,13 @@
|
|||
<XamMacArch>
|
||||
</XamMacArch>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Use2017)' == 'true' ">
|
||||
<DefineConstants>__XCODE10__;$(DefineConstants);</DefineConstants>
|
||||
<OutputPath>$(OutputPath)\2017</OutputPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Use2017)' != 'true' ">
|
||||
<DefineConstants>__XCODE11__;$(DefineConstants);</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
|
@ -270,4 +278,7 @@
|
|||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Mac\Xamarin.Mac.CSharp.targets" />
|
||||
<Target Name="_VerifyBuildSignature" />
|
||||
<ItemGroup>
|
||||
<PackageReference Condition="'$(CI)' == 'true'" Include="Xamarin.Build.TypeRedirector" Version="0.1.2-preview" PrivateAssets="all" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -18,9 +18,11 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
{
|
||||
if (Control == null)
|
||||
{
|
||||
#if __XCODE11__
|
||||
if(Forms.IsiOS13OrNewer)
|
||||
SetNativeControl(new UIActivityIndicatorView(RectangleF.Empty) { ActivityIndicatorViewStyle = UIActivityIndicatorViewStyle.Medium });
|
||||
else
|
||||
#endif
|
||||
SetNativeControl(new UIActivityIndicatorView(RectangleF.Empty) { ActivityIndicatorViewStyle = UIActivityIndicatorViewStyle.Gray });
|
||||
}
|
||||
|
||||
|
|
|
@ -619,14 +619,8 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
{
|
||||
var barBackgroundColor = NavPage.BarBackgroundColor;
|
||||
|
||||
if (!Forms.IsiOS13OrNewer)
|
||||
{
|
||||
// Set navigation bar background color
|
||||
NavigationBar.BarTintColor = barBackgroundColor == Color.Default
|
||||
? UINavigationBar.Appearance.BarTintColor
|
||||
: barBackgroundColor.ToUIColor();
|
||||
}
|
||||
else
|
||||
#if __XCODE11__
|
||||
if (Forms.IsiOS13OrNewer)
|
||||
{
|
||||
var navigationBarAppearance = new UINavigationBarAppearance();
|
||||
|
||||
|
@ -642,6 +636,14 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
NavigationBar.StandardAppearance = navigationBarAppearance;
|
||||
NavigationBar.ScrollEdgeAppearance = navigationBarAppearance;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
// Set navigation bar background color
|
||||
NavigationBar.BarTintColor = barBackgroundColor == Color.Default
|
||||
? UINavigationBar.Appearance.BarTintColor
|
||||
: barBackgroundColor.ToUIColor();
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateBarTextColor()
|
||||
|
@ -669,6 +671,7 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
};
|
||||
}
|
||||
|
||||
#if __XCODE11__
|
||||
if (Forms.IsiOS13OrNewer)
|
||||
{
|
||||
NavigationBar.CompactAppearance.TitleTextAttributes = titleTextAttributes;
|
||||
|
@ -681,6 +684,7 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
NavigationBar.ScrollEdgeAppearance.LargeTitleTextAttributes = largeTitleTextAttributes;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
NavigationBar.TitleTextAttributes = titleTextAttributes;
|
||||
|
||||
|
@ -701,14 +705,16 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
|
||||
if (statusBarColorMode == StatusBarTextColorMode.DoNotAdjust || barTextColor.Luminosity <= 0.5)
|
||||
{
|
||||
#if __XCODE11__
|
||||
// Use dark text color for status bar
|
||||
if (Forms.IsiOS13OrNewer)
|
||||
{
|
||||
UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.DarkContent;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.Default;
|
||||
UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.Default;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -137,9 +137,11 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
{
|
||||
UIColor backgroundColor;
|
||||
|
||||
#if __XCODE11__
|
||||
if (Forms.IsiOS13OrNewer)
|
||||
backgroundColor = UIColor.SystemBackgroundColor;
|
||||
else
|
||||
#endif
|
||||
backgroundColor = UIColor.White;
|
||||
|
||||
if (Element.BackgroundColor != Color.Default)
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Condition="'$(EnvironmentBuildPropsImported)' != 'True'" Project="..\Environment.Build.props" />
|
||||
<PropertyGroup>
|
||||
<Description>iOS Backend for Xamarin.Forms</Description>
|
||||
<AssemblyName>Xamarin.Forms.Platform.iOS</AssemblyName>
|
||||
|
@ -17,7 +18,7 @@
|
|||
<DebugSymbols>true</DebugSymbols>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
|
@ -33,6 +34,13 @@
|
|||
<NoWarn>
|
||||
</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Use2017)' == 'true' ">
|
||||
<DefineConstants>$(DefineConstants);__XCODE10__</DefineConstants>
|
||||
<OutputPath>$(OutputPath)\2017</OutputPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Use2017)' != 'true' ">
|
||||
<DefineConstants>$(DefineConstants);__XCODE11__</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
|
@ -299,7 +307,10 @@
|
|||
<Name>Xamarin.Forms.Core</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition="'$(Use2017)' == 'true'">
|
||||
<Reference Include="netstandard" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Condition="'$(CI)' == 'true'" Include="Xamarin.Build.TypeRedirector" Version="0.1.2-preview" PrivateAssets="all" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
|
|
@ -65,9 +65,6 @@ jobs:
|
|||
name: win
|
||||
displayName: Build Windows Phase
|
||||
vmImage: $(win2019VmImage)
|
||||
msbuildExtraArguments: '/nowarn:VSX1000'
|
||||
buildConfiguration: $(DefaultBuildConfiguration)
|
||||
buildPlatform: $(DefaultBuildPlatform)
|
||||
provisionatorPath : 'build/provisioning/provisioning.csx'
|
||||
|
||||
- template: build/steps/build-android.yml
|
||||
|
@ -111,6 +108,12 @@ jobs:
|
|||
- sh
|
||||
- msbuild
|
||||
- Xamarin.iOS
|
||||
strategy:
|
||||
matrix:
|
||||
BuildForVS2017:
|
||||
buildForVS2017: 'true'
|
||||
BuildForVS2019:
|
||||
buildForVS2017: 'false'
|
||||
variables:
|
||||
provisionator.osxPath : 'build/provisioning/provisioning.csx'
|
||||
provisionator.signPath : 'build/provisioning/provisioning_sign.csx'
|
||||
|
@ -118,6 +121,7 @@ jobs:
|
|||
slnPath: $(SolutionFile)
|
||||
iOSCertSecureFileName: 'Xamarin Forms iOS Certificate.p12'
|
||||
iOSProvisioningSecureFileName: 'Xamarin Forms iOS Provisioning.mobileprovision'
|
||||
buildForVS2017: $(buildForVS2017)
|
||||
steps:
|
||||
- template: build/steps/build-osx.yml
|
||||
|
||||
|
|
170
build.cake
170
build.cake
|
@ -22,7 +22,7 @@ PowerShell:
|
|||
#addin "nuget:?package=Cake.Android.Adb&version=3.0.0"
|
||||
#addin "nuget:?package=Cake.Git&version=0.19.0"
|
||||
#addin "nuget:?package=Cake.Android.SdkManager&version=3.0.2"
|
||||
#addin "nuget:?package=Cake.Boots&version=1.0.0.291"
|
||||
#addin "nuget:?package=Cake.Boots&version=1.0.2.421"
|
||||
|
||||
#addin "nuget:?package=Cake.FileHelpers&version=3.2.0"
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
@ -37,38 +37,64 @@ PowerShell:
|
|||
var target = Argument("target", "Default");
|
||||
var configuration = Argument("configuration", "Debug");
|
||||
var packageVersion = Argument("packageVersion", "");
|
||||
var releaseChannelArg = Argument("releaseChannel", "Stable");
|
||||
releaseChannelArg = EnvironmentVariable("releaseChannel") ?? releaseChannelArg;
|
||||
var teamProject = Argument("TeamProject", "");
|
||||
bool buildForVS2017 = Convert.ToBoolean(Argument("buildForVS2017", "false"));
|
||||
|
||||
string artifactStagingDirectory = Argument("Build_ArtifactStagingDirectory", (string)null) ?? EnvironmentVariable("Build.ArtifactStagingDirectory") ?? EnvironmentVariable("Build_ArtifactStagingDirectory") ?? ".";
|
||||
var ANDROID_HOME = EnvironmentVariable ("ANDROID_HOME") ??
|
||||
(IsRunningOnWindows () ? "C:\\Program Files (x86)\\Android\\android-sdk\\" : "");
|
||||
|
||||
string monoMajorVersion = "5.18.1";
|
||||
string monoPatchVersion = "28";
|
||||
string monoVersion = $"{monoMajorVersion}.{monoPatchVersion}";
|
||||
string[] androidSdkManagerInstalls = new string[0];//new [] { "platforms;android-24", "platforms;android-28"};
|
||||
|
||||
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 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 = "";
|
||||
|
||||
monoMajorVersion = "6.6.0";
|
||||
monoPatchVersion = "";
|
||||
Information ("Team Project: {0}", teamProject);
|
||||
Information ("buildForVS2017: {0}", buildForVS2017);
|
||||
|
||||
var releaseChannel = ReleaseChannel.Stable;
|
||||
if(releaseChannelArg == "Preview")
|
||||
{
|
||||
releaseChannel = ReleaseChannel.Preview;
|
||||
}
|
||||
|
||||
Information ("Release Channel: {0}", releaseChannel);
|
||||
|
||||
string androidSDK_macos = "";
|
||||
string monoSDK_macos = "";
|
||||
string iOSSDK_macos = "";
|
||||
string macSDK_macos = "";
|
||||
string monoPatchVersion = "";
|
||||
string monoMajorVersion = "";
|
||||
string monoVersion = "";
|
||||
|
||||
if(buildForVS2017)
|
||||
{
|
||||
// VS2017
|
||||
monoMajorVersion = "5.18.1";
|
||||
monoPatchVersion = "";
|
||||
androidSDK_macos = "https://aka.ms/xamarin-android-commercial-d15-9-macos";
|
||||
iOSSDK_macos = $"https://bosstoragemirror.blob.core.windows.net/wrench/jenkins/xcode10.2/9c8d8e0a50e68d9abc8cd48fcd47a669e981fcc9/53/package/xamarin.ios-12.4.0.64.pkg";
|
||||
macSDK_macos = $"https://bosstoragemirror.blob.core.windows.net/wrench/jenkins/xcode10.2/9c8d8e0a50e68d9abc8cd48fcd47a669e981fcc9/53/package/xamarin.mac-5.4.0.64.pkg";
|
||||
|
||||
}
|
||||
|
||||
if(String.IsNullOrWhiteSpace(monoPatchVersion))
|
||||
monoVersion = $"{monoMajorVersion}";
|
||||
else
|
||||
monoVersion = $"{monoMajorVersion}.{monoPatchVersion}";
|
||||
|
||||
if(!String.IsNullOrWhiteSpace(monoVersion))
|
||||
{
|
||||
monoSDK_macos = $"https://download.mono-project.com/archive/{monoMajorVersion}/macos-10-universal/MonoFramework-MDK-{monoVersion}.macos10.xamarin.universal.pkg";
|
||||
}
|
||||
|
||||
string androidSDK_macos = "https://aka.ms/xamarin-android-commercial-d16-4-macos";
|
||||
string monoSDK_macos = $"https://download.mono-project.com/archive/{monoMajorVersion}/macos-10-universal/MonoFramework-MDK-{monoVersion}.macos10.xamarin.universal.pkg";
|
||||
string iOSSDK_macos = $"https://bosstoragemirror.blob.core.windows.net/wrench/jenkins/xcode11.3/5f802ef535488d12886f264b598b9c59ca2f2404/36/package/notarized/xamarin.ios-13.10.0.17.pkg";
|
||||
string macSDK_macos = $"https://bosstoragemirror.blob.core.windows.net/wrench/jenkins/xcode11.3/5f802ef535488d12886f264b598b9c59ca2f2404/36/package/notarized/xamarin.mac-6.10.0.17.pkg";
|
||||
|
||||
string androidSDK = IsRunningOnWindows() ? androidSDK_windows : androidSDK_macos;
|
||||
string monoSDK = IsRunningOnWindows() ? monoSDK_windows : monoSDK_macos;
|
||||
string iosSDK = IsRunningOnWindows() ? iOSSDK_windows : iOSSDK_macos;
|
||||
string androidSDK = IsRunningOnWindows() ? "" : androidSDK_macos;
|
||||
string monoSDK = IsRunningOnWindows() ? "" : monoSDK_macos;
|
||||
string iosSDK = IsRunningOnWindows() ? "" : iOSSDK_macos;
|
||||
string macSDK = IsRunningOnWindows() ? "" : macSDK_macos;
|
||||
|
||||
string[] androidSdkManagerInstalls = new string[0];//new [] { "platforms;android-24", "platforms;android-28"};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// TASKS
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
@ -85,9 +111,12 @@ Task("provision-macsdk")
|
|||
.Description("Install Xamarin.Mac SDK")
|
||||
.Does(async () =>
|
||||
{
|
||||
if(!IsRunningOnWindows() && !String.IsNullOrWhiteSpace(macSDK))
|
||||
if(!IsRunningOnWindows())
|
||||
{
|
||||
await Boots(macSDK);
|
||||
if(!String.IsNullOrWhiteSpace(macSDK))
|
||||
await Boots(macSDK);
|
||||
else
|
||||
await Boots (Product.XamarinMac, releaseChannel);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -95,8 +124,12 @@ Task("provision-iossdk")
|
|||
.Description("Install Xamarin.iOS SDK")
|
||||
.Does(async () =>
|
||||
{
|
||||
if(!String.IsNullOrWhiteSpace(iosSDK))
|
||||
await Boots(iosSDK);
|
||||
if (!IsRunningOnWindows ()) {
|
||||
if(!String.IsNullOrWhiteSpace(iosSDK))
|
||||
await Boots(iosSDK);
|
||||
else
|
||||
await Boots (Product.XamariniOS, releaseChannel);
|
||||
}
|
||||
});
|
||||
|
||||
Task("provision-androidsdk")
|
||||
|
@ -112,49 +145,30 @@ Task("provision-androidsdk")
|
|||
SkipVersionCheck = true
|
||||
};
|
||||
|
||||
|
||||
AcceptLicenses (androidSdkSettings);
|
||||
|
||||
AndroidSdkManagerUpdateAll (androidSdkSettings);
|
||||
|
||||
AcceptLicenses (androidSdkSettings);
|
||||
|
||||
AndroidSdkManagerInstall (androidSdkManagerInstalls, androidSdkSettings);
|
||||
}
|
||||
if(!String.IsNullOrWhiteSpace(androidSDK))
|
||||
await Boots (androidSDK);
|
||||
|
||||
if (!IsRunningOnWindows ()) {
|
||||
if(!String.IsNullOrWhiteSpace(androidSDK))
|
||||
await Boots (androidSDK);
|
||||
else
|
||||
await Boots (Product.XamarinAndroid, releaseChannel);
|
||||
}
|
||||
});
|
||||
|
||||
Task("provision-monosdk")
|
||||
.Description("Install Mono SDK")
|
||||
.Does(async () =>
|
||||
{
|
||||
if(IsRunningOnWindows())
|
||||
{
|
||||
if(!String.IsNullOrWhiteSpace(monoSDK))
|
||||
{
|
||||
string monoPath = $"{System.IO.Path.GetTempPath()}mono.msi";
|
||||
|
||||
if(!String.IsNullOrWhiteSpace(EnvironmentVariable("Build.Repository.LocalPath")))
|
||||
monoPath = EnvironmentVariable("Build.Repository.LocalPath") + "\\" + "mono.msi";
|
||||
|
||||
Information("Mono Path: {0}", monoPath);
|
||||
Information("Mono Version: {0}", monoSDK);
|
||||
DownloadFile(monoSDK, monoPath);
|
||||
|
||||
StartProcess("msiexec", new ProcessSettings {
|
||||
Arguments = new ProcessArgumentBuilder()
|
||||
.Append(@"/i")
|
||||
.Append(monoPath)
|
||||
.Append("/qn")
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
if(!IsRunningOnWindows())
|
||||
{
|
||||
if(!String.IsNullOrWhiteSpace(monoSDK))
|
||||
await Boots(monoSDK);
|
||||
else
|
||||
await Boots (Product.Mono, releaseChannel);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -167,7 +181,8 @@ Task("provision")
|
|||
|
||||
Task("NuGetPack")
|
||||
.Description("Build and Create Nugets")
|
||||
.IsDependentOn("Build")
|
||||
.IsDependentOn("Restore")
|
||||
.IsDependentOn("BuildForNuget")
|
||||
.IsDependentOn("_NuGetPack");
|
||||
|
||||
|
||||
|
@ -220,18 +235,55 @@ Task("Restore")
|
|||
}
|
||||
});
|
||||
|
||||
Task("Build")
|
||||
Task("BuildForNuget")
|
||||
.Description("Builds all necessary projects to create Nuget Packages")
|
||||
.Does(() =>
|
||||
{
|
||||
try{
|
||||
|
||||
var msbuildSettings = GetMSBuildSettings();
|
||||
var binaryLogger = new MSBuildBinaryLogSettings {
|
||||
Enabled = true
|
||||
};
|
||||
|
||||
msbuildSettings.BinaryLogger = binaryLogger;
|
||||
msbuildSettings.ArgumentCustomization = args => args.Append("/nowarn:VSX1000");
|
||||
binaryLogger.FileName = $"{artifactStagingDirectory}/win-{configuration}.binlog";
|
||||
|
||||
MSBuild("./Xamarin.Forms.sln", msbuildSettings);
|
||||
|
||||
binaryLogger.FileName = $"{artifactStagingDirectory}/win-{configuration}-csproj.binlog";
|
||||
MSBuild("./Xamarin.Forms.Platform.UAP/Xamarin.Forms.Platform.UAP.csproj",
|
||||
msbuildSettings
|
||||
.WithTarget("rebuild")
|
||||
.WithProperty("DisableEmbeddedXbf", "false"));
|
||||
|
||||
binaryLogger.FileName = $"{artifactStagingDirectory}/ios-{configuration}-csproj.binlog";
|
||||
MSBuild("./Xamarin.Forms.Platform.iOS/Xamarin.Forms.Platform.iOS.csproj",
|
||||
msbuildSettings
|
||||
.WithTarget("rebuild")
|
||||
.WithProperty("USE2017", "true"));
|
||||
|
||||
binaryLogger.FileName = $"{artifactStagingDirectory}/macos-{configuration}-csproj.binlog";
|
||||
MSBuild("./Xamarin.Forms.Platform.MacOS/Xamarin.Forms.Platform.MacOS.csproj",
|
||||
msbuildSettings
|
||||
.WithTarget("rebuild")
|
||||
.WithProperty("USE2017", "true"));
|
||||
}
|
||||
catch(Exception)
|
||||
{
|
||||
if(IsRunningOnWindows())
|
||||
throw;
|
||||
}
|
||||
});
|
||||
|
||||
Task("Build")
|
||||
.Description("Builds all necessary projects to run Control Gallery")
|
||||
.IsDependentOn("Restore")
|
||||
.Does(() =>
|
||||
{
|
||||
try{
|
||||
MSBuild("./Xamarin.Forms.sln", GetMSBuildSettings().WithRestore());
|
||||
|
||||
MSBuild("./Xamarin.Forms.Platform.UAP/Xamarin.Forms.Platform.UAP.csproj",
|
||||
GetMSBuildSettings()
|
||||
.WithRestore()
|
||||
.WithProperty("DisableEmbeddedXbf", "false"));
|
||||
}
|
||||
catch(Exception)
|
||||
{
|
||||
|
|
|
@ -15,7 +15,7 @@ steps:
|
|||
inputs:
|
||||
targetType: 'filePath'
|
||||
filePath: 'build.sh'
|
||||
arguments: --target provision
|
||||
arguments: --target provision --buildForVS2017=$(buildForVS2017)
|
||||
|
||||
- task: UseDotNet@2
|
||||
displayName: 'Install .net core $(DOTNET_VERSION)'
|
||||
|
@ -56,11 +56,12 @@ steps:
|
|||
inputs:
|
||||
solutionFile: $(slnPath)
|
||||
configuration: $(buildConfiguration)
|
||||
args: /bl:$(Build.ArtifactStagingDirectory)/ios.binlog
|
||||
args: /bl:$(Build.ArtifactStagingDirectory)/ios-2017_$(buildForVS2017).binlog
|
||||
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy test-cloud.exe'
|
||||
condition: eq(variables['buildForVS2017'], 'false')
|
||||
inputs:
|
||||
Contents: '**/Xamarin.UITest.*/tools/test-cloud.exe'
|
||||
TargetFolder: '$(build.artifactstagingdirectory)/testcloud'
|
||||
|
@ -71,6 +72,7 @@ steps:
|
|||
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy iOS Files for UITest'
|
||||
condition: eq(variables['buildForVS2017'], 'false')
|
||||
inputs:
|
||||
Contents: |
|
||||
**/$(IpaName)
|
||||
|
@ -87,6 +89,7 @@ steps:
|
|||
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy Android Files for UITest'
|
||||
condition: eq(variables['buildForVS2017'], 'false')
|
||||
inputs:
|
||||
Contents: |
|
||||
Xamarin.Forms.Core.Android.UITests/bin/$(BuildConfiguration)/Newtonsoft.Json.*
|
||||
|
|
|
@ -9,9 +9,6 @@ parameters:
|
|||
postBuildSteps: [] # any additional steps to run after the build
|
||||
slnPath : 'Xamarin.Forms.sln'
|
||||
csprojPath : 'Xamarin.Forms.Platform.UAP\Xamarin.Forms.Platform.UAP.csproj'
|
||||
buildConfiguration : 'Debug'
|
||||
releaseBuildConfiguration : 'Release'
|
||||
buildPlatform : 'any cpu'
|
||||
msbuildExtraArguments : ''
|
||||
artifactsTargetFolder: '$(build.artifactstagingdirectory)'
|
||||
artifactsName: 'win_build'
|
||||
|
@ -33,15 +30,13 @@ jobs:
|
|||
strategy:
|
||||
matrix:
|
||||
debug:
|
||||
BuildConfiguration: ${{ parameters.buildConfiguration }}
|
||||
BuildPlatform: ${{ parameters.buildPlatform }}
|
||||
BuildConfiguration: 'Debug'
|
||||
release:
|
||||
BuildConfiguration: ${{ parameters.releaseBuildConfiguration }}
|
||||
BuildPlatform: ${{ parameters.buildPlatform }}
|
||||
BuildConfiguration: 'Release'
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
- script: build.cmd -Target provision --verbosity=diagnostic
|
||||
- script: build.cmd -Target provision
|
||||
displayName: 'Cake Provision'
|
||||
condition: eq(variables['provisioningCake'], 'true')
|
||||
|
||||
|
@ -70,23 +65,9 @@ jobs:
|
|||
inputs:
|
||||
restoreSolution: ${{ parameters.slnPath }}
|
||||
|
||||
- task: MSBuild@1
|
||||
displayName: 'Build solution ${{ parameters.slnPath }}'
|
||||
- script: build.cmd -Target BuildForNuget -ScriptArgs '-configuration="$(BuildConfiguration)"','-Build_ArtifactStagingDirectory="$(Build.ArtifactStagingDirectory)"'
|
||||
name: winbuild
|
||||
inputs:
|
||||
solution: ${{ parameters.slnPath }}
|
||||
platform: '$(BuildPlatform)'
|
||||
configuration: '$(BuildConfiguration)'
|
||||
msbuildArguments: ${{ parameters.msbuildExtraArguments }} /bl:$(Build.ArtifactStagingDirectory)\win-$(BuildConfiguration).binlog
|
||||
|
||||
- task: MSBuild@1
|
||||
displayName: 'Embed XBF into PRI'
|
||||
condition: eq(${{ parameters.includeUwp }}, 'true')
|
||||
name: winbuild_pri_embed
|
||||
inputs:
|
||||
solution: ${{ parameters.csprojPath }}
|
||||
configuration: '$(BuildConfiguration)'
|
||||
msbuildArguments: ${{ parameters.msbuildExtraArguments }} /t:rebuild /p:DisableEmbeddedXbf=false /bl:$(Build.ArtifactStagingDirectory)\win-$(BuildConfiguration)-csproj.binlog
|
||||
displayName: 'Build Projects For Nuget'
|
||||
|
||||
- task: VSTest@2
|
||||
displayName: 'Unit Tests'
|
||||
|
|
Загрузка…
Ссылка в новой задаче