Skip to content

Commit

Permalink
[build] fix missing darc-pub-dotnet-android-* feed for MAUI (#9468)
Browse files Browse the repository at this point in the history
Our MAUI integration lane currently fails with:

    Workload installation failed: Version 34.0.145 of package microsoft.android.sdk.windows is not found in NuGet feeds...

They are missing the `darc-pub-dotnet-android-df9aaf2-1` feed
containing our .NET 8 package on the dotnet/maui/net9.0 branch.

To fix this, let's read our `NuGet.config` and add any sources that
start with `darc-pub-dotnet-android-*` into their `NuGet.config`.
  • Loading branch information
jonathanpeppers authored Oct 30, 2024
1 parent 1417776 commit ea6734f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions build-tools/scripts/DotNet.targets
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,26 @@
XmlInputPath="$(MauiSourcePath)\src\DotNet\Dependencies\Workloads.csproj"
Value="Microsoft.NET.Sdk.Android.Manifest-$(DotNetSdkManifestsFolder)"
Query="/Project/ItemGroup/PackageDownload[contains(@Include,'Microsoft.NET.Sdk.Android.Manifest-')]/@Include" />
<XmlPeek
XmlInputPath="$(_Root)NuGet.config"
Query="/configuration/packageSources/add[starts-with(@key,'darc-pub-dotnet-android-')]">
<Output TaskParameter="Result" ItemName="_DotNetAndroidFeeds" />
</XmlPeek>
<XmlPeek
Condition=" '@(_DotNetAndroidFeeds->Count())' != '0' "
XmlInputPath="$(MauiSourcePath)\NuGet.config"
Query="/configuration/packageSources/*">
<Output TaskParameter="Result" ItemName="_DotNetMauiFeeds" />
</XmlPeek>
<ItemGroup>
<_DotNetMauiFeeds Include="@(_DotNetAndroidFeeds)" />
</ItemGroup>
<XmlPoke
Condition=" '@(_DotNetAndroidFeeds->Count())' != '0' "
XmlInputPath="$(MauiSourcePath)\NuGet.config"
Value="@(_DotNetMauiFeeds, ' ')"
Query="/configuration/packageSources"
/>
</Target>

<Target Name="InstallMaui">
Expand Down

0 comments on commit ea6734f

Please sign in to comment.