diff --git a/Xamarin.Forms.ControlGallery.sln b/Xamarin.Forms.ControlGallery.sln index 535390cf4..641ffc2c5 100644 --- a/Xamarin.Forms.ControlGallery.sln +++ b/Xamarin.Forms.ControlGallery.sln @@ -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} diff --git a/build.cake b/build.cake index 9dbd85eb6..420947ba9 100644 --- a/build.cake +++ b/build.cake @@ -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 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) diff --git a/eng/pipelines/common/controlgallery-android.yml b/eng/pipelines/common/controlgallery-android.yml new file mode 100644 index 000000000..cb582cb97 --- /dev/null +++ b/eng/pipelines/common/controlgallery-android.yml @@ -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 \ No newline at end of file diff --git a/eng/pipelines/common/controlgallery-ios.yml b/eng/pipelines/common/controlgallery-ios.yml new file mode 100644 index 000000000..b1c36dcbd --- /dev/null +++ b/eng/pipelines/common/controlgallery-ios.yml @@ -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 diff --git a/eng/pipelines/common/variables.yml b/eng/pipelines/common/variables.yml index 0222b78af..96e3570ff 100644 --- a/eng/pipelines/common/variables.yml +++ b/eng/pipelines/common/variables.yml @@ -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 \ No newline at end of file + value: 5.0.102 \ No newline at end of file diff --git a/eng/pipelines/handlers.yml b/eng/pipelines/handlers.yml index 56e488298..190a2316d 100644 --- a/eng/pipelines/handlers.yml +++ b/eng/pipelines/handlers.yml @@ -77,4 +77,47 @@ stages: steps: - template: common/build-windows.yml parameters: - provisionatorPath : '/build/provisioning/provisioning.csx' \ No newline at end of file + 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 \ No newline at end of file diff --git a/eng/pipelines/steps/build-android.yml b/eng/pipelines/steps/build-android.yml index 0d3202f48..3bd2d4774 100644 --- a/eng/pipelines/steps/build-android.yml +++ b/eng/pipelines/steps/build-android.yml @@ -128,4 +128,4 @@ jobs: condition: always() inputs: PathtoPublish: '$(build.artifactstagingdirectory)' - ArtifactName: OSXArtifacts + ArtifactName: OSXArtifacts \ No newline at end of file diff --git a/eng/pipelines/steps/build-osx.yml b/eng/pipelines/steps/build-osx.yml index 766f01150..175fa1358 100644 --- a/eng/pipelines/steps/build-osx.yml +++ b/eng/pipelines/steps/build-osx.yml @@ -163,4 +163,4 @@ steps: condition: always() inputs: PathtoPublish: '$(build.artifactstagingdirectory)' - ArtifactName: OSXArtifacts + ArtifactName: OSXArtifacts \ No newline at end of file diff --git a/src/ControlGallery/src/Xamarin.Forms.ControlGallery.Android/FormsAppCompatActivity.cs b/src/ControlGallery/src/Xamarin.Forms.ControlGallery.Android/FormsAppCompatActivity.cs index a438c803c..8232dd33f 100644 --- a/src/ControlGallery/src/Xamarin.Forms.ControlGallery.Android/FormsAppCompatActivity.cs +++ b/src/ControlGallery/src/Xamarin.Forms.ControlGallery.Android/FormsAppCompatActivity.cs @@ -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 }, diff --git a/src/ControlGallery/src/Xamarin.Forms.ControlGallery.Android/Properties/AndroidManifest.xml b/src/ControlGallery/src/Xamarin.Forms.ControlGallery.Android/Properties/AndroidManifest.xml index 37a740a4e..5b1fb24c7 100644 --- a/src/ControlGallery/src/Xamarin.Forms.ControlGallery.Android/Properties/AndroidManifest.xml +++ b/src/ControlGallery/src/Xamarin.Forms.ControlGallery.Android/Properties/AndroidManifest.xml @@ -1,5 +1,5 @@  - + @@ -16,7 +16,7 @@ - + diff --git a/src/ControlGallery/src/Xamarin.Forms.ControlGallery.Android/Xamarin.Forms.ControlGallery.Android.csproj b/src/ControlGallery/src/Xamarin.Forms.ControlGallery.Android/Xamarin.Forms.ControlGallery.Android.csproj index 4ab4b375b..d578d56f4 100644 --- a/src/ControlGallery/src/Xamarin.Forms.ControlGallery.Android/Xamarin.Forms.ControlGallery.Android.csproj +++ b/src/ControlGallery/src/Xamarin.Forms.ControlGallery.Android/Xamarin.Forms.ControlGallery.Android.csproj @@ -37,7 +37,7 @@ $(DefineConstants);HAVE_OPENTK True - $(SolutionDir)eng/debug.keystore + $(SolutionDir)../../../eng/debug.keystore android androiddebugkey android diff --git a/src/ControlGallery/src/Xamarin.Forms.ControlGallery.iOS/Info.plist b/src/ControlGallery/src/Xamarin.Forms.ControlGallery.iOS/Info.plist index c80497ed2..4160d0d4f 100644 --- a/src/ControlGallery/src/Xamarin.Forms.ControlGallery.iOS/Info.plist +++ b/src/ControlGallery/src/Xamarin.Forms.ControlGallery.iOS/Info.plist @@ -24,9 +24,9 @@ MinimumOSVersion 8.0 CFBundleDisplayName - XamControl + Xamarin Forms CFBundleIdentifier - com.xamarin.quickui.controlgallery + com.xamarin.xamarin-forms-controlgallery CFBundleVersion 1.0 CFBundleIconFiles diff --git a/src/ControlGallery/src/Xamarin.Forms.Controls.Issues.Shared/TestPages/TestPages.cs b/src/ControlGallery/src/Xamarin.Forms.Controls.Issues.Shared/TestPages/TestPages.cs index 40fda0c2a..bc9ef8bf8 100644 --- a/src/ControlGallery/src/Xamarin.Forms.Controls.Issues.Shared/TestPages/TestPages.cs +++ b/src/ControlGallery/src/Xamarin.Forms.Controls.Issues.Shared/TestPages/TestPages.cs @@ -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 diff --git a/src/ControlGallery/test/Xamarin.Forms.Core.Android.UITests/Xamarin.Forms.Core.Android.UITests.csproj b/src/ControlGallery/test/Xamarin.Forms.Core.Android.UITests/Xamarin.Forms.Core.Android.UITests.csproj index 77bbe3e71..03267615a 100644 --- a/src/ControlGallery/test/Xamarin.Forms.Core.Android.UITests/Xamarin.Forms.Core.Android.UITests.csproj +++ b/src/ControlGallery/test/Xamarin.Forms.Core.Android.UITests/Xamarin.Forms.Core.Android.UITests.csproj @@ -58,27 +58,23 @@ - + {e2403480-7079-4e09-9c21-113b615a2a0a} Xamarin.Platform.Handlers - + {57B8B73D-C3B5-4C42-869E-7B2F17D354AC} Xamarin.Forms.Core - + {4DCD0420-1168-4B77-86DB-6196EE4BD491} Xamarin.Forms.CustomAttributes - + {7724ac21-0b03-4bb0-b125-d26ccf84b3f9} Xamarin.Forms.Maps - - {D31A6537-ED9C-4EBD-B231-A8D4FE44126A} - Xamarin.Forms.Platform - - + {9DB2F292-8034-4E06-89AD-98BBDA4306B9} Xamarin.Forms.Xaml @@ -86,8 +82,8 @@ - - + + diff --git a/src/ControlGallery/test/Xamarin.Forms.Core.iOS.UITests/Xamarin.Forms.Core.iOS.UITests.csproj b/src/ControlGallery/test/Xamarin.Forms.Core.iOS.UITests/Xamarin.Forms.Core.iOS.UITests.csproj index 9a0c3619d..1165caa35 100644 --- a/src/ControlGallery/test/Xamarin.Forms.Core.iOS.UITests/Xamarin.Forms.Core.iOS.UITests.csproj +++ b/src/ControlGallery/test/Xamarin.Forms.Core.iOS.UITests/Xamarin.Forms.Core.iOS.UITests.csproj @@ -58,19 +58,23 @@ - + + {f137fac5-3385-4b19-988b-4a14ed84ccc6} + Xamarin.Forms.Maps + + {57B8B73D-C3B5-4C42-869E-7B2F17D354AC} Xamarin.Forms.Core - - {4DCD0420-1168-4B77-86DB-6196EE4BD491} + + {2964f669-7cd9-4d78-b4d9-804a965d58c0} Xamarin.Forms.CustomAttributes - - {D31A6537-ED9C-4EBD-B231-A8D4FE44126A} - Xamarin.Forms.Platform + + {29913989-0f70-48d8-8ede-b1dd217f21d1} + Xamarin.Platform.Handlers - + {C7131F14-274F-4B55-ACA9-E81731AD012F} Xamarin.Forms.ControlGallery.iOS False @@ -80,8 +84,8 @@ - - + + @@ -92,4 +96,4 @@ - + \ No newline at end of file