зеркало из https://github.com/DeGsoft/maui-linux.git
Merge branch '4.2.0' into 4.3.0
This commit is contained in:
Коммит
a3706fe1ce
|
@ -382,6 +382,8 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidEnvironment Include="Environment.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProguardConfiguration Include="..\.nuspec\proguard.cfg">
|
||||
<Link>proguard.cfg</Link>
|
||||
</ProguardConfiguration>
|
||||
|
|
|
@ -0,0 +1,164 @@
|
|||
using System;
|
||||
using Xamarin.Forms.Internals;
|
||||
using Xamarin.Forms.CustomAttributes;
|
||||
#if UITEST
|
||||
using Xamarin.Forms.Core.UITests;
|
||||
using Xamarin.UITest;
|
||||
using NUnit.Framework;
|
||||
#endif
|
||||
|
||||
namespace Xamarin.Forms.Controls.Issues
|
||||
{
|
||||
#if UITEST
|
||||
[Category(UITestCategories.Picker)]
|
||||
[Category(UITestCategories.DatePicker)]
|
||||
[Category(UITestCategories.TimePicker)]
|
||||
#endif
|
||||
[Preserve(AllMembers = true)]
|
||||
[Issue(IssueTracker.Github, 5159, "[Android] Calling Focus on all Pickers running an API 28 devices no longer opens Picker", PlatformAffected.Android)]
|
||||
public class Issue5159 : TestContentPage
|
||||
{
|
||||
const string DatePickerButton = "DatePickerButton";
|
||||
const string TimePickerButton = "TimePickerButton";
|
||||
const string PickerButton = "PickerButton";
|
||||
readonly string[] _pickerValues = { "Foo", "Bar", "42", "1337" };
|
||||
|
||||
protected override void Init()
|
||||
{
|
||||
var stackLayout = new StackLayout
|
||||
{
|
||||
VerticalOptions = LayoutOptions.Center,
|
||||
HorizontalOptions = LayoutOptions.Center
|
||||
};
|
||||
|
||||
// DatePicker
|
||||
var datePickerButton = new Button
|
||||
{
|
||||
Text = "Show DatePicker",
|
||||
AutomationId = DatePickerButton
|
||||
};
|
||||
|
||||
var datePicker = new DatePicker
|
||||
{
|
||||
IsVisible = false
|
||||
};
|
||||
|
||||
datePickerButton.Clicked += (s, a) =>
|
||||
{
|
||||
Device.BeginInvokeOnMainThread(() =>
|
||||
{
|
||||
if (datePicker.IsFocused)
|
||||
datePicker.Unfocus();
|
||||
|
||||
datePicker.Focus();
|
||||
});
|
||||
};
|
||||
|
||||
// TimePicker
|
||||
var timePickerButton = new Button
|
||||
{
|
||||
Text = "Show TimePicker",
|
||||
AutomationId = TimePickerButton
|
||||
};
|
||||
|
||||
var timePicker = new TimePicker
|
||||
{
|
||||
IsVisible = false
|
||||
};
|
||||
|
||||
timePickerButton.Clicked += (s, a) =>
|
||||
{
|
||||
Device.BeginInvokeOnMainThread(() =>
|
||||
{
|
||||
if (timePicker.IsFocused)
|
||||
timePicker.Unfocus();
|
||||
|
||||
timePicker.Focus();
|
||||
});
|
||||
};
|
||||
|
||||
// Picker
|
||||
var pickerButton = new Button
|
||||
{
|
||||
Text = "Show Picker",
|
||||
AutomationId = PickerButton
|
||||
};
|
||||
|
||||
var picker = new Picker
|
||||
{
|
||||
IsVisible = false,
|
||||
ItemsSource = _pickerValues
|
||||
};
|
||||
|
||||
pickerButton.Clicked += (s, a) =>
|
||||
{
|
||||
Device.BeginInvokeOnMainThread(() =>
|
||||
{
|
||||
if (picker.IsFocused)
|
||||
picker.Unfocus();
|
||||
|
||||
picker.Focus();
|
||||
});
|
||||
};
|
||||
|
||||
stackLayout.Children.Add(datePickerButton);
|
||||
stackLayout.Children.Add(datePicker);
|
||||
|
||||
stackLayout.Children.Add(timePickerButton);
|
||||
stackLayout.Children.Add(timePicker);
|
||||
|
||||
stackLayout.Children.Add(pickerButton);
|
||||
stackLayout.Children.Add(picker);
|
||||
|
||||
Content = stackLayout;
|
||||
}
|
||||
|
||||
#if UITEST && __ANDROID__
|
||||
[Test]
|
||||
[UiTest(typeof(DatePicker))]
|
||||
public void InvisibleDatepickerShowsDialogOnFocus()
|
||||
{
|
||||
RunningApp.WaitForElement(DatePickerButton);
|
||||
RunningApp.Screenshot("Issue 5159 page is showing in all it's glory");
|
||||
RunningApp.Tap(DatePickerButton);
|
||||
|
||||
RunningApp.WaitForElement(x => x.Class("DatePicker"));
|
||||
|
||||
RunningApp.Screenshot("DatePicker is shown");
|
||||
RunningApp.TapCoordinates(5, 100);
|
||||
}
|
||||
|
||||
[Test]
|
||||
[UiTest(typeof(TimePicker))]
|
||||
public void InvisibleTimepickerShowsDialogOnFocus()
|
||||
{
|
||||
RunningApp.WaitForElement(TimePickerButton);
|
||||
RunningApp.Screenshot("Issue 5159 page is showing in all it's glory");
|
||||
RunningApp.Tap(TimePickerButton);
|
||||
|
||||
RunningApp.WaitForElement(x => x.Class("timePicker"));
|
||||
|
||||
RunningApp.Screenshot("TimePicker is shown");
|
||||
RunningApp.TapCoordinates(5, 100);
|
||||
}
|
||||
|
||||
[Test]
|
||||
[UiTest(typeof(Picker))]
|
||||
public void InvisiblePickerShowsDialogOnFocus()
|
||||
{
|
||||
RunningApp.WaitForElement(PickerButton);
|
||||
RunningApp.Screenshot("Issue 5159 page is showing in all it's glory");
|
||||
RunningApp.Tap(PickerButton);
|
||||
|
||||
RunningApp.WaitForElement("Foo");
|
||||
|
||||
RunningApp.Screenshot("Picker is shown");
|
||||
|
||||
RunningApp.Tap("Foo");
|
||||
|
||||
RunningApp.WaitForNoElement("Foo");
|
||||
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
using System;
|
||||
using Xamarin.Forms.CustomAttributes;
|
||||
using Xamarin.Forms.Internals;
|
||||
|
||||
#if UITEST
|
||||
using Xamarin.UITest;
|
||||
using NUnit.Framework;
|
||||
using Xamarin.UITest.iOS;
|
||||
#endif
|
||||
|
||||
namespace Xamarin.Forms.Controls.Issues
|
||||
{
|
||||
[Preserve(AllMembers = true)]
|
||||
[Issue(IssueTracker.Github, 7311, "[Bug] [Android] Error back hardware button with Picker", PlatformAffected.Android)]
|
||||
public class Issue7311 : TestContentPage
|
||||
{
|
||||
const string FirstPickerItem = "Uno";
|
||||
const string PickerId = "CaptainPickard";
|
||||
readonly string[] _items = { FirstPickerItem, "Dos", "Tres" };
|
||||
|
||||
protected override void Init()
|
||||
{
|
||||
var picker = new Picker
|
||||
{
|
||||
ItemsSource = _items,
|
||||
AutomationId = PickerId
|
||||
};
|
||||
|
||||
Content = new StackLayout()
|
||||
{
|
||||
Children =
|
||||
{
|
||||
new Label()
|
||||
{
|
||||
Text = "Open Picker. Click hardware back button to close picker. Click hardware button a second time and it should navigate back to gallery"
|
||||
},
|
||||
picker
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#if UITEST && __ANDROID__
|
||||
[Test]
|
||||
public void OpeningPickerPressingBackButtonTwiceShouldNotOpenPickerAgain()
|
||||
{
|
||||
RunningApp.WaitForElement(PickerId);
|
||||
RunningApp.Tap(PickerId);
|
||||
|
||||
RunningApp.WaitForElement(FirstPickerItem);
|
||||
|
||||
RunningApp.Back();
|
||||
|
||||
RunningApp.WaitForNoElement(FirstPickerItem);
|
||||
|
||||
RunningApp.Back();
|
||||
|
||||
RunningApp.WaitForNoElement(FirstPickerItem, "Picker is again visible after second back button press", TimeSpan.FromSeconds(10));
|
||||
|
||||
RunningApp.Screenshot("Back at the previous page, not showing the picker again");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
|
@ -1054,6 +1054,8 @@
|
|||
<Compile Include="$(MSBuildThisFileDirectory)Issue5503.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)LabelTextType.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)ShellTitleView.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Issue5159.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Issue7311.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Issue7053.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Issue6894.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Issue6929.cs" />
|
||||
|
|
|
@ -274,9 +274,11 @@ namespace Xamarin.Forms.Platform.Android
|
|||
|
||||
PopupManager.Unsubscribe(this);
|
||||
|
||||
_layout.RemoveView(Platform);
|
||||
|
||||
Platform?.Dispose();
|
||||
if (Platform != null)
|
||||
{
|
||||
_layout.RemoveView(Platform);
|
||||
Platform.Dispose();
|
||||
}
|
||||
|
||||
PreviousActivityDestroying.Set();
|
||||
|
||||
|
|
|
@ -93,7 +93,12 @@ namespace Xamarin.Forms.Platform.Android.AppCompat
|
|||
base.OnFocusChangeRequested(sender, e);
|
||||
|
||||
if (e.Focus)
|
||||
CallOnClick();
|
||||
{
|
||||
if (Clickable)
|
||||
CallOnClick();
|
||||
else
|
||||
((IPickerRenderer)this)?.OnClick();
|
||||
}
|
||||
else if (_dialog != null)
|
||||
{
|
||||
_dialog.Hide();
|
||||
|
|
|
@ -10,8 +10,8 @@ namespace Xamarin.Forms.Platform.Android
|
|||
{
|
||||
internal static class PickerManager
|
||||
{
|
||||
readonly static HashSet<Keycode> availableKeys = new HashSet<Keycode>(new[] {
|
||||
Keycode.Tab, Keycode.Forward, Keycode.Back, Keycode.DpadDown, Keycode.DpadLeft, Keycode.DpadRight, Keycode.DpadUp
|
||||
readonly static HashSet<Keycode> AvailableKeys = new HashSet<Keycode>(new[] {
|
||||
Keycode.Tab, Keycode.Forward, Keycode.DpadDown, Keycode.DpadLeft, Keycode.DpadRight, Keycode.DpadUp
|
||||
});
|
||||
|
||||
public static void Init(EditText editText)
|
||||
|
@ -42,7 +42,7 @@ namespace Xamarin.Forms.Platform.Android
|
|||
|
||||
static void OnKeyPress(object sender, AView.KeyEventArgs e)
|
||||
{
|
||||
if (!availableKeys.Contains(e.KeyCode))
|
||||
if (!AvailableKeys.Contains(e.KeyCode))
|
||||
{
|
||||
e.Handled = false;
|
||||
return;
|
||||
|
|
|
@ -97,7 +97,12 @@ namespace Xamarin.Forms.Platform.Android
|
|||
base.OnFocusChangeRequested(sender, e);
|
||||
|
||||
if (e.Focus)
|
||||
CallOnClick();
|
||||
{
|
||||
if (Clickable)
|
||||
CallOnClick();
|
||||
else
|
||||
((IPickerRenderer)this)?.OnClick();
|
||||
}
|
||||
else if (_dialog != null)
|
||||
{
|
||||
_dialog.Hide();
|
||||
|
|
|
@ -107,7 +107,12 @@ namespace Xamarin.Forms.Platform.Android
|
|||
base.OnFocusChangeRequested(sender, e);
|
||||
|
||||
if (e.Focus)
|
||||
CallOnClick();
|
||||
{
|
||||
if (Clickable)
|
||||
CallOnClick();
|
||||
else
|
||||
((IPickerRenderer)this)?.OnClick();
|
||||
}
|
||||
else if (_dialog != null)
|
||||
{
|
||||
_dialog.Hide();
|
||||
|
@ -122,7 +127,7 @@ namespace Xamarin.Forms.Platform.Android
|
|||
|
||||
if (_dialog != null)
|
||||
return;
|
||||
|
||||
|
||||
var picker = new NumberPicker(Context);
|
||||
if (model.Items != null && model.Items.Any())
|
||||
{
|
||||
|
|
|
@ -16,6 +16,7 @@ namespace Xamarin.Forms.Platform.Android
|
|||
{
|
||||
int _originalHintTextColor;
|
||||
AlertDialog _dialog;
|
||||
bool _isDisposed;
|
||||
|
||||
bool Is24HourView
|
||||
{
|
||||
|
@ -89,7 +90,12 @@ namespace Xamarin.Forms.Platform.Android
|
|||
base.OnFocusChangeRequested(sender, e);
|
||||
|
||||
if (e.Focus)
|
||||
CallOnClick();
|
||||
{
|
||||
if (Clickable)
|
||||
CallOnClick();
|
||||
else
|
||||
((IPickerRenderer)this)?.OnClick();
|
||||
}
|
||||
else if (_dialog != null)
|
||||
{
|
||||
_dialog.Hide();
|
||||
|
@ -98,6 +104,7 @@ namespace Xamarin.Forms.Platform.Android
|
|||
if (Forms.IsLollipopOrNewer)
|
||||
_dialog.CancelEvent -= OnCancelButtonClicked;
|
||||
|
||||
_dialog?.Dispose();
|
||||
_dialog = null;
|
||||
}
|
||||
}
|
||||
|
@ -112,6 +119,25 @@ namespace Xamarin.Forms.Platform.Android
|
|||
return dialog;
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (_isDisposed)
|
||||
return;
|
||||
|
||||
_isDisposed = true;
|
||||
|
||||
if (disposing)
|
||||
{
|
||||
if (Forms.IsLollipopOrNewer && _dialog.IsAlive())
|
||||
_dialog.CancelEvent -= OnCancelButtonClicked;
|
||||
|
||||
_dialog?.Dispose();
|
||||
_dialog = null;
|
||||
}
|
||||
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
void IPickerRenderer.OnClick()
|
||||
{
|
||||
if (_dialog != null && _dialog.IsShowing)
|
||||
|
|
|
@ -11,14 +11,12 @@ variables:
|
|||
value: Xamarin.Forms.sln
|
||||
- name: BuildVersion
|
||||
value: $[counter('$(Build.SourceBranchName)_counter', 1)]
|
||||
- name: MONO_VERSION
|
||||
value: 5_18_1
|
||||
- name: XCODE_VERSION
|
||||
value: 10.2
|
||||
- name: NUGET_VERSION
|
||||
value: 5.0.2
|
||||
- name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE
|
||||
value: true
|
||||
- name: winVmImage
|
||||
value: Hosted Windows 2019 with VS2019
|
||||
value: Hosted VS2017
|
||||
|
||||
resources:
|
||||
repositories:
|
||||
|
@ -53,8 +51,8 @@ schedules:
|
|||
displayName: Daily midnight build
|
||||
branches:
|
||||
include:
|
||||
- master
|
||||
|
||||
- master
|
||||
|
||||
jobs:
|
||||
- template: build/steps/build-windows.yml
|
||||
parameters:
|
||||
|
@ -65,6 +63,7 @@ jobs:
|
|||
msbuildExtraArguments: '/nowarn:VSX1000 /p:CreateAllAndroidTargets=true /bl:$(Build.ArtifactStagingDirectory)\win.binlog'
|
||||
buildConfiguration: $(DefaultBuildConfiguration)
|
||||
buildPlatform: $(DefaultBuildPlatform)
|
||||
provisionatorPath : 'build/provisioning/provisioning.csx'
|
||||
|
||||
- template: build/steps/build-android.yml
|
||||
parameters:
|
||||
|
@ -74,7 +73,7 @@ jobs:
|
|||
targetFolder: Xamarin.Forms.ControlGallery.Android/legacyRenderers/
|
||||
androidProjectArguments: '/t:"Rebuild;SignAndroidPackage" /bl:$(Build.ArtifactStagingDirectory)/android-legacy.binlog'
|
||||
buildConfiguration: $(DefaultBuildConfiguration)
|
||||
monoVersion : $(MONO_VERSION)
|
||||
provisionatorPath : 'build/provisioning/provisioning.csx'
|
||||
|
||||
- template: build/steps/build-android.yml
|
||||
parameters:
|
||||
|
@ -84,7 +83,7 @@ jobs:
|
|||
targetFolder: Xamarin.Forms.ControlGallery.Android/preAppCompat
|
||||
androidProjectArguments: '/t:"Rebuild;SignAndroidPackage" /p:DefineConstants="TRACE DEBUG FORMS_APPLICATION_ACTIVITY APP" /bl:$(Build.ArtifactStagingDirectory)/android-preappcompact.binlog'
|
||||
buildConfiguration: $(DefaultBuildConfiguration)
|
||||
monoVersion : $(MONO_VERSION)
|
||||
provisionatorPath : 'build/provisioning/provisioning.csx'
|
||||
|
||||
- template: build/steps/build-android.yml
|
||||
parameters:
|
||||
|
@ -94,7 +93,7 @@ jobs:
|
|||
targetFolder: Xamarin.Forms.ControlGallery.Android/newRenderers/
|
||||
androidProjectArguments: '/t:"Rebuild;SignAndroidPackage" /p:DefineConstants="TRACE DEBUG TEST_EXPERIMENTAL_RENDERERS APP" /bl:$(Build.ArtifactStagingDirectory)/android-newrenderers.binlog'
|
||||
buildConfiguration: $(DefaultBuildConfiguration)
|
||||
monoVersion : $(MONO_VERSION)
|
||||
provisionatorPath : 'build/provisioning/provisioning.csx'
|
||||
|
||||
- job: osx
|
||||
displayName: OSX Phase
|
||||
|
@ -106,12 +105,10 @@ jobs:
|
|||
- msbuild
|
||||
- Xamarin.iOS
|
||||
variables:
|
||||
provisioningOSX : $(provisioning)
|
||||
provisionator.osxPath : 'build/provisioning/provisioning.csx'
|
||||
provisionator.signPath : 'build/provisioning/provisioning_sign.csx'
|
||||
buildConfiguration: $(DefaultBuildConfiguration)
|
||||
slnPath: $(SolutionFile)
|
||||
nugetVersion: $(NUGET_VERSION)
|
||||
iOSCertSecureFileName: 'Xamarin Forms iOS Certificate.p12'
|
||||
iOSProvisioningSecureFileName: 'Xamarin Forms iOS Provisioning.mobileprovision'
|
||||
monoVersion : $(MONO_VERSION)
|
||||
|
@ -128,7 +125,6 @@ jobs:
|
|||
variables:
|
||||
FormsIdAppend: ''
|
||||
buildConfiguration: $(DefaultBuildConfiguration)
|
||||
nugetVersion: $(NUGET_VERSION)
|
||||
nugetPackageVersion : $[ dependencies.win.outputs['debug.winbuild.xamarinformspackageversion'] ]
|
||||
steps:
|
||||
- template: build/steps/build-nuget.yml
|
||||
|
|
99
build.cake
99
build.cake
|
@ -21,6 +21,9 @@ PowerShell:
|
|||
#addin "nuget:?package=Cake.Xamarin&version=3.0.0"
|
||||
#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"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// TOOLS
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
@ -40,6 +43,30 @@ var informationalVersion = gitVersion.InformationalVersion;
|
|||
var buildVersion = gitVersion.FullBuildMetaData;
|
||||
var nugetversion = Argument<string>("packageVersion", gitVersion.NuGetVersion);
|
||||
|
||||
var ANDROID_HOME = EnvironmentVariable ("ANDROID_HOME") ??
|
||||
(IsRunningOnWindows () ? "C:\\Program Files (x86)\\Android\\android-sdk\\" : "");
|
||||
|
||||
string monoMajorVersion = "5.14.0";
|
||||
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 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 = "";
|
||||
|
||||
string androidSDK_macos = "https://aka.ms/xamarin-android-commercial-d15-9-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/xcode10.2/9c8d8e0a50e68d9abc8cd48fcd47a669e981fcc9/53/package/xamarin.ios-12.4.0.64.pkg";
|
||||
string macSDK_macos = $"https://bosstoragemirror.blob.core.windows.net/wrench/jenkins/xcode10.2/9c8d8e0a50e68d9abc8cd48fcd47a669e981fcc9/53/package/xamarin.mac-5.4.0.64.pkg";
|
||||
|
||||
string androidSDK = IsRunningOnWindows() ? androidSDK_windows : androidSDK_macos;
|
||||
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"};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// TASKS
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
@ -49,9 +76,79 @@ Task("Clean")
|
|||
{
|
||||
CleanDirectories("./**/obj", (fsi)=> !fsi.Path.FullPath.Contains("XFCorePostProcessor") && !fsi.Path.FullPath.StartsWith("tools"));
|
||||
CleanDirectories("./**/bin", (fsi)=> !fsi.Path.FullPath.Contains("XFCorePostProcessor") && !fsi.Path.FullPath.StartsWith("tools"));
|
||||
|
||||
});
|
||||
|
||||
Task("provision-macsdk")
|
||||
.Does(async () =>
|
||||
{
|
||||
if(!IsRunningOnWindows() && !String.IsNullOrWhiteSpace(macSDK))
|
||||
{
|
||||
await Boots(macSDK);
|
||||
}
|
||||
});
|
||||
|
||||
Task("provision-iossdk")
|
||||
.Does(async () =>
|
||||
{
|
||||
if(!IsRunningOnWindows())
|
||||
{
|
||||
if(!String.IsNullOrWhiteSpace(iosSDK))
|
||||
await Boots(iosSDK);
|
||||
}
|
||||
});
|
||||
|
||||
Task("provision-androidsdk")
|
||||
.Does(async () =>
|
||||
{
|
||||
Information ("ANDROID_HOME: {0}", ANDROID_HOME);
|
||||
|
||||
if(androidSdkManagerInstalls.Length > 0)
|
||||
{
|
||||
var androidSdkSettings = new AndroidSdkManagerToolSettings {
|
||||
SdkRoot = ANDROID_HOME,
|
||||
SkipVersionCheck = true
|
||||
};
|
||||
|
||||
try { AcceptLicenses (androidSdkSettings); } catch { }
|
||||
|
||||
AndroidSdkManagerInstall (androidSdkManagerInstalls, androidSdkSettings);
|
||||
}
|
||||
if(!String.IsNullOrWhiteSpace(androidSDK))
|
||||
await Boots (androidSDK);
|
||||
});
|
||||
|
||||
Task("provision-monosdk")
|
||||
.Does(async () =>
|
||||
{
|
||||
if(IsRunningOnWindows())
|
||||
{
|
||||
if(!String.IsNullOrWhiteSpace(monoSDK))
|
||||
{
|
||||
string monoPath = $"{System.IO.Path.GetTempPath()}/mono.msi";
|
||||
DownloadFile(monoSDK, monoPath);
|
||||
|
||||
StartProcess("msiexec", new ProcessSettings {
|
||||
Arguments = new ProcessArgumentBuilder()
|
||||
.Append(@"/i")
|
||||
.Append(monoPath)
|
||||
.Append("/qn")
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!String.IsNullOrWhiteSpace(monoSDK))
|
||||
await Boots(monoSDK);
|
||||
}
|
||||
});
|
||||
|
||||
Task("provision")
|
||||
.IsDependentOn("provision-macsdk")
|
||||
.IsDependentOn("provision-iossdk")
|
||||
.IsDependentOn("provision-monosdk")
|
||||
.IsDependentOn("provision-androidsdk");
|
||||
|
||||
Task("NuGetPack")
|
||||
.IsDependentOn("Build")
|
||||
.IsDependentOn("_NuGetPack");
|
||||
|
|
|
@ -1,8 +1,77 @@
|
|||
var channel = Env("CHANNEL") ?? "Stable";
|
||||
|
||||
string monoMajorVersion = "6.4.0";
|
||||
string monoPatchVersion = "198";
|
||||
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://download.visualstudio.microsoft.com/download/pr/1131a8f5-99f5-4326-93b1-f5827b54ecd5/e7bd0f680004131157a22982c389b05f2d3698cc04fab3901ce2d7ded47ad8e0/Xamarin.Android.Sdk-10.0.0.43.vsix";
|
||||
string iOSSDK_windows = "";
|
||||
string macSDK_windows = "";
|
||||
|
||||
string androidSDK_macos = "https://download.visualstudio.microsoft.com/download/pr/d5a432e4-09f3-4da6-9bdd-1d4fdd87f34c/c4ce0854064ffc16b957f22ccc08f9df/xamarin.android-10.0.0.43.pkg";
|
||||
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/d16-3/5e8a208b5f44c4885060d95e3c3ad68d6a5e95e8/40/package/xamarin.ios-13.2.0.42.pkg";
|
||||
string macSDK_macos = $"https://bosstoragemirror.blob.core.windows.net/wrench/jenkins/d16-3/5e8a208b5f44c4885060d95e3c3ad68d6a5e95e8/40/package/xamarin.mac-6.2.0.42.pkg";
|
||||
|
||||
if (IsMac)
|
||||
{
|
||||
Item (XreItem.Xcode_10_1_0).XcodeSelect ();
|
||||
Item (XreItem.Xcode_11_1_0_rc).XcodeSelect ();
|
||||
|
||||
if(!String.IsNullOrEmpty(monoSDK_macos))
|
||||
Item ("Mono", monoVersion)
|
||||
.Source (_ => monoSDK_macos);
|
||||
|
||||
if(!String.IsNullOrEmpty(androidSDK_macos))
|
||||
Item ("Xamarin.Android", "10.0.0.43")
|
||||
.Source (_ => androidSDK_macos);
|
||||
|
||||
if(!String.IsNullOrEmpty(iOSSDK_macos))
|
||||
Item ("Xamarin.iOS", "13.2.0.42")
|
||||
.Source (_ => iOSSDK_macos);
|
||||
|
||||
if(!String.IsNullOrEmpty(macSDK_macos))
|
||||
Item ("Xamarin.Mac", "6.2.0.42")
|
||||
.Source (_ => macSDK_macos);
|
||||
|
||||
ForceJavaCleanup();
|
||||
|
||||
var dotnetVersion = System.Environment.GetEnvironmentVariable("DOTNET_VERSION");
|
||||
if (!string.IsNullOrEmpty(dotnetVersion))
|
||||
{
|
||||
// VSTS installs into a non-default location. Let's hardcode it here because why not.
|
||||
var vstsBaseInstallPath = Path.Combine (Environment.GetEnvironmentVariable ("HOME"), ".dotnet", "sdk");
|
||||
var vstsInstallPath = Path.Combine (vstsBaseInstallPath, dotnetVersion);
|
||||
var defaultInstallLocation = Path.Combine ("/usr/local/share/dotnet/sdk/", dotnetVersion);
|
||||
if (Directory.Exists (vstsBaseInstallPath) && !Directory.Exists (vstsInstallPath))
|
||||
ln (defaultInstallLocation, vstsInstallPath);
|
||||
}
|
||||
}
|
||||
Console.WriteLine(channel);
|
||||
XamarinChannel(channel);
|
||||
else
|
||||
{
|
||||
if(!String.IsNullOrEmpty(androidSDK_windows))
|
||||
Item ("Xamarin.Android", "10.0.0.43")
|
||||
.Source (_ => androidSDK_windows);
|
||||
|
||||
if(!String.IsNullOrEmpty(iOSSDK_windows))
|
||||
Item ("Xamarin.iOS", "13.2.0.42")
|
||||
.Source (_ => iOSSDK_windows);
|
||||
|
||||
if(!String.IsNullOrEmpty(macSDK_windows))
|
||||
Item ("Xamarin.Mac", "6.2.0.42")
|
||||
.Source (_ => macSDK_windows);
|
||||
|
||||
if(!String.IsNullOrEmpty(monoSDK_windows))
|
||||
Item ("Mono", monoVersion)
|
||||
.Source (_ => monoSDK_windows);
|
||||
|
||||
}
|
||||
|
||||
Item(XreItem.Java_OpenJDK_1_8_0_25);
|
||||
AndroidSdk ().ApiLevel((AndroidApiLevel)29);
|
||||
|
||||
void ln (string source, string destination)
|
||||
{
|
||||
Console.WriteLine ($"ln -sf {source} {destination}");
|
||||
if (!Config.DryRun)
|
||||
Exec ("/bin/ln", "-sf", source, destination);
|
||||
}
|
|
@ -16,6 +16,8 @@ parameters:
|
|||
nugetVersion: $(NUGET_VERSION)
|
||||
monoVersion: $(MONO_VERSION)
|
||||
apkTargetFolder: '$(build.artifactstagingdirectory)/androidApp'
|
||||
provisionatorPath: 'build/provisioning/provisioning.csx'
|
||||
provisionatorExtraArguments: ''
|
||||
|
||||
jobs:
|
||||
- job: ${{ parameters.name }}
|
||||
|
@ -27,18 +29,47 @@ jobs:
|
|||
steps:
|
||||
- checkout: self
|
||||
|
||||
- task: xamops.azdevex.provisionator-task.provisionator@1
|
||||
displayName: 'Provisionator'
|
||||
condition: eq(variables['provisioning'], 'true')
|
||||
inputs:
|
||||
provisioning_script: ${{ parameters.provisionatorPath }}
|
||||
provisioning_extra_args: ${{ parameters.provisionator.extraArguments }}
|
||||
|
||||
- task: Bash@3
|
||||
displayName: 'Cake Provision'
|
||||
condition: eq(variables['provisioning'], 'false')
|
||||
inputs:
|
||||
targetType: 'filePath'
|
||||
filePath: 'build.sh'
|
||||
arguments: --target provision
|
||||
|
||||
- task: DotNetCoreInstaller@0
|
||||
displayName: 'Install .net core $(DOTNET_VERSION)'
|
||||
condition: ne(variables['DOTNET_VERSION'], '')
|
||||
inputs:
|
||||
version: $(DOTNET_VERSION)
|
||||
|
||||
- script: |
|
||||
export PATH="$PATH:/Users/vsts/.dotnet/tools"
|
||||
export DOTNET_ROOT="$(dirname "$(readlink "$(command -v dotnet)")")"
|
||||
dotnet new globaljson --sdk-version $(DOTNET_VERSION)
|
||||
displayName: 'Add globaljson file'
|
||||
condition: ne(variables['DOTNET_VERSION'], '')
|
||||
|
||||
- script: '/bin/bash -c "sudo $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh ${{ parameters.monoVersion }}"'
|
||||
displayName: 'Select MONO ${{ parameters.monoVersion }}'
|
||||
|
||||
- task: NuGetToolInstaller@0
|
||||
displayName: 'Use NuGet ${{ parameters.nugetVersion }}'
|
||||
displayName: 'Use NuGet'
|
||||
condition: ne(variables['NUGET_VERSION'], '')
|
||||
inputs:
|
||||
versionSpec: ${{ parameters.nugetVersion }}
|
||||
versionSpec: $(NUGET_VERSION)
|
||||
|
||||
- task: NuGetCommand@2
|
||||
displayName: 'NuGet restore ${{ parameters.slnPath }}'
|
||||
inputs:
|
||||
restoreSolution: ${{ parameters.slnPath }}
|
||||
restoreSolution: ${{ parameters.slnPath }}
|
||||
|
||||
- task: MSBuild@1
|
||||
displayName: 'Build ${{ parameters.buildTaskPath }}'
|
||||
|
@ -73,4 +104,4 @@ jobs:
|
|||
displayName: 'Publish Artifact: AndroidApps'
|
||||
inputs:
|
||||
PathtoPublish: '$(build.artifactstagingdirectory)'
|
||||
ArtifactName: OSXArtifacts
|
||||
ArtifactName: OSXArtifacts
|
|
@ -22,9 +22,9 @@ steps:
|
|||
failOnStandardError: false
|
||||
|
||||
- task: NuGetToolInstaller@0
|
||||
displayName: 'Use NuGet'
|
||||
displayName: 'Use NuGet: $(NUGET_VERSION)'
|
||||
inputs:
|
||||
versionSpec: $(nugetVersion)
|
||||
versionSpec: $(NUGET_VERSION)
|
||||
|
||||
- task: NuGetCommand@2
|
||||
displayName: 'Make NuGet Package'
|
||||
|
|
|
@ -2,22 +2,38 @@ steps:
|
|||
- checkout: self
|
||||
|
||||
- task: xamops.azdevex.provisionator-task.provisionator@1
|
||||
displayName: Provisionate Xamarin
|
||||
condition: eq(variables['provisioningOSX'], 'true')
|
||||
displayName: 'Provisionator'
|
||||
condition: eq(variables['provisioning'], 'true')
|
||||
inputs:
|
||||
provisioning_script: $(provisionator.osxPath)
|
||||
provisioning_extra_args: $(provisionator.extraArguments)
|
||||
|
||||
- task: Bash@3
|
||||
displayName: 'Cake Provision'
|
||||
condition: eq(variables['provisioning'], 'false')
|
||||
inputs:
|
||||
targetType: 'filePath'
|
||||
filePath: 'build.sh'
|
||||
arguments: --target provision
|
||||
|
||||
- task: DotNetCoreInstaller@0
|
||||
displayName: 'Install .net core $(DOTNET_VERSION)'
|
||||
condition: ne(variables['DOTNET_VERSION'], '')
|
||||
inputs:
|
||||
version: $(DOTNET_VERSION)
|
||||
|
||||
- bash: sudo $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh $(MONO_VERSION)
|
||||
displayName: Switch to the latest Xamarin SDK
|
||||
|
||||
- bash: echo '##vso[task.setvariable variable=MD_APPLE_SDK_ROOT;]'/Applications/Xcode_$(XCODE_VERSION).app;sudo xcode-select --switch /Applications/Xcode_$(XCODE_VERSION).app/Contents/Developer
|
||||
displayName: Switch to the latest Xcode
|
||||
|
||||
- script: |
|
||||
export PATH="$PATH:/Users/vsts/.dotnet/tools"
|
||||
export DOTNET_ROOT="$(dirname "$(readlink "$(command -v dotnet)")")"
|
||||
dotnet new globaljson --sdk-version $(DOTNET_VERSION)
|
||||
displayName: 'Add globaljson file'
|
||||
condition: ne(variables['DOTNET_VERSION'], '')
|
||||
|
||||
- task: NuGetToolInstaller@0
|
||||
displayName: 'Use NuGet'
|
||||
condition: ne(variables['NUGET_VERSION'], '')
|
||||
inputs:
|
||||
versionSpec: $(nugetVersion)
|
||||
versionSpec: $(NUGET_VERSION)
|
||||
|
||||
- task: NuGetCommand@2
|
||||
displayName: 'NuGet restore'
|
||||
|
|
|
@ -12,7 +12,6 @@ parameters:
|
|||
releaseBuildConfiguration : 'Release'
|
||||
buildPlatform : 'any cpu'
|
||||
msbuildExtraArguments : ''
|
||||
nugetVersion: $(NUGET_VERSION)
|
||||
artifactsTargetFolder: '$(build.artifactstagingdirectory)'
|
||||
artifactsName: 'win_build'
|
||||
nunitTestAdapterFolder: 'packages/NUnitTestAdapter.AnyVersion/build/'
|
||||
|
@ -34,12 +33,34 @@ jobs:
|
|||
BuildConfiguration: ${{ parameters.releaseBuildConfiguration }}
|
||||
BuildPlatform: ${{ parameters.buildPlatform }}
|
||||
steps:
|
||||
- script: build.cmd -Target provision
|
||||
displayName: 'Cake Provision'
|
||||
condition: eq(variables['provisioning'], 'false')
|
||||
|
||||
- task: xamops.azdevex.provisionator-task.provisionator@1
|
||||
displayName: 'Provisionator'
|
||||
condition: eq(variables['provisioning'], 'true')
|
||||
inputs:
|
||||
provisioning_script: ${{ parameters.provisionatorPath }}
|
||||
provisioning_extra_args: ${{ parameters.provisionator.extraArguments }}
|
||||
|
||||
- task: DotNetCoreInstaller@0
|
||||
displayName: "Install .net core $(DOTNET_VERSION)"
|
||||
condition: ne(variables['DOTNET_VERSION'], '')
|
||||
inputs:
|
||||
version: $(DOTNET_VERSION)
|
||||
|
||||
- script: |
|
||||
dotnet new globaljson --sdk-version $(DOTNET_VERSION)
|
||||
displayName: 'Add globaljson file'
|
||||
condition: ne(variables['DOTNET_VERSION'], '')
|
||||
|
||||
- task: NuGetToolInstaller@0
|
||||
displayName: 'Use NuGet ${{ parameters.nugetVersion }}'
|
||||
displayName: 'Use NuGet $(NUGET_VERSION)'
|
||||
condition: ne(variables['NUGET_VERSION'], '')
|
||||
inputs:
|
||||
versionSpec: ${{ parameters.nugetVersion }}
|
||||
|
||||
versionSpec: $(NUGET_VERSION)
|
||||
|
||||
- task: NuGetCommand@2
|
||||
displayName: 'NuGet restore ${{ parameters.slnPath }}'
|
||||
inputs:
|
||||
|
|
Загрузка…
Ссылка в новой задаче