Skip to content

Commit e8f2326

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 e8f2326

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
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: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
<PropertyGroup>
33
<_Root>$(MSBuildThisFileDirectory)..\..\</_Root>
44
<_BinlogPathPrefix>$(_Root)bin/Build$(Configuration)/msbuild-$([System.DateTime]::Now.ToString("yyyyMMddTHHmmss"))</_BinlogPathPrefix>
5+
<MauiUseLocalPacks Condition=" '$(MauiUseLocalPacks)' == '' ">false</MauiUseLocalPacks>
6+
<MauiSourcePath Condition=" '$(MauiSourcePath)' == '' ">$(_Root)..\maui</MauiSourcePath>
7+
<MauiPackagePath Condition=" '$(MauiPackagePath)' == '' ">$(MauiSourcePath)\artifacts</MauiPackagePath>
8+
<MauiWorkloadToInstall Condition=" '$(MauiWorkloadToInstall)' == '' ">maui-android</MauiWorkloadToInstall>
59
</PropertyGroup>
610

711
<Target Name="BuildExternal">
@@ -47,15 +51,18 @@
4751
<RemoveDir Directories="@(_DirectoriesToRemove)" />
4852
</Target>
4953

54+
<Target Name="UpdateMauiWorkloadsProj">
55+
<XmlPoke
56+
XmlInputPath="$(MauiSourcePath)\src\DotNet\Dependencies\Workloads.csproj"
57+
Value="Microsoft.NET.Sdk.Android.Manifest-$(DotNetSdkManifestsFolder)"
58+
Query="/Project/ItemGroup/PackageDownload[contains(@Include,'Microsoft.NET.Sdk.Android.Manifest-')]/@Include" />
59+
</Target>
60+
5061
<Target Name="InstallMaui">
5162
<Error Text="%24(MauiVersion) must be specified." Condition=" '$(MauiVersion)' == '' and '$(MauiUseLocalPacks)' != 'true' " />
5263
<PropertyGroup>
5364
<_TempDirectory>$(DotNetPreviewPath)..\.xa-workload-temp-$([System.IO.Path]::GetRandomFileName())</_TempDirectory>
5465
<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>
5966
</PropertyGroup>
6067
<MakeDir Directories="$(_TempDirectory)" />
6168

0 commit comments

Comments
 (0)