Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 42 additions & 58 deletions eng/Baseline.Designer.props

Large diffs are not rendered by default.

22 changes: 19 additions & 3 deletions eng/targets/ResolveReferences.targets
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,15 @@

<!-- Identify if any references were present in the last release of this package, but have been removed. -->
<UnusedBaselinePackageReference Include="@(BaselinePackageReference)"
Exclude="@(Reference);@(_ProjectReferenceByAssemblyName);@(PackageReference)" />
<!-- Only allow suppressing baseline changes in non-servicing builds. -->
<UnusedBaselinePackageReference Remove="@(SuppressBaselineReference)" Condition="'$(IsServicingBuild)' != 'true'"/>
Exclude="@(Reference);@(PackageReference);@(ProjectReference->'%(Filename)')" />

<!-- Handle suppressions needed because above Exclude is not aware of references added in .nuspec files. -->
<UnusedBaselinePackageReference Remove="@(SuppressBaselineReference->WithMetadataValue('InNuspecFile', 'true'))"
Condition=" '$(IsServicingBuild)' == 'true' " />

<!-- Allow suppressions of any baseline changes in non-servicing builds. -->
<UnusedBaselinePackageReference Remove="@(SuppressBaselineReference)"
Condition=" '$(IsServicingBuild)' != 'true' " />
</ItemGroup>

<JoinItems Left="@(Reference)" Right="@(LatestPackageReference)" LeftMetadata="*" RightMetadata="Version"
Expand Down Expand Up @@ -231,6 +237,16 @@
<_ExplicitPackageReference Remove="@(_ExplicitPackageReference)" />
</ItemGroup>

<Warning
Condition=" '$(IsServicingBuild)' != 'true' AND '%(UnusedBaselinePackageReference.Identity)' != '' "
Code="BUILD001"
Text="Reference to '%(UnusedBaselinePackageReference.Identity)' was removed since the last stable release of this package. This could be a breaking change. See docs/ReferenceResolution.md for instructions on how to update changes to references or suppress this warning if the error was intentional." />

<Error
Condition=" '$(IsServicingBuild)' == 'true' AND @(UnusedBaselinePackageReference->Count()) != 0 "
Code="BUILD002"
Text="Package references changed since the last release. This could be a breaking change and is not allowed in a servicing update. References removed:%0A - @(UnusedBaselinePackageReference, '%0A - ')" />

<Error
Condition="'$(TargetFrameworkIdentifier)' != '.NETFramework' AND '%(Reference.Identity)' != '' AND ! Exists('%(Reference.Identity)') AND '$(DisablePackageReferenceRestrictions)' != 'true'"
Code="MSB3245"
Expand Down
40 changes: 34 additions & 6 deletions eng/tools/BaselineGenerator/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ static void Main(string[] args)

