From d74a03a0b79e215bbb15b18b17740e47d200a4b7 Mon Sep 17 00:00:00 2001 From: Rui Marinho Date: Wed, 17 Mar 2021 18:59:35 +0000 Subject: [PATCH] Try build ControlGallery Android on CI (#525) * Try build ControlGallery Try build android controlgallery new path Fix Fix android uitests reference Don't build iOS for now * - only set content description for UI Test build * Add Environment.Build.props back * Update boots version * Fix LinkDescription.xml Co-authored-by: Shane Neuville --- build.cake | 2 +- eng/ControlGallery.Build.props | 5 ----- .../common/controlgallery-android.yml | 12 +++++------ eng/pipelines/handlers.yml | 21 +++++++++++++++++++ ...ompatibility.ControlGallery.Android.csproj | 3 +-- .../src/Android/FormsAppCompatActivity.cs | 2 ++ .../src/Android/LinkDescription.xml | 15 ++++++------- .../Compatibility.ControlGallery.iOS.csproj | 1 - 8 files changed, 39 insertions(+), 22 deletions(-) delete mode 100644 eng/ControlGallery.Build.props diff --git a/build.cake b/build.cake index 8f2913dcd..836f5d246 100644 --- a/build.cake +++ b/build.cake @@ -19,7 +19,7 @@ PowerShell: // ADDINS ////////////////////////////////////////////////////////////////////// #addin "nuget:?package=Cake.Android.SdkManager&version=3.0.2" -#addin "nuget:?package=Cake.Boots&version=1.0.3.556" +#addin "nuget:?package=Cake.Boots&version=1.0.4.600-preview1" #addin "nuget:?package=Cake.AppleSimulator&version=0.2.0" #addin "nuget:?package=Cake.FileHelpers&version=3.2.1" diff --git a/eng/ControlGallery.Build.props b/eng/ControlGallery.Build.props deleted file mode 100644 index 6476928b5..000000000 --- a/eng/ControlGallery.Build.props +++ /dev/null @@ -1,5 +0,0 @@ - - - 8.0 - - diff --git a/eng/pipelines/common/controlgallery-android.yml b/eng/pipelines/common/controlgallery-android.yml index c632a2051..810563cda 100644 --- a/eng/pipelines/common/controlgallery-android.yml +++ b/eng/pipelines/common/controlgallery-android.yml @@ -45,11 +45,11 @@ steps: 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.* + **/Android.UITests/bin/$(BuildConfiguration)/Newtonsoft.Json.* + **/Android.UITests/bin/$(BuildConfiguration)/nunit.* + **/Android.UITests/bin/$(BuildConfiguration)/NUnit3.* + **/Android.UITests/bin/$(BuildConfiguration)/Plugin.* + **/Android.UITests/bin/$(BuildConfiguration)/Xamarin.* TargetFolder: '$(build.artifactstagingdirectory)/android' CleanTargetFolder: true flattenFolders: true @@ -57,7 +57,7 @@ steps: - task: CopyFiles@2 displayName: 'Copy $(renderers)' inputs: - SourceFolder: src/ControlGallery/src/Xamarin.Forms.ControlGallery.Android/bin/$(BuildConfiguration)/ + SourceFolder: src/Compatibility/ControlGallery/src/Android/bin/$(BuildConfiguration)/ Contents: '**/*.apk' TargetFolder: '$(build.artifactstagingdirectory)/androidApp' CleanTargetFolder: true diff --git a/eng/pipelines/handlers.yml b/eng/pipelines/handlers.yml index d096eff65..dc2af23b9 100644 --- a/eng/pipelines/handlers.yml +++ b/eng/pipelines/handlers.yml @@ -150,6 +150,27 @@ stages: 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 + - stage: pack_net6 displayName: Pack .NET 6 dependsOn: [] diff --git a/src/Compatibility/ControlGallery/src/Android/Compatibility.ControlGallery.Android.csproj b/src/Compatibility/ControlGallery/src/Android/Compatibility.ControlGallery.Android.csproj index 078de0a3a..79c339414 100644 --- a/src/Compatibility/ControlGallery/src/Android/Compatibility.ControlGallery.Android.csproj +++ b/src/Compatibility/ControlGallery/src/Android/Compatibility.ControlGallery.Android.csproj @@ -1,6 +1,5 @@  - Debug @@ -33,7 +32,7 @@ $(DefineConstants);LEGACY_RENDERERS - $(DefineConstants);HAVE_OPENTK + $(DefineConstants);HAVE_OPENTK;ENABLE_TEST_CLOUD True $(MSBuildThisFileDirectory)../../../../../eng/debug.keystore android diff --git a/src/Compatibility/ControlGallery/src/Android/FormsAppCompatActivity.cs b/src/Compatibility/ControlGallery/src/Android/FormsAppCompatActivity.cs index 24d589f48..fadcb4083 100644 --- a/src/Compatibility/ControlGallery/src/Android/FormsAppCompatActivity.cs +++ b/src/Compatibility/ControlGallery/src/Android/FormsAppCompatActivity.cs @@ -55,12 +55,14 @@ namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.Android Microsoft.Maui.Controls.Compatibility.Forms.Init(this, bundle); FormsMaps.Init(this, bundle); +#if ENABLE_TEST_CLOUD Handlers.ViewHandler .ViewMapper[nameof(IView.AutomationId)] = (h, v) => { (h.NativeView as global::Android.Views.View).ContentDescription = v.AutomationId; }; +#endif //FormsMaterial.Init(this, bundle); AndroidAppLinks.Init(this); diff --git a/src/Compatibility/ControlGallery/src/Android/LinkDescription.xml b/src/Compatibility/ControlGallery/src/Android/LinkDescription.xml index c0bec7d68..c1e55c2c6 100644 --- a/src/Compatibility/ControlGallery/src/Android/LinkDescription.xml +++ b/src/Compatibility/ControlGallery/src/Android/LinkDescription.xml @@ -1,12 +1,13 @@  - - - + + + - - + + + @@ -14,6 +15,6 @@ - - + + diff --git a/src/Compatibility/ControlGallery/src/iOS/Compatibility.ControlGallery.iOS.csproj b/src/Compatibility/ControlGallery/src/iOS/Compatibility.ControlGallery.iOS.csproj index 9d2701b03..7fc629807 100644 --- a/src/Compatibility/ControlGallery/src/iOS/Compatibility.ControlGallery.iOS.csproj +++ b/src/Compatibility/ControlGallery/src/iOS/Compatibility.ControlGallery.iOS.csproj @@ -1,6 +1,5 @@  - Debug