diff --git a/AspNetCore.sln b/AspNetCore.sln index 5a54800dae83..467e466114f7 100644 --- a/AspNetCore.sln +++ b/AspNetCore.sln @@ -7,8 +7,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "eng", "eng", "{C28A32F6-831 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{0F84F170-57D0-496B-8E2C-7984178EF69F}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BaselineGenerator", "eng\tools\BaselineGenerator\BaselineGenerator.csproj", "{03C2290A-1C48-489A-81DB-F3447B0DA595}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RepoTasks", "eng\tools\RepoTasks\RepoTasks.csproj", "{2B94628A-CFFB-447E-8026-A126C33B0917}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{017429CC-C5FB-48B4-9C46-034E29EE2F06}" @@ -1826,22 +1824,6 @@ Global Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {03C2290A-1C48-489A-81DB-F3447B0DA595}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {03C2290A-1C48-489A-81DB-F3447B0DA595}.Debug|Any CPU.Build.0 = Debug|Any CPU - {03C2290A-1C48-489A-81DB-F3447B0DA595}.Debug|arm64.ActiveCfg = Debug|Any CPU - {03C2290A-1C48-489A-81DB-F3447B0DA595}.Debug|arm64.Build.0 = Debug|Any CPU - {03C2290A-1C48-489A-81DB-F3447B0DA595}.Debug|x64.ActiveCfg = Debug|Any CPU - {03C2290A-1C48-489A-81DB-F3447B0DA595}.Debug|x64.Build.0 = Debug|Any CPU - {03C2290A-1C48-489A-81DB-F3447B0DA595}.Debug|x86.ActiveCfg = Debug|Any CPU - {03C2290A-1C48-489A-81DB-F3447B0DA595}.Debug|x86.Build.0 = Debug|Any CPU - {03C2290A-1C48-489A-81DB-F3447B0DA595}.Release|Any CPU.ActiveCfg = Release|Any CPU - {03C2290A-1C48-489A-81DB-F3447B0DA595}.Release|Any CPU.Build.0 = Release|Any CPU - {03C2290A-1C48-489A-81DB-F3447B0DA595}.Release|arm64.ActiveCfg = Release|Any CPU - {03C2290A-1C48-489A-81DB-F3447B0DA595}.Release|arm64.Build.0 = Release|Any CPU - {03C2290A-1C48-489A-81DB-F3447B0DA595}.Release|x64.ActiveCfg = Release|Any CPU - {03C2290A-1C48-489A-81DB-F3447B0DA595}.Release|x64.Build.0 = Release|Any CPU - {03C2290A-1C48-489A-81DB-F3447B0DA595}.Release|x86.ActiveCfg = Release|Any CPU - {03C2290A-1C48-489A-81DB-F3447B0DA595}.Release|x86.Build.0 = Release|Any CPU {2B94628A-CFFB-447E-8026-A126C33B0917}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2B94628A-CFFB-447E-8026-A126C33B0917}.Debug|Any CPU.Build.0 = Debug|Any CPU {2B94628A-CFFB-447E-8026-A126C33B0917}.Debug|arm64.ActiveCfg = Debug|Any CPU @@ -10965,7 +10947,6 @@ Global EndGlobalSection GlobalSection(NestedProjects) = preSolution {0F84F170-57D0-496B-8E2C-7984178EF69F} = {C28A32F6-8314-412E-9F3B-CBD31C23E878} - {03C2290A-1C48-489A-81DB-F3447B0DA595} = {0F84F170-57D0-496B-8E2C-7984178EF69F} {2B94628A-CFFB-447E-8026-A126C33B0917} = {0F84F170-57D0-496B-8E2C-7984178EF69F} {1A0EFF9F-E699-4303-AE50-BFAF9804EEB6} = {017429CC-C5FB-48B4-9C46-034E29EE2F06} {819B136D-B8B6-46AE-8C4F-5469BBBFC46B} = {1A0EFF9F-E699-4303-AE50-BFAF9804EEB6} diff --git a/Directory.Build.targets b/Directory.Build.targets index 140420599154..06208e80cdf6 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -53,8 +53,6 @@ '$(IsBenchmarkProject)' == 'true' OR '$(IsSampleProject)' == 'true' OR '$(IsMicrobenchmarksProject)' == 'true') ">false - - true @@ -73,24 +71,6 @@ $(PackageVersion) - - - $(BaselinePackageVersion.Substring(0, $(BaselinePackageVersion.IndexOf('-')))).0 - $(BaselinePackageVersion).0 - - $(BaselinePackageVersion) - $(BaselinePackageVersion) - - - $(BaselinePackageVersion) - - - -- -+ -+ - -``` - ## A darc cheatsheet `darc` is a command-line tool that is used for dependency management in the dotnet ecosystem of repos. `darc` can be installed using the `darc-init` scripts located inside the `eng/common` directory. Once `darc` is installed, you'll need to set up the appropriate access tokens as outlined [in the official Darc docs](https://github.com/dotnet/arcade/blob/master/Documentation/Darc.md#setting-up-your-darc-client). diff --git a/docs/UpdatingMajorVersionAndTFM.md b/docs/UpdatingMajorVersionAndTFM.md index 6fde9d8f98a8..29a872c11dec 100644 --- a/docs/UpdatingMajorVersionAndTFM.md +++ b/docs/UpdatingMajorVersionAndTFM.md @@ -21,7 +21,6 @@ Typically, we will update the Major Version before updating the TFM. This is bec * Mark APIs from the previous release as Shipped by running `.\eng\scripts\mark-shipped.cmd`. **Note that it's best to do this as early as possible after the API surface is finalized from the previous release** - make sure to be careful that any new API in `main` that isn't shipped as part of the previous release, stays in `PublicAPI.Unshipped.txt` files. * One way to ensure this is to check out the release branch shipping the previous release (**after API surface area has been finalized**), run `.\eng\scripts\mark-shipped.cmd` there, copy over all of the `PublicAPI.Unshipped.txt` and `PublicAPI.Shipped.txt` files into a new branch based off of `main`, and build the repo. Any failures there will tell you whether or not there are new APIs in main that need to be put back into the `PublicAPI.Unshipped.txt` files. * The result of `.\eng\scripts\mark-shipped.cmd` should be checked in to the release branch as well, as part of the RTM release. -* Update `.\eng\Baseline.xml` to reflect the set of RTM packages that were just shipped. Then, `dotnet run` `.\eng\tools\BaselineGenerator\BaselineGenerator.csproj`, which will update `.\eng\Baseline.Designer.props`. If RTM hasn't shipped yet, do this in a separate PR once it has. See https://github.com/dotnet/aspnetcore/pull/49269. * **In the new release branch**, add files named `.\eng\PlatformManifest.txt` and `.\eng\PackageOverrides.txt`. These files should be found by downloading the just released RTM version of the `Microsoft.AspNetCore.App.Ref` package, and copying over the files from the `data` folder. * Update [helix-matrix.yml](https://github.com/dotnet/aspnetcore/blob/436556163a671259c8b14ae1c90d72767af62d18/.azure/pipelines/helix-matrix.yml#L12-L16) to list the currently active release branches. * This should be done in `main` as well as the relevant release branch. diff --git a/eng/Baseline.Designer.props b/eng/Baseline.Designer.props deleted file mode 100644 index 09d17a9f1d8d..000000000000 --- a/eng/Baseline.Designer.props +++ /dev/null @@ -1,1002 +0,0 @@ - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 9.0.10 - - - - 9.0.10 - - - - 9.0.10 - - - - 9.0.10 - - - - 9.0.10 - - - - 9.0.10 - - - - 9.0.10 - - - - 9.0.10 - - - - 9.0.10 - - - - 9.0.10 - - - - 9.0.10 - - - - 9.0.10 - - - - 9.0.10 - - - - 9.0.10 - - - - 9.0.10 - - - - 9.0.10 - - - - 9.0.10 - - - - - - - 9.0.10 - - - - 9.0.10 - - - - 9.0.10 - - - - - - - 9.0.10 - - - - 9.0.10 - - - - - - - - - 9.0.10 - - - - - - - 9.0.10 - - - - 9.0.10 - - - - - - - - 9.0.10 - - - - - - - - - - - - - - - - - - - 9.0.10 - - - - - - - - - 9.0.10 - - - - 9.0.10 - - - - - - - 9.0.10 - - - - - - - - 9.0.10 - - - - 9.0.10 - - - - - - - - 9.0.10 - - - - - - - 9.0.10 - - - - - - - 9.0.10 - - - - - - - 9.0.10 - - - - - - - - 9.0.10 - - - - - - - - - - - 9.0.10 - - - - - - - - - - - 9.0.10 - - - - - - - - 9.0.10 - - - - 9.0.10 - - - - 9.0.10 - - - - - - - - - - - - 9.0.10 - - - - - - - - - 9.0.10 - - - - - - - - - - - - - - - - - - - - - - 9.0.10 - - - - 9.0.10 - - - - - - - - - - - - - 9.0.10 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 9.0.10 - - - - 9.0.10 - - - - - - - - 9.0.10 - - - - - - - - - - - - - - - - 9.0.10 - - - - - - - - - - - - - - - - 9.0.10 - - - - - - - 9.0.10 - - - - - - - - - 9.0.10 - - - - - - - - 9.0.10 - - - - - - - 9.0.10 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 9.0.10 - - - - - - - - - - - - - - - 9.0.10 - - - - - - - - 9.0.10 - - - - - - - - 9.0.10 - - - - - - - - - - - - - - - - 9.0.10 - - - - 9.0.10 - - - - - - - 9.0.10 - - - - - - - - - 9.0.10 - - - - - - - - - 9.0.10 - - - - - - - - - 9.0.10 - - - - - - - 9.0.10 - - - - - - - - - 9.0.10 - - - - 9.0.10 - - - - - - - - - - - - - - - - 9.0.10 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 9.0.10 - - - - - - - - - - - - - - - - - - - 9.0.10 - - - - - - - - - - - - - 9.0.10 - - - - - - - - - - - - - - - - 9.0.10 - - - - - - - - - - - - - - - - 9.0.10 - - - - - - - - - - - - 9.0.10 - - - - - - - - - 9.0.10 - - - - 9.0.10 - - - - - - - 9.0.10 - - - - 9.0.10 - - - - - - - 9.0.10 - - - - - - - 9.0.10 - - - - 9.0.10 - - - - 9.0.10 - - - - 9.0.10 - - - - 9.0.10 - - - - 9.0.10 - - - - 9.0.10 - - - - - - - - - - - - - - - - - - - - - - 9.0.10 - - - - - - - - - - - - - - - - - - - - - - - - - - - - 9.0.10 - - - - - - - - - - - - - - - - 9.0.10 - - - - - - - - - - - - - - - - - - - - - - - - 9.0.10 - - - - 9.0.10 - - - - - - - - - 9.0.10 - - - - 9.0.10 - - - - - - - - - - 9.0.10 - - - - - - - - - 9.0.10 - - - - - - - - - - - - - - - - - - - - - 9.0.10 - - - - - - - - - - - - - - - - - - - 9.0.10 - - - - - - - - - - - - - - - - - - - - - - 9.0.10 - - - - 9.0.10 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 9.0.10 - - - - 9.0.10 - - - - - - - - - - - - - - - - - - 9.0.10 - - - - 9.0.10 - - - - - - - 9.0.10 - - - - - \ No newline at end of file diff --git a/eng/Baseline.xml b/eng/Baseline.xml deleted file mode 100644 index 04d7c413b07a..000000000000 --- a/eng/Baseline.xml +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/eng/Dependencies.props b/eng/Dependencies.props index af9ef7fa88e3..55c76fc3dc56 100644 --- a/eng/Dependencies.props +++ b/eng/Dependencies.props @@ -3,9 +3,6 @@ This file contains a list of all the external dependencies used in ASP.NET Core. These dependencies are expressed as ``. These are used as inputs reference resolution, and may be turned into `` items in projects. - -`` items should not be in this file. Those items appear in Baseline.Designer.props -and are generated based on the last package release. --> diff --git a/eng/Versions.props b/eng/Versions.props index 6d42dcb82c95..4b504ef39a3b 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -11,7 +11,6 @@ 13 - false 8.0.1 *-* diff --git a/eng/targets/ResolveReferences.targets b/eng/targets/ResolveReferences.targets index e416d43f3038..2b769b7b4a2d 100644 --- a/eng/targets/ResolveReferences.targets +++ b/eng/targets/ResolveReferences.targets @@ -10,8 +10,6 @@ Items used by the resolution strategy: - * BaselinePackageReference = a list of packages that were referenced in the last release of the project currently building - - mainly used to ensure references do not change in servicing builds unless $(UseLatestPackageReferences) is not true. * LatestPackageReference = a list of the latest versions of packages * Reference = a list of the references which are needed for compilation or runtime * ProjectReferenceProvider = a list which maps of assembly names to the project file that produces it @@ -46,7 +44,7 @@ Condition=" '$(UseLatestPackageReferences)' == '' AND '$(IsPackageInThisPatch)' == 'true' ">true false - + true @@ -142,18 +140,6 @@ ContentFiles;Build All - - - - - - - - - - - - - - - - - - - - <_LatestPackageReferenceWithVersion Remove="@(_LatestPackageReferenceWithVersion)" /> - <_BaselinePackageReferenceWithVersion Remove="@(_BaselinePackageReferenceWithVersion)" /> <_PrivatePackageReferenceWithVersion Remove="@(_PrivatePackageReferenceWithVersion)" /> <_ImplicitPackageReference Remove="@(_ImplicitPackageReference)" /> @@ -207,11 +180,6 @@ <_ExplicitPackageReference Remove="@(_ExplicitPackageReference)" /> - - - - - Exe - $(DefaultNetCoreTargetFramework) - $(MSBuildThisFileDirectory)../../ - - - - - - - - diff --git a/eng/tools/BaselineGenerator/Program.cs b/eng/tools/BaselineGenerator/Program.cs deleted file mode 100644 index c599c77ac460..000000000000 --- a/eng/tools/BaselineGenerator/Program.cs +++ /dev/null @@ -1,398 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net.Http; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using System.Xml; -using System.Xml.Linq; -using Microsoft.Extensions.CommandLineUtils; -using NuGet.Common; -using NuGet.Configuration; -using NuGet.Packaging; -using NuGet.Protocol; -using NuGet.Protocol.Core.Types; -using NuGet.Versioning; - -namespace PackageBaselineGenerator; - -/// -/// This generates Baseline.props with information about the last RTM release. -/// -class Program : CommandLineApplication -{ - static void Main(string[] args) - { - new Program().Execute(args); - } - - private readonly CommandOption _sources; - private readonly CommandOption _output; - private readonly CommandOption _update; - - private static readonly string[] _defaultSources = new string[] { "https://api.nuget.org/v3/index.json" }; - - public Program() - { - _sources = Option( - "-s|--package-sources ", - "The NuGet source(s) of packages to fetch", - CommandOptionType.MultipleValue); - _output = Option("-o|--output ", "The generated file output path", CommandOptionType.SingleValue); - _update = Option("-u|--update", "Regenerate the input (Baseline.xml) file.", CommandOptionType.NoValue); - - Invoke = () => Run().GetAwaiter().GetResult(); - } - - private async Task Run() - { - if (_output.HasValue() && _update.HasValue()) - { - await Error.WriteLineAsync("'--output' and '--update' options must not be used together."); - return 1; - } - - var inputPath = Path.Combine(Directory.GetCurrentDirectory(), "Baseline.xml"); - var input = XDocument.Load(inputPath); - var sources = _sources.HasValue() ? _sources.Values.Select(s => s.TrimEnd('/')) : _defaultSources; - var packageSources = sources.Select(s => new PackageSource(s)); - var providers = Repository.Provider.GetCoreV3(); // Get v2 and v3 API support - var sourceRepositories = packageSources.Select(ps => new SourceRepository(ps, providers)); - if (_update.HasValue()) - { - var updateResult = await RunUpdateAsync(inputPath, input, sourceRepositories); - if (updateResult != 0) - { - return updateResult; - } - } - - List<(string packageBase, bool feedV3)> packageBases = new List<(string, bool)>(); - foreach (var sourceRepository in sourceRepositories) - { - var feedType = await sourceRepository.GetFeedType(CancellationToken.None); - var feedV3 = feedType == FeedType.HttpV3; - var packageBase = sourceRepository.PackageSource + "/package"; - if (feedV3) - { - var resources = await sourceRepository.GetResourceAsync(); - packageBase = resources.GetServiceEntryUri(ServiceTypes.PackageBaseAddress).ToString().TrimEnd('/'); - } - - packageBases.Add((packageBase, feedV3)); - } - - var output = _output.HasValue() - ? _output.Value() - : Path.Combine(Directory.GetCurrentDirectory(), "Baseline.Designer.props"); - - var packageCache = Environment.GetEnvironmentVariable("NUGET_PACKAGES") ?? - Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".nuget", "packages"); - - var tempDir = Path.Combine(Directory.GetCurrentDirectory(), "obj", "tmp"); - Directory.CreateDirectory(tempDir); - - 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", - new XElement("PropertyGroup", - new XElement("MSBuildAllProjects", "$(MSBuildAllProjects);$(MSBuildThisFileFullPath)"), - new XElement("AspNetCoreBaselineVersion", baselineVersion)))); - - var client = new HttpClient(); - foreach (var pkg in input.Root.Descendants("Package")) - { - var id = pkg.Attribute("Id").Value; - var version = pkg.Attribute("Version").Value; - var packageFileName = $"{id}.{version}.nupkg"; - var nupkgPath = Path.Combine(packageCache, id.ToLowerInvariant(), version, packageFileName); - if (!File.Exists(nupkgPath)) - { - nupkgPath = Path.Combine(tempDir, packageFileName); - } - - if (!File.Exists(nupkgPath)) - { - foreach ((string packageBase, bool feedV3) in packageBases) - { - var url = feedV3 ? - $"{packageBase}/{id.ToLowerInvariant()}/{version}/{id.ToLowerInvariant()}.{version}.nupkg" : - $"{packageBase}/{id}/{version}"; - - Console.WriteLine($"Downloading {url}"); - try - { - using (var response = await client.GetStreamAsync(url)) - { - using (var file = File.Create(nupkgPath)) - { - await response.CopyToAsync(file); - } - } - } - catch (HttpRequestException e) when (e.StatusCode == System.Net.HttpStatusCode.NotFound) - { - // If it's not found, continue onto the next one. - continue; - } - } - - if (!File.Exists(nupkgPath)) - { - throw new Exception($"Could not download package {id} @ {version} using any input feed"); - } - } - - using (var reader = new PackageArchiveReader(nupkgPath)) - { - doc.Root.Add(new XComment($" Package: {id}")); - - var propertyGroup = new XElement( - "PropertyGroup", - new XAttribute("Condition", $" '$(PackageId)' == '{id}' "), - new XElement("BaselinePackageVersion", version)); - doc.Root.Add(propertyGroup); - - foreach (var group in reader.NuspecReader.GetDependencyGroups()) - { - // Don't bother generating empty ItemGroup elements. - if (!group.Packages.Any()) - { - 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 '$(TargetFramework)' == '{defaultTarget}')"; - } - - 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()))); - } - } - } - } - - var settings = new XmlWriterSettings - { - OmitXmlDeclaration = true, - Encoding = Encoding.UTF8, - Indent = true, - }; - - using (var writer = XmlWriter.Create(output, settings)) - { - doc.Save(writer); - } - - Console.WriteLine($"Generated file in {output}"); - - return 0; - } - - private async Task RunUpdateAsync( - string documentPath, - XDocument document, - IEnumerable sourceRepositories) - { - var packageMetadataResources = await Task.WhenAll(sourceRepositories.Select(async sr => - await sr.GetResourceAsync())); - - var logger = new Logger(Error, Out); - var hasChanged = false; - using (var cacheContext = new SourceCacheContext { NoCache = true }) - { - var versionAttribute = document.Root.Attribute("Version"); - hasChanged = await TryUpdateVersionAsync( - versionAttribute, - "Microsoft.AspNetCore.App.Runtime.win-x64", - packageMetadataResources, - logger, - cacheContext); - - foreach (var package in document.Root.Descendants("Package")) - { - var id = package.Attribute("Id").Value; - versionAttribute = package.Attribute("Version"); - var attributeChanged = await TryUpdateVersionAsync( - versionAttribute, - id, - packageMetadataResources, - logger, - cacheContext); - - hasChanged |= attributeChanged; - } - } - - if (hasChanged) - { - await Out.WriteLineAsync($"Updating {documentPath}."); - - var settings = new XmlWriterSettings - { - Async = true, - CheckCharacters = true, - CloseOutput = false, - Encoding = Encoding.UTF8, - Indent = true, - IndentChars = " ", - NewLineOnAttributes = false, - OmitXmlDeclaration = true, - WriteEndDocumentOnClose = true, - }; - - using (var stream = File.OpenWrite(documentPath)) - { - using (var writer = XmlWriter.Create(stream, settings)) - { - await document.SaveAsync(writer, CancellationToken.None); - } - } - } - else - { - await Out.WriteLineAsync("No new versions found"); - } - - return 0; - } - - private static async Task TryUpdateVersionAsync( - XAttribute versionAttribute, - string packageId, - IEnumerable packageMetadataResources, - ILogger logger, - SourceCacheContext cacheContext) - { - var currentVersion = NuGetVersion.Parse(versionAttribute.Value); - var versionRange = new VersionRange( - currentVersion, - new FloatRange(NuGetVersionFloatBehavior.Patch, currentVersion)); - - var searchMetadatas = await Task.WhenAll( - packageMetadataResources.Select(async pmr => await pmr.GetMetadataAsync( - packageId, - includePrerelease: false, - includeUnlisted: true, // Microsoft.AspNetCore.DataOrotection.Redis package is not listed. - sourceCacheContext: cacheContext, - log: logger, - token: CancellationToken.None))); - - // Find the latest version among each search metadata - NuGetVersion latestVersion = null; - foreach (var searchMetadata in searchMetadatas) - { - var potentialLatestVersion = versionRange.FindBestMatch( - searchMetadata.Select(metadata => metadata.Identity.Version)); - if (latestVersion == null || - (potentialLatestVersion != null && potentialLatestVersion.CompareTo(latestVersion) > 0)) - { - latestVersion = potentialLatestVersion; - } - } - - if (latestVersion == null) - { - logger.LogWarning($"Unable to find latest version of '{packageId}'."); - return false; - } - - var hasChanged = false; - if (latestVersion != currentVersion) - { - hasChanged = true; - versionAttribute.Value = latestVersion.ToNormalizedString(); - } - - return hasChanged; - } - - private class Logger : ILogger - { - private readonly TextWriter _error; - private readonly TextWriter _out; - - public Logger(TextWriter error, TextWriter @out) - { - _error = error; - _out = @out; - } - - public void Log(LogLevel level, string data) - { - switch (level) - { - case LogLevel.Debug: - LogDebug(data); - break; - case LogLevel.Error: - LogError(data); - break; - case LogLevel.Information: - LogInformation(data); - break; - case LogLevel.Minimal: - LogMinimal(data); - break; - case LogLevel.Verbose: - LogVerbose(data); - break; - case LogLevel.Warning: - LogWarning(data); - break; - } - } - - public void Log(ILogMessage message) => Log(message.Level, message.Message); - - public Task LogAsync(LogLevel level, string data) - { - Log(level, data); - return Task.CompletedTask; - } - - public Task LogAsync(ILogMessage message) => LogAsync(message.Level, message.Message); - - public void LogDebug(string data) => _out.WriteLine($"Debug: {data}"); - - public void LogError(string data) => _error.WriteLine($"Error: {data}"); - - public void LogInformation(string data) => _out.WriteLine($"Information: {data}"); - - public void LogInformationSummary(string data) => _out.WriteLine($"Summary: {data}"); - - public void LogMinimal(string data) => _out.WriteLine($"Minimal: {data}"); - - public void LogVerbose(string data) => _out.WriteLine($"Verbose: {data}"); - - public void LogWarning(string data) => _out.WriteLine($"Warning: {data}"); - } -} diff --git a/eng/tools/BaselineGenerator/README.md b/eng/tools/BaselineGenerator/README.md deleted file mode 100644 index 28904c40b5a9..000000000000 --- a/eng/tools/BaselineGenerator/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# BaselineGenerator - -This tool is used to generate an MSBuild file which sets the "baseline" against which servicing updates are built. - -## Usage - -Add `--package-sources {source}` to the commands below if the packages of interest are not all hosted on NuGet.org. - -### Auto-update - -Run `dotnet run --update` in this project folder. This will attempt to find the latest patch version of packages and -update the baseline file. - -### Manual update - -1. Add to the [Baseline.xml](/eng/Baseline.xml) a list of package ID's and their latest released versions. The source of -this information can typically be found in the build.xml file generated during ProdCon builds. See - for example. -Update the version at the top of baseline.xml to match prior release (even if no packages changed in the prior release). -2. Run `dotnet run` on this project. diff --git a/eng/tools/tools.slnf b/eng/tools/tools.slnf index bdd4896e94f4..594f49d200e8 100644 --- a/eng/tools/tools.slnf +++ b/eng/tools/tools.slnf @@ -2,7 +2,6 @@ "solution": { "path": "..\\..\\AspNetCore.sln", "projects": [ - "eng\\tools\\BaselineGenerator\\BaselineGenerator.csproj", "eng\\tools\\RepoTasks\\RepoTasks.csproj", "eng\\tools\\HelixTestRunner\\HelixTestRunner.csproj" ] diff --git a/src/Components/Components/src/Microsoft.AspNetCore.Components.csproj b/src/Components/Components/src/Microsoft.AspNetCore.Components.csproj index 9ebdbfc3778f..148a0f7e5a2e 100644 --- a/src/Components/Components/src/Microsoft.AspNetCore.Components.csproj +++ b/src/Components/Components/src/Microsoft.AspNetCore.Components.csproj @@ -31,18 +31,6 @@ - - - - - -