Skip to content

Commit 7e3bd2f

Browse files
Revert "[build] Enable NuGet's Central Package Management (#1114)" (#1138)
Context: dotnet/android#8279 This reverts commit 8c9eece. Near the end of .NET 8 RC 1, the .NET 8 SDK depends on nightly packages for .NET 6 and .NET 7: * dotnet/runtime 7.0.11 * dotnet/runtime 6.0.22 These come from feeds within `NuGet.config` such as: <packageSources> <clear/> <!-- Added manually for dotnet/runtime 7.0.11 --> <add key="darc-pub-dotnet-runtime-a2ad4f0" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-a2ad4f03/nuget/v3/index.json" /> <!-- Added manually for dotnet/runtime 6.0.22 --> <add key="darc-pub-dotnet-runtime-762f437" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-762f4379/nuget/v3/index.json" /> </packageSources> The version number is stable, so the .NET releng team has infrastructure to create a new feed per git commit. Unfortunately, this makes NuGet central package management unusable for us. 😢 As seen in dotnet/android#8279, we get errors like: Package source mapping matches found for package ID 'Microsoft.NETCore.App.Ref' are: 'dotnet-public'. … external\Java.Interop\src\Java.Interop.Tools.Expressions\Java.Interop.Tools.Expressions.csproj error NU1102: Unable to find package Microsoft.NETCore.App.Ref with version (= 7.0.11) - Found 83 version(s) in dotnet-public [ Nearest version: 8.0.0-preview.1.23110.8 ] - Versions from dotnet-eng were not considered [Xamarin.Android.sln] This is because it can only possibly resolve this package from `dotnet-public`: <packageSourceMapping> <packageSource key="dotnet-public"> <package pattern="*" /> </packageSource> </packageSourceMapping> Because 7.0.11 hasn't shipped yet, it is on neither NuGet.org nor `dotnet-public`. For this to work, we would somehow need this `NuGet.config` fragment to be added to the xamarin/java.interop repo whenever xamarin/xamarin-android gets a newer .NET 8 SDK: <packageSourceMapping> <packageSource key="darc-pub-dotnet-runtime-[HASH]"> <package pattern="Microsoft.NETCore.App.Ref" /> </packageSource> </packageSourceMapping> For now, let's revert 8c9eece. Maybe there is some solution we can come up with to use this in the future.
1 parent 7961b36 commit 7e3bd2f

File tree

6 files changed

+26
-49
lines changed

6 files changed

+26
-49
lines changed

Directory.Build.props

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
<DisableTransitiveFrameworkReferenceDownloads>true</DisableTransitiveFrameworkReferenceDownloads>
1212
<DotNetTargetFrameworkVersion>7.0</DotNetTargetFrameworkVersion>
1313
<DotNetTargetFramework>net$(DotNetTargetFrameworkVersion)</DotNetTargetFramework>
14-
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
1514
</PropertyGroup>
1615

1716
<Import

Directory.Build.targets

+21-3
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,36 @@
33

44
<!-- Add Roslyn analyzers NuGet to all projects -->
55
<ItemGroup Condition=" '$(DisableRoslynAnalyzers)' != 'True' ">
6-
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers">
6+
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.0">
77
<PrivateAssets>all</PrivateAssets>
88
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
99
</PackageReference>
1010
</ItemGroup>
1111

12-
<!-- Set Assets for NUnit3TestAdapter -->
12+
<!-- NuGet Dependencies -->
1313
<ItemGroup>
14-
<PackageReference Update="NUnit3TestAdapter">
14+
<PackageReference Update="GitInfo" Version="2.1.2" />
15+
<PackageReference Update="HtmlAgilityPack" Version="1.11.30" />
16+
<PackageReference Update="Irony" Version="1.1.0" />
17+
<PackageReference Update="Microsoft.Build.Framework" Version="17.3.2" />
18+
<PackageReference Update="Microsoft.Build.Utilities.Core" Version="17.3.2" />
19+
<PackageReference Update="Microsoft.CodeAnalysis.CSharp" Version="4.3.1" />
20+
<PackageReference Update="Microsoft.CSharp" Version="4.7.0" />
21+
<PackageReference Update="Microsoft.DotNet.GenAPI" Version="7.0.0-beta.22103.1" />
22+
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.5.0-preview-20221003-04" />
23+
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.1.1" />
24+
<PackageReference Update="Microsoft.Xml.SgmlReader" Version="1.8.16" />
25+
<PackageReference Update="Mono.CSharp" Version="4.0.0.143" />
26+
<PackageReference Update="Mono.Linq.Expressions" Version="2.0.0" />
27+
<PackageReference Update="Mono.Options" Version="6.12.0.148" />
28+
<PackageReference Update="Mono.Terminal" Version="5.4.2" />
29+
<PackageReference Update="nunit" Version="3.13.2" />
30+
<PackageReference Update="NUnit.ConsoleRunner" Version="3.12.0" />
31+
<PackageReference Update="NUnit3TestAdapter" Version="4.0.0">
1532
<PrivateAssets>all</PrivateAssets>
1633
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1734
</PackageReference>
35+
<PackageReference Update="protobuf-net" Version="2.4.4" />
1836
</ItemGroup>
1937

2038
<Import Project="build-tools\scripts\VersionInfo.targets" />

Directory.Packages.props

-31
This file was deleted.

NuGet.Config

-10
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,4 @@
1111
<!-- For Microsoft.DotNet.GenAPI -->
1212
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" protocolVersion="3" />
1313
</packageSources>
14-
15-
<packageSourceMapping>
16-
<!-- key value for <packageSource> should match key values from <packageSources> element -->
17-
<packageSource key="dotnet-public">
18-
<package pattern="*" />
19-
</packageSource>
20-
<packageSource key="dotnet-eng">
21-
<package pattern="Microsoft.DotNet.GenAPI" />
22-
</packageSource>
23-
</packageSourceMapping>
2414
</configuration>

build-tools/scripts/cecil.projitems

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<_XamarinAndroidCecilVersion Condition=" '$(_XamarinAndroidCecilVersion)' == '' ">0.11.4</_XamarinAndroidCecilVersion>
5+
</PropertyGroup>
36
<ItemGroup Condition=" '$(_XamarinAndroidCecilPath)' == '' ">
4-
<PackageReference Include="Mono.Cecil" />
7+
<PackageReference Include="Mono.Cecil" Version="$(_XamarinAndroidCecilVersion)" />
58
</ItemGroup>
69
<ItemGroup Condition=" '$(_XamarinAndroidCecilPath)' != '' ">
710
<Reference Include="$(_XamarinAndroidCecilPath)" />

tests/Java.Interop.Tools.Expressions-Tests/Java.Interop.Tools.Expressions-Tests.csproj

+1-3
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,9 @@
2020
<PackageReference Include="NUnit3TestAdapter" />
2121
</ItemGroup>
2222

23-
<!--
2423
<Import Project="..\..\build-tools\scripts\cecil.projitems" />
25-
-->
24+
2625
<ItemGroup>
27-
<PackageReference Include="Mono.Cecil" />
2826
<PackageReference Include="Mono.Linq.Expressions" />
2927
</ItemGroup>
3028

0 commit comments

Comments
 (0)