From e8f23262400d291f51b17b3681f7e1aa45136fac Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Wed, 26 Jul 2023 18:10:46 -0400 Subject: [PATCH] [ci] Fix MAUI integration test job The new MAUI build and test job has been failing: C:\a\_work\2\s\maui\src\DotNet\Dependencies\Workloads.csproj : error NU1102: Unable to find package Microsoft.NET.Sdk.Android.Manifest-8.0.100-preview.7 with version (= 34.0.0-ci.pr.gh8185.402) [C:\a\_work\2\s\maui\src\DotNet\DotNet.csproj] This is because our main branch has bumped from .NET 8 preview.7 builds to .NET 8 rc.1 builds. We can fix this by writing our SDK band to the Microsoft.NET.Sdk.Android.Manifest item in the workload restore project. --- build-tools/automation/azure-pipelines.yaml | 6 ++++++ build-tools/scripts/DotNet.targets | 15 +++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index 733e73cdc52..21faa74c4d3 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -352,6 +352,12 @@ stages: -androidVersion $(ANDROID_PACK_VERSION) displayName: Update MAUI's Android dependency + - task: DotNetCoreCLI@2 + displayName: Update Android SDK band in Workloads.csproj + inputs: + projects: $(Build.SourcesDirectory)/xamarin-android/Xamarin.Android.sln + arguments: -t:UpdateMauiWorkloadsProj -c $(XA.Build.Configuration) --no-restore -v:n -bl:$(Build.StagingDirectory)/logs/update-maui-workloadsproj.binlog + - pwsh: ./build.ps1 --target=dotnet --configuration="$(XA.Build.Configuration)" --nugetsource="$(Build.StagingDirectory)\android-packs" --verbosity=diagnostic displayName: Install .NET retryCountOnTaskFailure: 3 diff --git a/build-tools/scripts/DotNet.targets b/build-tools/scripts/DotNet.targets index ba9d8d5f7f1..e7fd3a84a1c 100644 --- a/build-tools/scripts/DotNet.targets +++ b/build-tools/scripts/DotNet.targets @@ -2,6 +2,10 @@ <_Root>$(MSBuildThisFileDirectory)..\..\ <_BinlogPathPrefix>$(_Root)bin/Build$(Configuration)/msbuild-$([System.DateTime]::Now.ToString("yyyyMMddTHHmmss")) + false + $(_Root)..\maui + $(MauiSourcePath)\artifacts + maui-android @@ -47,15 +51,18 @@ + + + + <_TempDirectory>$(DotNetPreviewPath)..\.xa-workload-temp-$([System.IO.Path]::GetRandomFileName()) $(DotNetSdkManifestsFolder) - false - $(XamarinAndroidSourcePath)..\maui - $(MauiSourcePath)\artifacts - maui-android