Revert "[build] Enable NuGet's Central Package Management (#1114)" (#1138)

Context: https://github.com/xamarin/xamarin-android/pull/8279

This reverts commit 8c9eece2b3.

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 xamarin/xamarin-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 8c9eece2.  Maybe there is some solution we can
come up with to use this in the future.
This commit is contained in:
Jonathan Peppers 2023-08-23 13:42:58 -05:00 коммит произвёл GitHub
Родитель 7961b360a1
Коммит 7e3bd2f2e2
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
6 изменённых файлов: 26 добавлений и 49 удалений

Просмотреть файл

@ -11,7 +11,6 @@
<DisableTransitiveFrameworkReferenceDownloads>true</DisableTransitiveFrameworkReferenceDownloads>
<DotNetTargetFrameworkVersion>7.0</DotNetTargetFrameworkVersion>
<DotNetTargetFramework>net$(DotNetTargetFrameworkVersion)</DotNetTargetFramework>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<Import

Просмотреть файл

@ -3,18 +3,36 @@
<!-- Add Roslyn analyzers NuGet to all projects -->
<ItemGroup Condition=" '$(DisableRoslynAnalyzers)' != 'True' ">
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers">
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<!-- Set Assets for NUnit3TestAdapter -->
<!-- NuGet Dependencies -->
<ItemGroup>
<PackageReference Update="NUnit3TestAdapter">
<PackageReference Update="GitInfo" Version="2.1.2" />
<PackageReference Update="HtmlAgilityPack" Version="1.11.30" />
<PackageReference Update="Irony" Version="1.1.0" />
<PackageReference Update="Microsoft.Build.Framework" Version="17.3.2" />
<PackageReference Update="Microsoft.Build.Utilities.Core" Version="17.3.2" />
<PackageReference Update="Microsoft.CodeAnalysis.CSharp" Version="4.3.1" />
<PackageReference Update="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Update="Microsoft.DotNet.GenAPI" Version="7.0.0-beta.22103.1" />
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.5.0-preview-20221003-04" />
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.1.1" />
<PackageReference Update="Microsoft.Xml.SgmlReader" Version="1.8.16" />
<PackageReference Update="Mono.CSharp" Version="4.0.0.143" />
<PackageReference Update="Mono.Linq.Expressions" Version="2.0.0" />
<PackageReference Update="Mono.Options" Version="6.12.0.148" />
<PackageReference Update="Mono.Terminal" Version="5.4.2" />
<PackageReference Update="nunit" Version="3.13.2" />
<PackageReference Update="NUnit.ConsoleRunner" Version="3.12.0" />
<PackageReference Update="NUnit3TestAdapter" Version="4.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="protobuf-net" Version="2.4.4" />
</ItemGroup>
<Import Project="build-tools\scripts\VersionInfo.targets" />

Просмотреть файл

@ -1,31 +0,0 @@
<Project>
<PropertyGroup>
<_XamarinAndroidCecilVersion Condition=" '$(_XamarinAndroidCecilVersion)' == '' ">0.11.4</_XamarinAndroidCecilVersion>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="GitInfo" Version="2.1.2" />
<PackageVersion Include="HtmlAgilityPack" Version="1.11.30" />
<PackageVersion Include="Irony" Version="1.1.0" />
<PackageVersion Include="Microsoft.Build.Framework" Version="17.3.2" />
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="17.3.2" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.3.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.0" />
<PackageVersion Include="Microsoft.CSharp" Version="4.7.0" />
<PackageVersion Include="Microsoft.DotNet.GenAPI" Version="7.0.0-beta.22103.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.5.0-preview-20221003-04" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
<PackageVersion Include="Microsoft.Xml.SgmlReader" Version="1.8.16" />
<PackageVersion Include="Mono.Cecil" Version="$(_XamarinAndroidCecilVersion)" />
<PackageVersion Include="Mono.CSharp" Version="4.0.0.143" />
<PackageVersion Include="Mono.Linq.Expressions" Version="2.0.0" />
<PackageVersion Include="Mono.Options" Version="6.12.0.148" />
<PackageVersion Include="Mono.Terminal" Version="5.4.2" />
<PackageVersion Include="nunit" Version="3.13.2" />
<PackageVersion Include="NUnit.ConsoleRunner" Version="3.12.0" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.0.0" />
<PackageVersion Include="protobuf-net" Version="2.4.4" />
</ItemGroup>
</Project>

Просмотреть файл

@ -11,14 +11,4 @@
<!-- For Microsoft.DotNet.GenAPI -->
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" protocolVersion="3" />
</packageSources>
<packageSourceMapping>
<!-- key value for <packageSource> should match key values from <packageSources> element -->
<packageSource key="dotnet-public">
<package pattern="*" />
</packageSource>
<packageSource key="dotnet-eng">
<package pattern="Microsoft.DotNet.GenAPI" />
</packageSource>
</packageSourceMapping>
</configuration>

Просмотреть файл

@ -1,7 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<_XamarinAndroidCecilVersion Condition=" '$(_XamarinAndroidCecilVersion)' == '' ">0.11.4</_XamarinAndroidCecilVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(_XamarinAndroidCecilPath)' == '' ">
<PackageReference Include="Mono.Cecil" />
<PackageReference Include="Mono.Cecil" Version="$(_XamarinAndroidCecilVersion)" />
</ItemGroup>
<ItemGroup Condition=" '$(_XamarinAndroidCecilPath)' != '' ">
<Reference Include="$(_XamarinAndroidCecilPath)" />

Просмотреть файл

@ -20,11 +20,9 @@
<PackageReference Include="NUnit3TestAdapter" />
</ItemGroup>
<!--
<Import Project="..\..\build-tools\scripts\cecil.projitems" />
-->
<ItemGroup>
<PackageReference Include="Mono.Cecil" />
<PackageReference Include="Mono.Linq.Expressions" />
</ItemGroup>