Skip to content

Commit fb4c442

Browse files
committed
[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.
1 parent 57eedfb commit fb4c442

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

build-tools/automation/azure-pipelines.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,12 @@ stages:
352352
-androidVersion $(ANDROID_PACK_VERSION)
353353
displayName: Update MAUI's Android dependency
354354
355+
- task: DotNetCoreCLI@2
356+
displayName: Update Android SDK band in Workloads.csproj
357+
inputs:
358+
projects: $(Build.SourcesDirectory)/xamarin-android/Xamarin.Android.sln
359+
arguments: -t:UpdateMauiWorkloadsProj -c $(XA.Build.Configuration) --no-restore -v:n -bl:$(Build.StagingDirectory)/logs/update-maui-workloadsproj.binlog
360+
355361
- pwsh: ./build.ps1 --target=dotnet --configuration="$(XA.Build.Configuration)" --nugetsource="$(Build.StagingDirectory)\android-packs" --verbosity=diagnostic
356362
displayName: Install .NET
357363
retryCountOnTaskFailure: 3

build-tools/scripts/DotNet.targets

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
<PropertyGroup>
33
<_Root>$(MSBuildThisFileDirectory)..\..\</_Root>
44
<_BinlogPathPrefix>$(_Root)bin/Build$(Configuration)/msbuild-$([System.DateTime]::Now.ToString("yyyyMMddTHHmmss"))</_BinlogPathPrefix>
5+
<_TempDirectory>$(DotNetPreviewPath)..\.xa-workload-temp-$([System.IO.Path]::GetRandomFileName())</_TempDirectory>
6+
<MauiVersionBand Condition=" '$(MauiVersionBand)' == '' ">$(DotNetSdkManifestsFolder)</MauiVersionBand>
7+
<MauiUseLocalPacks Condition=" '$(MauiUseLocalPacks)' == '' ">false</MauiUseLocalPacks>
8+
<MauiSourcePath Condition=" '$(MauiSourcePath)' == '' ">$(XamarinAndroidSourcePath)..\maui</MauiSourcePath>
9+
<MauiPackagePath Condition=" '$(MauiPackagePath)' == '' ">$(MauiSourcePath)\artifacts</MauiPackagePath>
10+
<MauiWorkloadToInstall Condition=" '$(MauiWorkloadToInstall)' == '' ">maui-android</MauiWorkloadToInstall>
511
</PropertyGroup>
612

713
<Target Name="BuildExternal">
@@ -47,16 +53,16 @@
4753
<RemoveDir Directories="@(_DirectoriesToRemove)" />
4854
</Target>
4955

56+
<Target Name="UpdateMauiWorkloadsProj">
57+
<XmlPoke
58+
XmlInputPath="$(MauiSourcePath)\src\DotNet\Dependencies\Workloads.csproj"
59+
Value="Microsoft.NET.Sdk.Android.Manifest-$(DotNetSdkManifestsFolder)"
60+
Query="/Project/ItemGroup/PackageDownload[contains(@Include,'Microsoft.NET.Sdk.Android.Manifest-')]/@Include" />
61+
</Target>
62+
5063
<Target Name="InstallMaui">
5164
<Error Text="%24(MauiVersion) must be specified." Condition=" '$(MauiVersion)' == '' and '$(MauiUseLocalPacks)' != 'true' " />
52-
<PropertyGroup>
53-
<_TempDirectory>$(DotNetPreviewPath)..\.xa-workload-temp-$([System.IO.Path]::GetRandomFileName())</_TempDirectory>
54-
<MauiVersionBand Condition=" '$(MauiVersionBand)' == '' ">$(DotNetSdkManifestsFolder)</MauiVersionBand>
55-
<MauiUseLocalPacks Condition=" '$(MauiUseLocalPacks)' == '' ">false</MauiUseLocalPacks>
56-
<MauiSourcePath Condition=" '$(MauiSourcePath)' == '' ">$(XamarinAndroidSourcePath)..\maui</MauiSourcePath>
57-
<MauiPackagePath Condition=" '$(MauiPackagePath)' == '' ">$(MauiSourcePath)\artifacts</MauiPackagePath>
58-
<MauiWorkloadToInstall Condition=" '$(MauiWorkloadToInstall)' == '' ">maui-android</MauiWorkloadToInstall>
59-
</PropertyGroup>
65+
6066
<MakeDir Directories="$(_TempDirectory)" />
6167

6268
<!-- Restore or extract WorkloadManifest.* files-->

0 commit comments

Comments
 (0)