[Handlers] Build controlgallery and UItests for it (#13485)

* Update cake and yaml

* Reset simulator isn't working

* [Build] Remove restore from yaml

* [Build]Update the restore on cake

* [Build] Build android gallery uitests from cake
This commit is contained in:
Rui Marinho 2021-01-24 16:05:53 +00:00 коммит произвёл GitHub
Родитель f54e7bb356
Коммит b45e87f45e
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
15 изменённых файлов: 420 добавлений и 65 удалений

Просмотреть файл

@ -104,10 +104,25 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.Forms.Platform.iOS.
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.Forms.Maps.iOS", "src\Controls\Maps\src\Xamarin.Forms.Maps.iOS\Xamarin.Forms.Maps.iOS.csproj", "{ABA078C4-F9BB-4924-8B2B-10FE0D2F5491}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{52963C98-6AD9-4B57-924F-BE58DC36D746}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{FFCE9E2C-327C-46E7-8AC1-18CB2E982C2E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.Forms.Core.iOS.UITests", "src\ControlGallery\test\Xamarin.Forms.Core.iOS.UITests\Xamarin.Forms.Core.iOS.UITests.csproj", "{EADD8100-B3AE-4A31-92C4-267A64A1C6EB}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Xamarin.Forms.Core.UITests.Shared", "src\ControlGallery\src\Xamarin.Forms.Core.UITests.Shared\Xamarin.Forms.Core.UITests.Shared.shproj", "{E175485B-3C8C-47D7-8DD5-F7FED627EB25}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.Forms.Core.Android.UITests", "src\ControlGallery\test\Xamarin.Forms.Core.Android.UITests\Xamarin.Forms.Core.Android.UITests.csproj", "{A34EBE01-25BF-4E69-A2DC-2288DC625541}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
src\ControlGallery\src\Xamarin.Forms.Controls.Issues.Shared\Xamarin.Forms.Controls.Issues.Shared.projitems*{0f0db9cc-ea65-429c-9363-38624bf8f49c}*SharedItemsImports = 13
src\ControlGallery\src\Xamarin.Forms.Controls.Issues.Shared\Xamarin.Forms.Controls.Issues.Shared.projitems*{7ad93806-111d-4fdc-b48d-9566765185ff}*SharedItemsImports = 5
src\ControlGallery\src\Xamarin.Forms.Controls.Issues.Shared\Xamarin.Forms.Controls.Issues.Shared.projitems*{a34ebe01-25bf-4e69-a2dc-2288dc625541}*SharedItemsImports = 4
src\ControlGallery\src\Xamarin.Forms.Core.UITests.Shared\Xamarin.Forms.Core.UITests.projitems*{a34ebe01-25bf-4e69-a2dc-2288dc625541}*SharedItemsImports = 4
src\ControlGallery\src\Xamarin.Forms.Core.UITests.Shared\Xamarin.Forms.Core.UITests.projitems*{e175485b-3c8c-47d7-8dd5-f7fed627eb25}*SharedItemsImports = 13
src\ControlGallery\src\Xamarin.Forms.Controls.Issues.Shared\Xamarin.Forms.Controls.Issues.Shared.projitems*{eadd8100-b3ae-4a31-92c4-267a64a1c6eb}*SharedItemsImports = 4
src\ControlGallery\src\Xamarin.Forms.Core.UITests.Shared\Xamarin.Forms.Core.UITests.projitems*{eadd8100-b3ae-4a31-92c4-267a64a1c6eb}*SharedItemsImports = 4
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -845,6 +860,62 @@ Global
{ABA078C4-F9BB-4924-8B2B-10FE0D2F5491}.Release|x64.Build.0 = Release|Any CPU
{ABA078C4-F9BB-4924-8B2B-10FE0D2F5491}.Release|x86.ActiveCfg = Release|Any CPU
{ABA078C4-F9BB-4924-8B2B-10FE0D2F5491}.Release|x86.Build.0 = Release|Any CPU
{EADD8100-B3AE-4A31-92C4-267A64A1C6EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EADD8100-B3AE-4A31-92C4-267A64A1C6EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EADD8100-B3AE-4A31-92C4-267A64A1C6EB}.Debug|ARM.ActiveCfg = Debug|Any CPU
{EADD8100-B3AE-4A31-92C4-267A64A1C6EB}.Debug|ARM.Build.0 = Debug|Any CPU
{EADD8100-B3AE-4A31-92C4-267A64A1C6EB}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{EADD8100-B3AE-4A31-92C4-267A64A1C6EB}.Debug|ARM64.Build.0 = Debug|Any CPU
{EADD8100-B3AE-4A31-92C4-267A64A1C6EB}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{EADD8100-B3AE-4A31-92C4-267A64A1C6EB}.Debug|iPhone.Build.0 = Debug|Any CPU
{EADD8100-B3AE-4A31-92C4-267A64A1C6EB}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{EADD8100-B3AE-4A31-92C4-267A64A1C6EB}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{EADD8100-B3AE-4A31-92C4-267A64A1C6EB}.Debug|x64.ActiveCfg = Debug|Any CPU
{EADD8100-B3AE-4A31-92C4-267A64A1C6EB}.Debug|x64.Build.0 = Debug|Any CPU
{EADD8100-B3AE-4A31-92C4-267A64A1C6EB}.Debug|x86.ActiveCfg = Debug|Any CPU
{EADD8100-B3AE-4A31-92C4-267A64A1C6EB}.Debug|x86.Build.0 = Debug|Any CPU
{EADD8100-B3AE-4A31-92C4-267A64A1C6EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EADD8100-B3AE-4A31-92C4-267A64A1C6EB}.Release|Any CPU.Build.0 = Release|Any CPU
{EADD8100-B3AE-4A31-92C4-267A64A1C6EB}.Release|ARM.ActiveCfg = Release|Any CPU
{EADD8100-B3AE-4A31-92C4-267A64A1C6EB}.Release|ARM.Build.0 = Release|Any CPU
{EADD8100-B3AE-4A31-92C4-267A64A1C6EB}.Release|ARM64.ActiveCfg = Release|Any CPU
{EADD8100-B3AE-4A31-92C4-267A64A1C6EB}.Release|ARM64.Build.0 = Release|Any CPU
{EADD8100-B3AE-4A31-92C4-267A64A1C6EB}.Release|iPhone.ActiveCfg = Release|Any CPU
{EADD8100-B3AE-4A31-92C4-267A64A1C6EB}.Release|iPhone.Build.0 = Release|Any CPU
{EADD8100-B3AE-4A31-92C4-267A64A1C6EB}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{EADD8100-B3AE-4A31-92C4-267A64A1C6EB}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{EADD8100-B3AE-4A31-92C4-267A64A1C6EB}.Release|x64.ActiveCfg = Release|Any CPU
{EADD8100-B3AE-4A31-92C4-267A64A1C6EB}.Release|x64.Build.0 = Release|Any CPU
{EADD8100-B3AE-4A31-92C4-267A64A1C6EB}.Release|x86.ActiveCfg = Release|Any CPU
{EADD8100-B3AE-4A31-92C4-267A64A1C6EB}.Release|x86.Build.0 = Release|Any CPU
{A34EBE01-25BF-4E69-A2DC-2288DC625541}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A34EBE01-25BF-4E69-A2DC-2288DC625541}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A34EBE01-25BF-4E69-A2DC-2288DC625541}.Debug|ARM.ActiveCfg = Debug|Any CPU
{A34EBE01-25BF-4E69-A2DC-2288DC625541}.Debug|ARM.Build.0 = Debug|Any CPU
{A34EBE01-25BF-4E69-A2DC-2288DC625541}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{A34EBE01-25BF-4E69-A2DC-2288DC625541}.Debug|ARM64.Build.0 = Debug|Any CPU
{A34EBE01-25BF-4E69-A2DC-2288DC625541}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{A34EBE01-25BF-4E69-A2DC-2288DC625541}.Debug|iPhone.Build.0 = Debug|Any CPU
{A34EBE01-25BF-4E69-A2DC-2288DC625541}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{A34EBE01-25BF-4E69-A2DC-2288DC625541}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{A34EBE01-25BF-4E69-A2DC-2288DC625541}.Debug|x64.ActiveCfg = Debug|Any CPU
{A34EBE01-25BF-4E69-A2DC-2288DC625541}.Debug|x64.Build.0 = Debug|Any CPU
{A34EBE01-25BF-4E69-A2DC-2288DC625541}.Debug|x86.ActiveCfg = Debug|Any CPU
{A34EBE01-25BF-4E69-A2DC-2288DC625541}.Debug|x86.Build.0 = Debug|Any CPU
{A34EBE01-25BF-4E69-A2DC-2288DC625541}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A34EBE01-25BF-4E69-A2DC-2288DC625541}.Release|Any CPU.Build.0 = Release|Any CPU
{A34EBE01-25BF-4E69-A2DC-2288DC625541}.Release|ARM.ActiveCfg = Release|Any CPU
{A34EBE01-25BF-4E69-A2DC-2288DC625541}.Release|ARM.Build.0 = Release|Any CPU
{A34EBE01-25BF-4E69-A2DC-2288DC625541}.Release|ARM64.ActiveCfg = Release|Any CPU
{A34EBE01-25BF-4E69-A2DC-2288DC625541}.Release|ARM64.Build.0 = Release|Any CPU
{A34EBE01-25BF-4E69-A2DC-2288DC625541}.Release|iPhone.ActiveCfg = Release|Any CPU
{A34EBE01-25BF-4E69-A2DC-2288DC625541}.Release|iPhone.Build.0 = Release|Any CPU
{A34EBE01-25BF-4E69-A2DC-2288DC625541}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{A34EBE01-25BF-4E69-A2DC-2288DC625541}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{A34EBE01-25BF-4E69-A2DC-2288DC625541}.Release|x64.ActiveCfg = Release|Any CPU
{A34EBE01-25BF-4E69-A2DC-2288DC625541}.Release|x64.Build.0 = Release|Any CPU
{A34EBE01-25BF-4E69-A2DC-2288DC625541}.Release|x86.ActiveCfg = Release|Any CPU
{A34EBE01-25BF-4E69-A2DC-2288DC625541}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -870,9 +941,9 @@ Global
{F137FAC5-3385-4B19-988B-4A14ED84CCC6} = {8A70C15D-86D3-4086-A8C5-E17B299EA970}
{C328C538-B69F-43D2-80EE-3C1EB8254CBA} = {E7F90170-B71B-4730-A082-1DF4E4F04420}
{7A753001-1C3D-404D-A421-2E052A545EAC} = {2ACC7FFA-238F-44FD-93CB-4D9B17D8C4BA}
{0F0DB9CC-EA65-429C-9363-38624BF8F49C} = {F07FDC58-64A0-42DA-8556-09742721F15E}
{7AD93806-111D-4FDC-B48D-9566765185FF} = {F07FDC58-64A0-42DA-8556-09742721F15E}
{1346A7F1-4457-4BB4-A371-2C8E28BBD53E} = {F07FDC58-64A0-42DA-8556-09742721F15E}
{0F0DB9CC-EA65-429C-9363-38624BF8F49C} = {52963C98-6AD9-4B57-924F-BE58DC36D746}
{7AD93806-111D-4FDC-B48D-9566765185FF} = {52963C98-6AD9-4B57-924F-BE58DC36D746}
{1346A7F1-4457-4BB4-A371-2C8E28BBD53E} = {52963C98-6AD9-4B57-924F-BE58DC36D746}
{8A70C15D-86D3-4086-A8C5-E17B299EA970} = {97FA536A-675D-41C7-A90E-97E2F79D1AE2}
{1D11EC11-4734-47D4-9B62-4D03CFF67090} = {8A70C15D-86D3-4086-A8C5-E17B299EA970}
{E7F90170-B71B-4730-A082-1DF4E4F04420} = {97FA536A-675D-41C7-A90E-97E2F79D1AE2}
@ -884,9 +955,14 @@ Global
{B5E27729-44E8-4BE6-A62E-45FF27449B8F} = {29AC50BF-B4FB-450B-9386-0C5AD4B84226}
{5CE892DB-8CA2-42E4-8130-2836D28AD8DB} = {29AC50BF-B4FB-450B-9386-0C5AD4B84226}
{A4C57790-71D1-467C-A69E-2BD84CB6666C} = {5CE892DB-8CA2-42E4-8130-2836D28AD8DB}
{C7131F14-274F-4B55-ACA9-E81731AD012F} = {F07FDC58-64A0-42DA-8556-09742721F15E}
{C7131F14-274F-4B55-ACA9-E81731AD012F} = {52963C98-6AD9-4B57-924F-BE58DC36D746}
{52C50E88-7F15-45FE-A63C-8E7C76CA2BAE} = {5CE892DB-8CA2-42E4-8130-2836D28AD8DB}
{ABA078C4-F9BB-4924-8B2B-10FE0D2F5491} = {8A70C15D-86D3-4086-A8C5-E17B299EA970}
{52963C98-6AD9-4B57-924F-BE58DC36D746} = {F07FDC58-64A0-42DA-8556-09742721F15E}
{FFCE9E2C-327C-46E7-8AC1-18CB2E982C2E} = {F07FDC58-64A0-42DA-8556-09742721F15E}
{EADD8100-B3AE-4A31-92C4-267A64A1C6EB} = {FFCE9E2C-327C-46E7-8AC1-18CB2E982C2E}
{E175485B-3C8C-47D7-8DD5-F7FED627EB25} = {FFCE9E2C-327C-46E7-8AC1-18CB2E982C2E}
{A34EBE01-25BF-4E69-A2DC-2288DC625541} = {FFCE9E2C-327C-46E7-8AC1-18CB2E982C2E}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {650AE971-2F29-46A8-822C-FB4FCDC6A9A0}

