Skip to content

Commit ea6734f

Browse files
[build] fix missing darc-pub-dotnet-android-* feed for MAUI (#9468)
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`.
1 parent 1417776 commit ea6734f

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

build-tools/scripts/DotNet.targets

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,26 @@
5656
XmlInputPath="$(MauiSourcePath)\src\DotNet\Dependencies\Workloads.csproj"
5757
Value="Microsoft.NET.Sdk.Android.Manifest-$(DotNetSdkManifestsFolder)"
5858
Query="/Project/ItemGroup/PackageDownload[contains(@Include,'Microsoft.NET.Sdk.Android.Manifest-')]/@Include" />
59+
<XmlPeek
60+
XmlInputPath="$(_Root)NuGet.config"
61+
Query="/configuration/packageSources/add[starts-with(@key,'darc-pub-dotnet-android-')]">
62+
<Output TaskParameter="Result" ItemName="_DotNetAndroidFeeds" />
63+
</XmlPeek>
64+
<XmlPeek
65+
Condition=" '@(_DotNetAndroidFeeds->Count())' != '0' "
66+
XmlInputPath="$(MauiSourcePath)\NuGet.config"
67+
Query="/configuration/packageSources/*">
68+
<Output TaskParameter="Result" ItemName="_DotNetMauiFeeds" />
69+
</XmlPeek>
70+
<ItemGroup>
71+
<_DotNetMauiFeeds Include="@(_DotNetAndroidFeeds)" />
72+
</ItemGroup>
73+
<XmlPoke
74+
Condition=" '@(_DotNetAndroidFeeds->Count())' != '0' "
75+
XmlInputPath="$(MauiSourcePath)\NuGet.config"
76+
Value="@(_DotNetMauiFeeds, ' ')"
77+
Query="/configuration/packageSources"
78+
/>
5979
</Target>
6080

6181
<Target Name="InstallMaui">

0 commit comments

Comments
 (0)