public Program()
{
_source = Option("-s|--package-source <SOURCE>", "The NuGet source of packages to fetch", CommandOptionType.SingleValue);
_source = Option(
"-s|--package-source <SOURCE>",
"The NuGet source of packages to fetch",
CommandOptionType.SingleValue);
_output = Option("-o|--output <OUT>", "The generated file output path", CommandOptionType.SingleValue);
_update = Option("-u|--update", "Regenerate the input (Baseline.xml) file.", CommandOptionType.NoValue);

Expand All @@ -45,9 +48,6 @@ public Program()

private async Task<int> Run()
{
var source = _source.HasValue()
? _source.Value().TrimEnd('/')
: "https://api.nuget.org/v3/index.json";
if (_output.HasValue() && _update.HasValue())
{
await Error.WriteLineAsync("'--output' and '--update' options must not be used together.");
Expand All @@ -56,6 +56,7 @@ private async Task<int> Run()

var inputPath = Path.Combine(Directory.GetCurrentDirectory(), "Baseline.xml");
var input = XDocument.Load(inputPath);
var source = _source.HasValue() ? _source.Value().TrimEnd('/') : "https://api.nuget.org/v3/index.json";
var packageSource = new PackageSource(source);
var providers = Repository.Provider.GetCoreV3(); // Get v2 and v3 API support
var sourceRepository = new SourceRepository(packageSource, providers);
Expand Down Expand Up @@ -89,6 +90,11 @@ private async Task<int> Run()

var baselineVersion = input.Root.Attribute("Version").Value;

// Baseline and .NET Core versions always align in non-preview releases.
var parsedVersion = Version.Parse(baselineVersion);
var defaultTarget = ((parsedVersion.Major < 5) ? "netcoreapp" : "net") +
$"{parsedVersion.Major}.{parsedVersion.Minor}";

var doc = new XDocument(
new XComment(" Auto generated. Do not edit manually, use eng/tools/BaselineGenerator/ to recreate. "),
new XElement("Project",
Expand Down Expand Up @@ -136,12 +142,34 @@ private async Task<int> Run()

foreach (var group in reader.NuspecReader.GetDependencyGroups())
{
var itemGroup = new XElement("ItemGroup", new XAttribute("Condition", $" '$(PackageId)' == '{id}' AND '$(TargetFramework)' == '{group.TargetFramework.GetShortFolderName()}' "));
// Don't bother generating empty ItemGroup elements.
if (group.Packages.Count() == 0)
{
continue;
}

// Handle changes to $(DefaultNetCoreTargetFramework) even if some projects are held back.
var targetCondition = $"'$(TargetFramework)' == '{group.TargetFramework.GetShortFolderName()}'";
if (string.Equals(
group.TargetFramework.GetShortFolderName(),
defaultTarget,
StringComparison.OrdinalIgnoreCase))
{
targetCondition =
$"('$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' OR {targetCondition})";
}

var itemGroup = new XElement(
"ItemGroup",
new XAttribute("Condition", $" '$(PackageId)' == '{id}' AND {targetCondition} "));
doc.Root.Add(itemGroup);

foreach (var dependency in group.Packages)
{
itemGroup.Add(new XElement("BaselinePackageReference", new XAttribute("Include", dependency.Id), new XAttribute("Version", dependency.VersionRange.ToString())));
itemGroup.Add(
new XElement("BaselinePackageReference",
new XAttribute("Include", dependency.Id),
new XAttribute("Version", dependency.VersionRange.ToString())));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions" />
</ItemGroup>

<!-- These references were removed in 3.0 -->
<!--
These references exist only in the .nuspec files and baseline checks are not aware of them. Keep suppressions
in sync with the two .nuspec files:
- Anytime a reference is added to this project file, remove its suppression.
- Remove InNuspecFile attributes of references removed from the .nuspec files. Make suppression conditional on
Major.Minor during previews. After RTM (and baseline updates), remove suppressions entirely.
-->
<ItemGroup>
<SuppressBaselineReference Include="Microsoft.AspNetCore.Components.Analyzers" />
<SuppressBaselineReference Include="Microsoft.AspNetCore.Authorization" />
<SuppressBaselineReference Include="System.ComponentModel.Annotations" />
<SuppressBaselineReference Include="Microsoft.AspNetCore.Components.Analyzers" InNuspecFile="true" />
<SuppressBaselineReference Include="Microsoft.AspNetCore.Authorization" InNuspecFile="true" />
<SuppressBaselineReference Include="Microsoft.JSInterop" Condition=" '$(AspNetCoreMajorMinorVersion)' == '5.0' " />
</ItemGroup>

<Target Name="_GetNuspecDependencyPackageVersions">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
Expand All @@ -15,9 +15,13 @@
<Reference Include="Microsoft.Extensions.Logging" />
<Reference Include="Microsoft.JSInterop.WebAssembly" />

<ProjectReference Include="..\..\..\Web.JS\Microsoft.AspNetCore.Components.Web.JS.npmproj" ReferenceOutputAssemblies="false" SkipGetTargetFrameworkProperties="true" UndefineProperties="TargetFramework" Private="false" Condition="'$(BuildNodeJS)' != 'false' and '$(BuildingInsideVisualStudio)' != 'true'" />

<SuppressBaselineReference Include="Microsoft.AspNetCore.Components.WebAssembly.HttpHandler" />
<ProjectReference
Include="..\..\..\Web.JS\Microsoft.AspNetCore.Components.Web.JS.npmproj"
ReferenceOutputAssemblies="false"
SkipGetTargetFrameworkProperties="true"
UndefineProperties="TargetFramework"
Private="false"
Condition="'$(BuildNodeJS)' != 'false' and '$(BuildingInsideVisualStudio)' != 'true'" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<Reference Include="System.Security.Principal.Windows" />
<SuppressBaselineReference Include="Microsoft.AspNetCore.Hosting.Abstractions" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == '$(DefaultNetFxTargetFramework)'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,9 @@
<Reference Include="Microsoft.Extensions.HostFactoryResolver.Sources" />
</ItemGroup>

<ItemGroup Condition=" '$(AspNetCoreMajorMinorVersion)' == '5.0' ">
<!-- Dependency (now in shared Fx) was removed in 5.0. Suppression can be removed after 5.0 RTM is released. -->
<SuppressBaselineReference Include="System.IO.Pipelines" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,9 @@
<Reference Include="System.IO.Pipelines" />
</ItemGroup>

<ItemGroup Condition=" '$(AspNetCoreMajorMinorVersion)' == '5.0' AND '$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' ">
<!-- Dependency (now in shared Fx) was removed in 5.0. Suppression can be removed after 5.0 RTM is released. -->
<SuppressBaselineReference Include="System.IO.Pipelines" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<Reference Include="Microsoft.Extensions.Caching.Abstractions" />
<Reference Include="Microsoft.Extensions.Logging" />
<Reference Include="Microsoft.Extensions.Identity.Core" />
<SuppressBaselineReference Include="System.ComponentModel.Annotations" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,4 @@
<Reference Include="xunit.analyzers" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
<!-- Removing nonexistent package -->
<SuppressBaselineReference Include="Microsoft.AspNetCore.Testing" />
</ItemGroup>
</Project>
5 changes: 5 additions & 0 deletions src/Identity/UI/src/Microsoft.AspNetCore.Identity.UI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
<Reference Include="Microsoft.Extensions.Identity.Stores" />
</ItemGroup>

<ItemGroup Condition=" '$(AspNetCoreMajorMinorVersion)' == '5.0' ">
<!-- This dependency was removed in 5.0. The suppression can be removed after 5.0 RTM is released. -->
<SuppressBaselineReference Include="Newtonsoft.Json" />
</ItemGroup>

<ItemGroup>
<UIFrameworkVersionMoniker Include="V4" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,12 @@
<Reference Include="Microsoft.Bcl.AsyncInterfaces" />
</ItemGroup>

<ItemGroup Condition=" '$(AspNetCoreMajorMinorVersion)' == '5.0' ">
<!--
Dependency (now in shared Fx and a transitive ref for netstandard2.x) was removed in 5.0. Suppression can be
removed after 5.0 RTM is released.
-->
<SuppressBaselineReference Include="System.IO.Pipelines" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
<Reference Include="System.Threading.Channels" />
</ItemGroup>

<ItemGroup Condition="'$(AspNetCoreMajorMinorVersion)' == '5.0'">
<!-- This dependency was replaced by Protocols.NewtonsoftJson between 3.0 and 2.2. This suppression can be removed after 3.0 is complete. -->
<SuppressBaselineReference Include="Microsoft.AspNetCore.SignalR.Protocols.Json" />
<ItemGroup Condition=" '$(AspNetCoreMajorMinorVersion)' == '5.0' AND '$(TargetFramework)' == 'netstandard2.0' ">
<!-- Dependency (a transitive ref) was removed in 5.0. Suppression can be removed after 5.0 RTM is released. -->
<SuppressBaselineReference Include="Microsoft.Bcl.AsyncInterfaces" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,4 @@
<Reference Include="System.Text.Json" />
</ItemGroup>

<ItemGroup Condition="'$(AspNetCoreMajorMinorVersion)' == '5.0'">
<!-- This dependency was replaced by System.Text.Json between 3.0 and 2.2. This suppression can be removed after 3.0 is complete. -->
<SuppressBaselineReference Include="Newtonsoft.Json" />

<!-- System.Text.Json (for .NET Standard 2.0) and ShardFx bring System.Buffers in (transitively). No need for both here. -->
<SuppressBaselineReference Include="System.Buffers" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,4 @@
<Reference Include="Microsoft.AspNetCore.SignalR.Common" />
</ItemGroup>

<ItemGroup Condition="'$(AspNetCoreMajorMinorVersion)' == '5.0'">
<!-- This dependency was replaced by System.Text.Json between 3.0 and 2.2. This suppression can be removed after 3.0 is complete. -->
<SuppressBaselineReference Include="Newtonsoft.Json" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@
<Reference Include="System.Net.Sockets" />
</ItemGroup>

<ItemGroup Condition="'$(AspNetCoreMajorMinorVersion)' == '5.0'">
<!-- This dependency was replaced by System.Text.Json between 3.0 and 2.2. This suppression can be removed after 3.0 is complete. -->
<SuppressBaselineReference Include="Newtonsoft.Json" />

<!-- System.Text.Json (for .NET Standard 2.0) and ShardFx bring System.Buffers in (transitively). No need for both here. -->
<SuppressBaselineReference Include="System.Buffers" />
</ItemGroup>

<ItemGroup>
<InternalsVisibleTo Include="Microsoft.AspNetCore.SignalR.Common.Tests" />
<InternalsVisibleTo Include="Microsoft.AspNetCore.SignalR.Tests.Utils" />
Expand Down
3 changes: 0 additions & 3 deletions src/Tools/dotnet-sql-cache/src/dotnet-sql-cache.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@

<ItemGroup>
<Reference Include="Microsoft.Data.SqlClient" />

<!-- Intentional change to remove reference to System.Data.SqlClient. See https://github.com/dotnet/aspnetcore/issues/12445 -->
<SuppressBaselineReference Include="System.Data.SqlClient" />
</ItemGroup>

</Project>