Просмотреть файл

@ -47,19 +47,27 @@ if(String.IsNullOrWhiteSpace(target))
var IOS_SIM_NAME = GetBuildVariable("IOS_SIM_NAME", "iPhone 7");
var IOS_SIM_RUNTIME = GetBuildVariable("IOS_SIM_RUNTIME", "com.apple.CoreSimulator.SimRuntime.iOS-12-4");
var IOS_TEST_PROJ = "./Xamarin.Forms.Core.iOS.UITests/Xamarin.Forms.Core.iOS.UITests.csproj";
var IOS_TEST_LIBRARY = Argument("IOS_TEST_LIBRARY", $"./Xamarin.Forms.Core.iOS.UITests/bin/{configuration}/Xamarin.Forms.Core.iOS.UITests.dll");
var IOS_IPA_PATH = Argument("IOS_IPA_PATH", $"./Xamarin.Forms.ControlGallery.iOS/bin/iPhoneSimulator/{configuration}/XamarinFormsControlGalleryiOS.app");
var IOS_BUNDLE_ID = "com.xamarin.quickui.controlgallery";
var IOS_BUILD_IPA = GetBuildVariable("IOS_BUILD_IPA", (target == "cg-ios-deploy") ? true : (false || isCIBuild) );
Guid IOS_SIM_UDID = GetBuildVariable("IOS_SIM_UDID", Guid.Empty);
var IOS_CONTROLGALLERY_PROJ = "src/ControlGallery/src/Xamarin.Forms.ControlGallery.iOS/Xamarin.Forms.ControlGallery.iOS.csproj";
var IOS_TEST_PROJ = "./src/ControlGallery/test/Xamarin.Forms.Core.iOS.UITests/Xamarin.Forms.Core.iOS.UITests.csproj";
var IOS_TEST_LIBRARY = Argument("IOS_TEST_LIBRARY", $"./src/ControlGallery/test/Xamarin.Forms.Core.iOS.UITests/bin/{configuration}/Xamarin.Forms.Core.iOS.UITests.dll");
var IOS_IPA_PATH = Argument("IOS_IPA_PATH", $"./src/ControlGallery/test/Xamarin.Forms.ControlGallery.iOS/bin/iPhoneSimulator/{configuration}/XamarinFormsControlGalleryiOS.app");
var IOS_BUNDLE_ID = "com.xamarin.xamarin-forms-controlgallery";
var IOS_BUILD_IPA = Argument("IOS_BUILD_IPA", (target == "cg-ios-deploy") ? true : (false || isCIBuild) );
Guid IOS_SIM_UDID = Argument("IOS_SIM_UDID", Guid.Empty);
var UWP_PACKAGE_ID = "0d4424f6-1e29-4476-ac00-ba22c3789cb6";
var UWP_TEST_LIBRARY = GetBuildVariable("UWP_TEST_LIBRARY", $"./Xamarin.Forms.Core.Windows.UITests/bin/{configuration}/Xamarin.Forms.Core.Windows.UITests.dll");
var UWP_TEST_LIBRARY = GetBuildVariable("UWP_TEST_LIBRARY", $"./src/ControlGallery/test/Xamarin.Forms.Core.Windows.UITests/bin/{configuration}/Xamarin.Forms.Core.Windows.UITests.dll");
var UWP_PFX_PATH = Argument("UWP_PFX_PATH", "Xamarin.Forms.ControlGallery.WindowsUniversal\\Xamarin.Forms.ControlGallery.WindowsUniversal_TemporaryKey.pfx");
var UWP_APP_PACKAGES_PATH = Argument("UWP_APP_PACKAGES_PATH", "*/AppPackages/");
var UWP_APP_DRIVER_INSTALL_PATH = Argument("UWP_APP_DRIVER_INSTALL_PATH", "https://github.com/microsoft/WinAppDriver/releases/download/v1.2-RC/WindowsApplicationDriver.msi");
var ANDROID_BUNDLE_ID = "com.xamarin.xamarin_forms_controlgallery";
var ANDROID_CONTROLGALLERY_PROJ = "src/ControlGallery/src/Xamarin.Forms.ControlGallery.Android/Xamarin.Forms.ControlGallery.Android.csproj";
var ANDROID_RENDERERS = Argument("ANDROID_RENDERERS", "FAST");
var ANDROID_TEST_PROJ = "./src/ControlGallery/test/Xamarin.Forms.Core.Android.UITests/Xamarin.Forms.Core.Android.UITests.csproj";
var BUILD_TASKS_PROJ ="src/Forms/src/Xamarin.Forms.Build.Tasks/Xamarin.Forms.Build.Tasks.csproj";
var XamarinFormsVersion = Argument("XamarinFormsVersion", "");
var packageVersion = Argument("packageVersion", "");
var releaseChannelArg = Argument("CHANNEL", "Stable");
@ -834,10 +842,10 @@ Task("BuildPages")
});
Task("BuildTasks")
.Description("Build Xamarin.Forms.Build.Tasks/Xamarin.Forms.Build.Tasks.csproj")
.Description($"Build {BUILD_TASKS_PROJ}")
.Does(() =>
{
MSBuild("./src/Forms/src/Xamarin.Forms.Build.Tasks/Xamarin.Forms.Build.Tasks.csproj", GetMSBuildSettings().WithRestore());
MSBuild(BUILD_TASKS_PROJ, GetMSBuildSettings().WithRestore());
});
Task("Build")
@ -881,6 +889,8 @@ Task("cg-android")
{
var buildSettings = GetMSBuildSettings();
buildSettings = buildSettings.WithRestore();
if(isCIBuild)
{
buildSettings = buildSettings.WithTarget("Rebuild").WithTarget("SignAndroidPackage");
@ -891,12 +901,29 @@ Task("cg-android")
buildSettings.BinaryLogger = binaryLogger;
binaryLogger.FileName = $"{artifactStagingDirectory}/android-{ANDROID_RENDERERS}.binlog";
}
else
MSBuild(ANDROID_CONTROLGALLERY_PROJ, buildSettings);
});
Task("cg-android-build-tests")
.IsDependentOn("BuildTasks")
.Does(() =>
{
var buildSettings = GetMSBuildSettings();
buildSettings = buildSettings.WithRestore();
if(isCIBuild)
{
buildSettings = buildSettings.WithRestore();
var binaryLogger = new MSBuildBinaryLogSettings {
Enabled = true,
FileName = $"{artifactStagingDirectory}/android-uitests.binlog"
};
buildSettings.BinaryLogger = binaryLogger;
}
MSBuild("./Xamarin.Forms.ControlGallery.Android/Xamarin.Forms.ControlGallery.Android.csproj", buildSettings);
MSBuild(ANDROID_TEST_PROJ, buildSettings);
});
Task("cg-android-vs")
@ -916,22 +943,19 @@ Task("cg-ios")
GetMSBuildSettings(null)
.WithProperty("BuildIpa", $"{IOS_BUILD_IPA}");
buildSettings = buildSettings.WithRestore();
if(isCIBuild)
{
var binaryLogger = new MSBuildBinaryLogSettings {
Enabled = true
};
buildSettings.BinaryLogger = binaryLogger;
binaryLogger.FileName = $"{artifactStagingDirectory}/ios-cg.binlog";
}
else
{
buildSettings = buildSettings.WithRestore();
}
MSBuild("./Xamarin.Forms.ControlGallery.iOS/Xamarin.Forms.ControlGallery.iOS.csproj",
buildSettings);
MSBuild(IOS_CONTROLGALLERY_PROJ, buildSettings);
});
Task("cg-ios-vs")
@ -1022,6 +1046,8 @@ Task ("cg-ios-deploy")
// Look for a matching simulator on the system
var sim = GetIosSimulator();
//ShutdownAndResetiOSSimulator(sim);
// Boot the simulator
Information("Booting: {0} ({1} - {2})", sim.Name, sim.Runtime, sim.UDID);
if (!sim.State.ToLower().Contains ("booted"))
@ -1052,15 +1078,14 @@ Task("DeployAndroid")
.Description("Builds and deploy Android Control Gallery")
.Does(() =>
{
MSBuild("./Xamarin.Forms.Build.Tasks/Xamarin.Forms.Build.Tasks.csproj", GetMSBuildSettings().WithRestore());
MSBuild("./Xamarin.Forms.ControlGallery.Android/Xamarin.Forms.ControlGallery.Android.csproj", GetMSBuildSettings().WithRestore());
BuildAndroidApk("./Xamarin.Forms.ControlGallery.Android/Xamarin.Forms.ControlGallery.Android.csproj", sign:true, configuration:configuration);
AdbUninstall("AndroidControlGallery.AndroidControlGallery");
AdbInstall("./Xamarin.Forms.ControlGallery.Android/bin/Debug/AndroidControlGallery.AndroidControlGallery-Signed.apk");
AmStartActivity("AndroidControlGallery.AndroidControlGallery/md546303760447087909496d02dc7b17ae8.Activity1");
MSBuild(BUILD_TASKS_PROJ, GetMSBuildSettings().WithRestore());
MSBuild(ANDROID_CONTROLGALLERY_PROJ, GetMSBuildSettings().WithRestore());
BuildAndroidApk(ANDROID_CONTROLGALLERY_PROJ, sign:true, configuration:configuration);
AdbUninstall(ANDROID_BUNDLE_ID);
AdbInstall($"src/Controlgallery/src/Xamarin.Forms.ControlGallery.Android/bin/Debug/{ANDROID_BUNDLE_ID}-Signed.apk");
AmStartActivity($"{ANDROID_BUNDLE_ID}/md546303760447087909496d02dc7b17ae8.Activity1");
});
//////////////////////////////////////////////////////////////////////
// TASK TARGETS
//////////////////////////////////////////////////////////////////////
@ -1186,6 +1211,27 @@ Version XcodeVersion()
}
IReadOnlyList<AppleSimulator> iosSimulators = null;
void ShutdownAndResetiOSSimulator(AppleSimulator sim)
{
//close all simulators , reset needs simulator to be closed
Information("Shutdown simulators: {0} ({1} - {2}) State: {3}", sim.Name, sim.Runtime, sim.UDID, sim.State);
ShutdownAllAppleSimulators();
var shutdown = false;
for (int i = 0; i < 100; i++) {
if (ListAppleSimulators().Any (s => s.UDID == sim.UDID && s.State.ToLower().Contains("shutdown"))) {
shutdown = true;
break;
}
System.Threading.Thread.Sleep(1000);
}
//Reset the simulator
Information ("Factory reset simulator: {0}", sim.UDID);
EraseAppleSimulator(sim.UDID);
}
AppleSimulator GetIosSimulator()
{
if(iosSimulators == null)

Просмотреть файл

@ -0,0 +1,71 @@
steps:
- checkout: self
clean: true
- task: xamops.azdevex.provisionator-task.provisionator@1
displayName: 'Provisionator'
condition: eq(variables['provisioning'], 'true')
inputs:
provisioning_script: $(provisionator.path)
provisioning_extra_args: $(provisionator.extraArguments)
- task: Bash@3
displayName: 'Cake Provision'
condition: eq(variables['provisioningCake'], 'true')
inputs:
targetType: 'filePath'
filePath: 'build.sh'
arguments: --target provision --TeamProject="$(System.TeamProject)"
- task: UseDotNet@2
displayName: 'Install .net core $(DOTNET_VERSION)'
condition: ne(variables['DOTNET_VERSION'], '')
inputs:
version: $(DOTNET_VERSION)
packageType: 'sdk'
# - script: '/bin/bash -c "sudo $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh ${{ parameters.monoVersion }}"'
# displayName: 'Select MONO ${{ parameters.monoVersion }}'
- task: Bash@3
displayName: 'Build Android $(renderers)'
inputs:
targetType: 'filePath'
filePath: 'build.sh'
arguments: --target cg-android --ANDROID_RENDERERS="$(renderers)" --GoogleMapsAPIKey="$(GoogleMapsAPIKey)" --BUILD_CONFIGURATION=$(BuildConfiguration)
- task: Bash@3
displayName: 'Build Android UITests'
inputs:
targetType: 'filePath'
filePath: 'build.sh'
arguments: --target cg-android-build-tests -BUILD_CONFIGURATION=$(BuildConfiguration)
- task: CopyFiles@2
displayName: 'Copy Android Files for UITest'
inputs:
Contents: |
**/Xamarin.Forms.Core.Android.UITests/bin/$(BuildConfiguration)/Newtonsoft.Json.*
**/Xamarin.Forms.Core.Android.UITests/bin/$(BuildConfiguration)/nunit.*
**/Xamarin.Forms.Core.Android.UITests/bin/$(BuildConfiguration)/NUnit3.*
**/Xamarin.Forms.Core.Android.UITests/bin/$(BuildConfiguration)/Plugin.*
**/Xamarin.Forms.Core.Android.UITests/bin/$(BuildConfiguration)/Xamarin.*
TargetFolder: '$(build.artifactstagingdirectory)/android'
CleanTargetFolder: true
flattenFolders: true
- task: CopyFiles@2
displayName: 'Copy $(renderers)'
inputs:
SourceFolder: src/ControlGallery/src/Xamarin.Forms.ControlGallery.Android/bin/$(BuildConfiguration)/
Contents: '**/*.apk'
TargetFolder: '$(build.artifactstagingdirectory)/androidApp'
CleanTargetFolder: true
flattenFolders: true
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: AndroidApps'
condition: always()
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'
ArtifactName: OSXArtifacts

Просмотреть файл

@ -0,0 +1,117 @@
steps:
- checkout: self
clean: true
- task: xamops.azdevex.provisionator-task.provisionator@1
displayName: 'Provision Xcode'
condition: ne(variables['REQUIRED_XCODE'], '')
inputs:
provisioning_script: $(provisionator.xcode)
- task: xamops.azdevex.provisionator-task.provisionator@1
displayName: 'Provisionator'
condition: eq(variables['provisioning'], 'true')
inputs:
provisioning_script: $(provisionator.path)
provisioning_extra_args: $(provisionator.extraArguments)
- script: |
echo "##vso[task.prependpath]/Library/Frameworks/Mono.framework/Versions/Current/Commands/"
echo "##vso[task.prependpath]~/Library/Developer/Xamarin/android-sdk-macosx"
displayName: 'Setup SDK Paths'
condition: ne(variables['osx2019VmPool'], 'Azure Pipelines')
- task: Bash@3
displayName: 'Cake Provision'
condition: eq(variables['provisioningCake'], 'true')
inputs:
targetType: 'filePath'
filePath: 'build.sh'
arguments: --target provision --TeamProject="$(System.TeamProject)"
- task: UseDotNet@2
displayName: 'Install .net core $(DOTNET_VERSION)'
condition: ne(variables['DOTNET_VERSION'], '')
inputs:
version: $(DOTNET_VERSION)
packageType: 'sdk'
- task: InstallAppleCertificate@2
displayName: 'Install an Apple certificate'
inputs:
certSecureFile: 'XamarinForms.p12'
certPwd: $(P12password)
- task: InstallAppleProvisioningProfile@1
displayName: 'Install an Apple provisioning profile'
inputs:
provProfileSecureFile: 'Xamarin Forms iOS Provisioning.mobileprovision'
- task: Bash@3
displayName: 'Build Control Gallery IPA'
inputs:
targetType: 'filePath'
filePath: 'build.sh'
arguments: --target cg-ios --BUILD_CONFIGURATION=$(BuildConfiguration)
- task: Bash@3
displayName: 'Build iOS UITests Tests'
inputs:
targetType: 'filePath'
filePath: 'build.sh'
arguments: --target cg-ios-build-tests -BUILD_CONFIGURATION=$(BuildConfiguration)
- task: CopyFiles@2
displayName: 'Copy iOS Files for UITest'
inputs:
Contents: |
**/XamarinFormsControlGalleryiOS.ipa
**/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'
flattenFolders: true
- task: CopyFiles@2
displayName: 'Copy iOS dSYM'
inputs:
SourceFolder: 'src/ControlGallery/src/Xamarin.Forms.ControlGallery.iOS/bin/iPhone/$(BuildConfiguration)/XamarinFormsControlGalleryiOS.app.dSYM/'
TargetFolder: '$(build.artifactstagingdirectory)/ios/iPhone/XamarinFormsControlGalleryiOS.app.dSYM/'
CleanTargetFolder: false
flattenFolders: false
- task: CopyFiles@2
displayName: 'Copy iOS App'
inputs:
SourceFolder: 'src/ControlGallery/src/Xamarin.Forms.ControlGallery.iOS/bin/iPhoneSimulator/$(BuildConfiguration)/XamarinFormsControlGalleryiOS.app/'
TargetFolder: '$(build.artifactstagingdirectory)/ios/iPhoneSimulator/XamarinFormsControlGalleryiOS.app/'
CleanTargetFolder: false
flattenFolders: false
- task: CopyFiles@2
displayName: 'Copy test-cloud.exe'
inputs:
Contents: '**/Xamarin.UITest.*/tools/test-cloud.exe'
TargetFolder: '$(build.artifactstagingdirectory)/testcloud'
OverWrite: true
flattenFolders: true
- task: CopyFiles@2
displayName: 'Copy Cake File'
inputs:
Contents: |
build.cake
build/provisioning/provisioning.csx
build/provisioning/xcode.csx
TargetFolder: '$(build.artifactstagingdirectory)'
CleanTargetFolder: false
flattenFolders: true
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: iOS'
condition: always()
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'
ArtifactName: OSXArtifacts

Просмотреть файл

@ -1,11 +1,13 @@
variables:
- name: SolutionFile
value: Xamarin.Forms.sln
- name: ControlGallerySolutionFile
value: Xamarin.Forms.ControlGallery.sln
- name: BuildVersion
value: $[counter('handler-counter', 1)]
- name: NUGET_VERSION
value: 5.6.0
value: 5.8.1
- name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE
value: true
- name: DOTNET_VERSION
value: 3.1.301
value: 5.0.102

Просмотреть файл

@ -77,4 +77,47 @@ stages:
steps:
- template: common/build-windows.yml
parameters:
provisionatorPath : '/build/provisioning/provisioning.csx'
provisionatorPath : '/build/provisioning/provisioning.csx'
- stage: build_osx
displayName: iOS
dependsOn: []
jobs:
- job: ios
workspace:
clean: all
displayName: Build ControlGallery iOS
timeoutInMinutes: 120
pool:
name: $(macOSXVmPool)
vmImage: $(macOSXVmImage)
demands:
- sh
- Xamarin.iOS
variables:
provisionator.xcode : '$(System.DefaultWorkingDirectory)/eng/provisioning/xcode.csx'
provisionator.path : '$(System.DefaultWorkingDirectory)/eng/provisioning/provisioning.csx'
provisionator.extraArguments : '--v'
steps:
- template: common/controlgallery-ios.yml
- stage: build_android
displayName: Android
dependsOn: []
jobs:
- job: android
workspace:
clean: all
displayName: Build ControlGallery Android
timeoutInMinutes: 120
pool:
name: $(macOSXVmPool)
vmImage: $(macOSXVmImage)
variables:
renderers: 'FAST'
outputfolder: 'newRenderers'
provisionator.xcode : '$(System.DefaultWorkingDirectory)/eng/provisioning/xcode.csx'
provisionator.path : '$(System.DefaultWorkingDirectory)/eng/provisioning/provisioning.csx'
provisionator.extraArguments : '--v'
steps:
- template: common/controlgallery-android.yml

Просмотреть файл

@ -128,4 +128,4 @@ jobs:
condition: always()
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'
ArtifactName: OSXArtifacts
ArtifactName: OSXArtifacts

Просмотреть файл

@ -163,4 +163,4 @@ steps:
condition: always()
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'
ArtifactName: OSXArtifacts
ArtifactName: OSXArtifacts

Просмотреть файл

@ -16,7 +16,7 @@ namespace Xamarin.Forms.ControlGallery.Android
{
// This is the AppCompat version of Activity1
[Activity(Label = "Control Gallery", Icon = "@drawable/icon", Theme = "@style/MyTheme",
[Activity(Label = "Xamarin Forms", Icon = "@drawable/icon", Theme = "@style/MyTheme",
MainLauncher = true, HardwareAccelerated = true,
ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.UiMode)]
[IntentFilter(new[] { Intent.ActionView },

Просмотреть файл

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="AndroidControlGallery.AndroidControlGallery" android:installLocation="auto">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.xamarin.xamarin_forms_controlgallery" android:installLocation="auto">
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="30" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
@ -16,7 +16,7 @@
<uses-permission android:name="android.permission.READ_LOGS" />
<uses-permission android:name="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE" />
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
<application android:label="AndroidControlGallery" android:supportsRtl="true">
<application android:label="XamarinForms" android:supportsRtl="true">
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
<uses-library android:name="org.apache.http.legacy" android:required="false" />
</application>

Просмотреть файл

@ -37,7 +37,7 @@
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DefineConstants>$(DefineConstants);HAVE_OPENTK</DefineConstants>
<AndroidKeyStore>True</AndroidKeyStore>
<AndroidSigningKeyStore>$(SolutionDir)eng/debug.keystore</AndroidSigningKeyStore>
<AndroidSigningKeyStore>$(SolutionDir)../../../eng/debug.keystore</AndroidSigningKeyStore>
<AndroidSigningStorePass>android</AndroidSigningStorePass>
<AndroidSigningKeyAlias>androiddebugkey</AndroidSigningKeyAlias>
<AndroidSigningKeyPass>android</AndroidSigningKeyPass>

Просмотреть файл

@ -24,9 +24,9 @@
<key>MinimumOSVersion</key>
<string>8.0</string>
<key>CFBundleDisplayName</key>
<string>XamControl</string>
<string>Xamarin Forms</string>
<key>CFBundleIdentifier</key>
<string>com.xamarin.quickui.controlgallery</string>
<string>com.xamarin.xamarin-forms-controlgallery</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>CFBundleIconFiles</key>

Просмотреть файл

@ -21,13 +21,13 @@ namespace Xamarin.Forms.Controls
{
internal static class AppPaths
{
public static string ApkPath = "../../../Xamarin.Forms.ControlGallery.Android/bin/Debug/AndroidControlGallery.AndroidControlGallery-Signed.apk";
public static string ApkPath = "../../../../src/Xamarin.Forms.ControlGallery.Android/bin/Debug/AndroidControlGallery.AndroidControlGallery-Signed.apk";
public static string MacOSPath = "../../../Xamarin.Forms.ControlGallery.MacOS/bin/Debug/Xamarin.Forms.ControlGallery.MacOS.app";
public static string MacOSPath = "../../../../src/Xamarin.Forms.ControlGallery.MacOS/bin/Debug/Xamarin.Forms.ControlGallery.MacOS.app";
// Have to continue using the old BundleId for now; Test Cloud doesn't like
// when you change the BundleId
public static string BundleId = "com.xamarin.quickui.controlgallery";
public static string BundleId = "com.xamarin.xamarin-forms-controlgallery";
// Have to continue using the old BundleId for now; Test Cloud doesn't like
// when you change the BundleId

Просмотреть файл

@ -58,27 +58,23 @@
<Compile Include="PlatformTests\DisplayAlertUITestsAndroid.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\src\Platform.Handlers\src\Xamarin.Platform.Handlers\Xamarin.Platform.Handlers.csproj">
<ProjectReference Include="..\..\..\Platform.Handlers\src\Xamarin.Platform.Handlers\Xamarin.Platform.Handlers.csproj">
<Project>{e2403480-7079-4e09-9c21-113b615a2a0a}</Project>
<Name>Xamarin.Platform.Handlers</Name>
</ProjectReference>
<ProjectReference Include="..\Xamarin.Forms.Core\Xamarin.Forms.Core.csproj">
<ProjectReference Include="..\..\..\Forms\src\Xamarin.Forms.Core\Xamarin.Forms.Core.csproj">
<Project>{57B8B73D-C3B5-4C42-869E-7B2F17D354AC}</Project>
<Name>Xamarin.Forms.Core</Name>
</ProjectReference>
<ProjectReference Include="..\Xamarin.Forms.CustomAttributes\Xamarin.Forms.CustomAttributes.csproj">
<ProjectReference Include="..\..\..\Forms\test\Xamarin.Forms.CustomAttributes\Xamarin.Forms.CustomAttributes.csproj">
<Project>{4DCD0420-1168-4B77-86DB-6196EE4BD491}</Project>
<Name>Xamarin.Forms.CustomAttributes</Name>
</ProjectReference>
<ProjectReference Include="..\Xamarin.Forms.Maps\Xamarin.Forms.Maps.csproj">
<ProjectReference Include="..\..\..\Controls\Maps\src\Xamarin.Forms.Maps\Xamarin.Forms.Maps.csproj">
<Project>{7724ac21-0b03-4bb0-b125-d26ccf84b3f9}</Project>
<Name>Xamarin.Forms.Maps</Name>
</ProjectReference>
<ProjectReference Include="..\Xamarin.Forms.Platform\Xamarin.Forms.Platform.csproj">
<Project>{D31A6537-ED9C-4EBD-B231-A8D4FE44126A}</Project>
<Name>Xamarin.Forms.Platform</Name>
</ProjectReference>
<ProjectReference Include="..\Xamarin.Forms.Xaml\Xamarin.Forms.Xaml.csproj">
<ProjectReference Include="..\..\..\Forms\src\Xamarin.Forms.Xaml\Xamarin.Forms.Xaml.csproj">
<Project>{9DB2F292-8034-4E06-89AD-98BBDA4306B9}</Project>
<Name>Xamarin.Forms.Xaml</Name>
</ProjectReference>
@ -86,8 +82,8 @@
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="..\Xamarin.Forms.Controls.Issues.Shared\Xamarin.Forms.Controls.Issues.Shared.projitems" Label="Shared" />
<Import Project="..\Xamarin.Forms.Core.UITests.Shared\Xamarin.Forms.Core.UITests.projitems" Label="Shared" />
<Import Project="..\..\src\Xamarin.Forms.Controls.Issues.Shared\Xamarin.Forms.Controls.Issues.Shared.projitems" Label="Shared" />
<Import Project="..\..\src\Xamarin.Forms.Core.UITests.Shared\Xamarin.Forms.Core.UITests.projitems" Label="Shared" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="_CopyXamarinUITestFiles" AfterTargets="Build">
<ItemGroup>

Просмотреть файл

@ -58,19 +58,23 @@
<Compile Include="BaseViewContainerRemoteiOS.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Xamarin.Forms.Core\Xamarin.Forms.Core.csproj">
<ProjectReference Include="..\..\..\Controls\Maps\src\Xamarin.Forms.Maps\Xamarin.Forms.Maps.csproj">
<Project>{f137fac5-3385-4b19-988b-4a14ed84ccc6}</Project>
<Name>Xamarin.Forms.Maps</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Forms\src\Xamarin.Forms.Core\Xamarin.Forms.Core.csproj">
<Project>{57B8B73D-C3B5-4C42-869E-7B2F17D354AC}</Project>
<Name>Xamarin.Forms.Core</Name>
</ProjectReference>
<ProjectReference Include="..\Xamarin.Forms.CustomAttributes\Xamarin.Forms.CustomAttributes.csproj">
<Project>{4DCD0420-1168-4B77-86DB-6196EE4BD491}</Project>
<ProjectReference Include="..\..\..\Forms\test\Xamarin.Forms.CustomAttributes\Xamarin.Forms.CustomAttributes.csproj">
<Project>{2964f669-7cd9-4d78-b4d9-804a965d58c0}</Project>
<Name>Xamarin.Forms.CustomAttributes</Name>
</ProjectReference>
<ProjectReference Include="..\Xamarin.Forms.Platform\Xamarin.Forms.Platform.csproj">
<Project>{D31A6537-ED9C-4EBD-B231-A8D4FE44126A}</Project>
<Name>Xamarin.Forms.Platform</Name>
<ProjectReference Include="..\..\..\Platform.Handlers\src\Xamarin.Platform.Handlers\Xamarin.Platform.Handlers.csproj">
<Project>{29913989-0f70-48d8-8ede-b1dd217f21d1}</Project>
<Name>Xamarin.Platform.Handlers</Name>
</ProjectReference>
<ProjectReference Include="..\Xamarin.Forms.ControlGallery.iOS\Xamarin.Forms.ControlGallery.iOS.csproj">
<ProjectReference Include="..\..\src\Xamarin.Forms.ControlGallery.iOS\Xamarin.Forms.ControlGallery.iOS.csproj">
<Project>{C7131F14-274F-4B55-ACA9-E81731AD012F}</Project>
<Name>Xamarin.Forms.ControlGallery.iOS</Name>
<ReferenceOutputAssembly>False</ReferenceOutputAssembly>
@ -80,8 +84,8 @@
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="..\Xamarin.Forms.Controls.Issues.Shared\Xamarin.Forms.Controls.Issues.Shared.projitems" Label="Shared" />
<Import Project="..\Xamarin.Forms.Core.UITests.Shared\Xamarin.Forms.Core.UITests.projitems" Label="Shared" />
<Import Project="..\..\src\Xamarin.Forms.Controls.Issues.Shared\Xamarin.Forms.Controls.Issues.Shared.projitems" Label="Shared" />
<Import Project="..\..\src\Xamarin.Forms.Core.UITests.Shared\Xamarin.Forms.Core.UITests.projitems" Label="Shared" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="AfterBuild">
<Delete Files="bin/$(Configuration)/System.Net.Http.dll" />
@ -92,4 +96,4 @@
</ItemGroup>
<Copy SourceFiles="@(_XamarinUITestFiles)" DestinationFolder="$(SolutionDir)packages\Xamarin.UITest.AnyVersion\%(RecursiveDir)" ContinueOnError="true" Retries="0" />
</Target>
</Project>
</Project>