diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.cs b/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.cs new file mode 100644 index 000000000000..558ea870e41c --- /dev/null +++ b/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.cs @@ -0,0 +1,182 @@ +namespace Microsoft.ComponentDetection.Detectors.NuGet; + +using System; +using System.Collections; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using global::NuGet.Frameworks; +using global::NuGet.Versioning; + +/// +/// Represents a set of packages that are provided by a specific framework. +/// At the moment this only represents the packages that are provided by the Microsoft.NETCore.App framework. +/// We could extend this to represent the packages provided by other frameworks like Microsoft.AspNetCore.App and Microsoft.WindowsDesktop.App. +/// +internal sealed partial class FrameworkPackages : IEnumerable>, IEnumerable +{ + private const string DefaultFrameworkKey = ""; + private static readonly ConcurrentDictionary> FrameworkPackagesByFramework = []; + + static FrameworkPackages() + { + NETStandard20.Register(); + NETStandard21.Register(); + NET461.Register(); + NETCoreApp20.Register(); + NETCoreApp21.Register(); + NETCoreApp22.Register(); + NETCoreApp30.Register(); + NETCoreApp31.Register(); + NETCoreApp50.Register(); + NETCoreApp60.Register(); + NETCoreApp70.Register(); + NETCoreApp80.Register(); + NETCoreApp90.Register(); + } + + public FrameworkPackages(NuGetFramework framework, string frameworkName) + { + this.Framework = framework; + this.FrameworkName = frameworkName; + } + + public FrameworkPackages(NuGetFramework framework, string frameworkName, FrameworkPackages frameworkPackages) + : this(framework, frameworkName) => this.Packages = new(frameworkPackages.Packages); + + public NuGetFramework Framework { get; } + + public string FrameworkName { get; } + + public Dictionary Packages { get; } = new Dictionary(StringComparer.OrdinalIgnoreCase); + + private static string GetFrameworkKey(string frameworkName) => + frameworkName switch + { + FrameworkNames.NetStandardLibrary => DefaultFrameworkKey, + FrameworkNames.NetCoreApp => DefaultFrameworkKey, + _ => frameworkName, + }; + + internal static void Register(params FrameworkPackages[] toRegister) + { + foreach (var frameworkPackages in toRegister) + { + if (!FrameworkPackagesByFramework.TryGetValue(frameworkPackages.Framework, out var frameworkPackagesForVersion)) + { + FrameworkPackagesByFramework[frameworkPackages.Framework] = frameworkPackagesForVersion = []; + } + + var frameworkKey = GetFrameworkKey(frameworkPackages.FrameworkName); + frameworkPackagesForVersion[frameworkKey] = frameworkPackages; + } + } + + public static FrameworkPackages[] GetFrameworkPackages(NuGetFramework framework, string[] frameworkReferences, string targetingPackRoot) + { + var frameworkPackages = new List(); + + if (frameworkReferences.Length == 0) + { + frameworkReferences = [DefaultFrameworkKey]; + } + + foreach (var frameworkReference in frameworkReferences) + { + var frameworkKey = GetFrameworkKey(frameworkReference); + if (FrameworkPackagesByFramework.TryGetValue(framework, out var frameworkPackagesForVersion) && + frameworkPackagesForVersion.TryGetValue(frameworkKey, out var frameworkPackage)) + { + frameworkPackages.Add(frameworkPackage); + } + else + { + // if we didn't predefine the package overrides, load them from the targeting pack + // we might just leave this out since in future frameworks we'll have this functionality built into NuGet.Frameworks + var frameworkPackagesFromPack = LoadFrameworkPackagesFromPack(framework, frameworkReference, targetingPackRoot) ?? new FrameworkPackages(framework, frameworkReference); + + Register(frameworkPackagesFromPack); + + frameworkPackages.Add(frameworkPackagesFromPack); + } + } + + return frameworkPackages.ToArray(); + } + + private static FrameworkPackages LoadFrameworkPackagesFromPack(NuGetFramework framework, string frameworkName, string targetingPackRoot) + { + if (framework is null || framework.Framework != FrameworkConstants.FrameworkIdentifiers.NetCoreApp) + { + return null; + } + + var reducer = new FrameworkReducer(); + var frameworkKey = GetFrameworkKey(frameworkName); + var candidateFrameworks = FrameworkPackagesByFramework.Where(pair => pair.Value.ContainsKey(frameworkKey)).Select(pair => pair.Key); + var nearestFramework = reducer.GetNearest(framework, candidateFrameworks); + + var frameworkPackages = nearestFramework is null ? + new FrameworkPackages(framework, frameworkName) : + new FrameworkPackages(framework, frameworkName, FrameworkPackagesByFramework[nearestFramework][frameworkKey]); + + if (!string.IsNullOrEmpty(targetingPackRoot)) + { + var packsFolder = Path.Combine(targetingPackRoot, frameworkName + ".Ref"); + if (Directory.Exists(packsFolder)) + { + var packVersionPattern = $"{framework.Version.Major}.{framework.Version.Minor}.*"; + var packDirectories = Directory.GetDirectories(packsFolder, packVersionPattern); + var packageOverridesFile = packDirectories + .Select(d => (Overrides: Path.Combine(d, "data", "PackageOverrides.txt"), Version: ParseVersion(Path.GetFileName(d)))) + .Where(d => File.Exists(d.Overrides)) + .OrderByDescending(d => d.Version) + .FirstOrDefault().Overrides; + + if (packageOverridesFile is not null) + { + // Adapted from https://github.com/dotnet/sdk/blob/c3a8f72c3a5491c693ff8e49e7406136a12c3040/src/Tasks/Common/ConflictResolution/PackageOverride.cs#L52-L68 + var packageOverrides = File.ReadAllLines(packageOverridesFile); + + foreach (var packageOverride in packageOverrides) + { + var packageOverrideParts = packageOverride.Trim().Split('|'); + + if (packageOverrideParts.Length == 2) + { + var packageId = packageOverrideParts[0]; + var packageVersion = ParseVersion(packageOverrideParts[1]); + + frameworkPackages.Packages[packageId] = packageVersion; + } + } + } + } + } + + return frameworkPackages; + + static NuGetVersion ParseVersion(string versionString) => NuGetVersion.TryParse(versionString, out var version) ? version : null; + } + + private void Add(string id, string version) + { + // intentionally redirect to indexer to allow for overwrite + this.Packages[id] = NuGetVersion.Parse(version); + } + + public bool IsAFrameworkComponent(string id, NuGetVersion version) => this.Packages.TryGetValue(id, out var frameworkPackageVersion) && frameworkPackageVersion >= version; + + IEnumerator> IEnumerable>.GetEnumerator() => this.Packages.GetEnumerator(); + + IEnumerator IEnumerable.GetEnumerator() => throw new NotImplementedException(); + + internal static class FrameworkNames + { + public const string AspNetCoreApp = "Microsoft.AspNetCore.App"; + public const string NetCoreApp = "Microsoft.NETCore.App"; + public const string NetStandardLibrary = "NETStandard.Library"; + public const string WindowsDesktopApp = "Microsoft.WindowsDesktop.App"; + } +} diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.net461.cs b/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.net461.cs new file mode 100644 index 000000000000..0d9214e5f70e --- /dev/null +++ b/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.net461.cs @@ -0,0 +1,16 @@ +namespace Microsoft.ComponentDetection.Detectors.NuGet; + +using static global::NuGet.Frameworks.FrameworkConstants.CommonFrameworks; + +/// +/// Framework packages for .NETFramework,Version=v4.6.1. +/// +internal partial class FrameworkPackages +{ + internal static class NET461 + { + internal static FrameworkPackages Instance { get; } = new(Net461, DefaultFrameworkKey, NETStandard20.Instance); + + internal static void Register() => FrameworkPackages.Register(Instance); + } +} diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.net5.0.cs b/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.net5.0.cs new file mode 100644 index 000000000000..6b7a63e0a5de --- /dev/null +++ b/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.net5.0.cs @@ -0,0 +1,201 @@ +namespace Microsoft.ComponentDetection.Detectors.NuGet; + +using static global::NuGet.Frameworks.FrameworkConstants.CommonFrameworks; + +/// +/// Framework packages for net5.0. +/// +internal partial class FrameworkPackages +{ + internal static class NETCoreApp50 + { + internal static FrameworkPackages Instance { get; } = new(Net50, FrameworkNames.NetCoreApp, NETCoreApp31.Instance) + { + { "Microsoft.Win32.Registry", "5.0.0" }, + { "System.Collections.Immutable", "5.0.0" }, + { "System.ComponentModel.Annotations", "5.0.0" }, + { "System.Diagnostics.DiagnosticSource", "5.0.0" }, + { "System.Formats.Asn1", "5.0.0" }, + { "System.IO.FileSystem.AccessControl", "5.0.0" }, + { "System.Net.Http.Json", "5.0.0" }, + { "System.Reflection.DispatchProxy", "4.7.1" }, + { "System.Reflection.Metadata", "5.0.0" }, + { "System.Runtime.CompilerServices.Unsafe", "5.0.0" }, + { "System.Security.AccessControl", "5.0.0" }, + { "System.Security.Cryptography.OpenSsl", "5.0.0" }, + { "System.Security.Principal.Windows", "5.0.0" }, + { "System.Text.Encoding.CodePages", "5.0.0" }, + { "System.Text.Encodings.Web", "5.0.0" }, + { "System.Text.Json", "5.0.0" }, + { "System.Threading.Channels", "5.0.0" }, + { "System.Threading.Tasks.Dataflow", "5.0.0" }, + }; + + internal static FrameworkPackages AspNetCore { get; } = new(Net50, FrameworkNames.AspNetCoreApp, NETCoreApp31.AspNetCore) + { + { "Microsoft.AspNetCore", "5.0.0" }, + { "Microsoft.AspNetCore.Antiforgery", "5.0.0" }, + { "Microsoft.AspNetCore.Authentication", "5.0.0" }, + { "Microsoft.AspNetCore.Authentication.Abstractions", "5.0.0" }, + { "Microsoft.AspNetCore.Authentication.Cookies", "5.0.0" }, + { "Microsoft.AspNetCore.Authentication.Core", "5.0.0" }, + { "Microsoft.AspNetCore.Authentication.OAuth", "5.0.0" }, + { "Microsoft.AspNetCore.Authorization", "5.0.0" }, + { "Microsoft.AspNetCore.Authorization.Policy", "5.0.0" }, + { "Microsoft.AspNetCore.Components", "5.0.0" }, + { "Microsoft.AspNetCore.Components.Authorization", "5.0.0" }, + { "Microsoft.AspNetCore.Components.Forms", "5.0.0" }, + { "Microsoft.AspNetCore.Components.Server", "5.0.0" }, + { "Microsoft.AspNetCore.Components.Web", "5.0.0" }, + { "Microsoft.AspNetCore.Connections.Abstractions", "5.0.0" }, + { "Microsoft.AspNetCore.CookiePolicy", "5.0.0" }, + { "Microsoft.AspNetCore.Cors", "5.0.0" }, + { "Microsoft.AspNetCore.Cryptography.Internal", "5.0.0" }, + { "Microsoft.AspNetCore.Cryptography.KeyDerivation", "5.0.0" }, + { "Microsoft.AspNetCore.DataProtection", "5.0.0" }, + { "Microsoft.AspNetCore.DataProtection.Abstractions", "5.0.0" }, + { "Microsoft.AspNetCore.DataProtection.Extensions", "5.0.0" }, + { "Microsoft.AspNetCore.Diagnostics", "5.0.0" }, + { "Microsoft.AspNetCore.Diagnostics.Abstractions", "5.0.0" }, + { "Microsoft.AspNetCore.Diagnostics.HealthChecks", "5.0.0" }, + { "Microsoft.AspNetCore.HostFiltering", "5.0.0" }, + { "Microsoft.AspNetCore.Hosting", "5.0.0" }, + { "Microsoft.AspNetCore.Hosting.Abstractions", "5.0.0" }, + { "Microsoft.AspNetCore.Hosting.Server.Abstractions", "5.0.0" }, + { "Microsoft.AspNetCore.Html.Abstractions", "5.0.0" }, + { "Microsoft.AspNetCore.Http", "5.0.0" }, + { "Microsoft.AspNetCore.Http.Abstractions", "5.0.0" }, + { "Microsoft.AspNetCore.Http.Connections", "5.0.0" }, + { "Microsoft.AspNetCore.Http.Connections.Common", "5.0.0" }, + { "Microsoft.AspNetCore.Http.Extensions", "5.0.0" }, + { "Microsoft.AspNetCore.Http.Features", "5.0.0" }, + { "Microsoft.AspNetCore.HttpOverrides", "5.0.0" }, + { "Microsoft.AspNetCore.HttpsPolicy", "5.0.0" }, + { "Microsoft.AspNetCore.Identity", "5.0.0" }, + { "Microsoft.AspNetCore.Localization", "5.0.0" }, + { "Microsoft.AspNetCore.Localization.Routing", "5.0.0" }, + { "Microsoft.AspNetCore.Metadata", "5.0.0" }, + { "Microsoft.AspNetCore.Mvc", "5.0.0" }, + { "Microsoft.AspNetCore.Mvc.Abstractions", "5.0.0" }, + { "Microsoft.AspNetCore.Mvc.ApiExplorer", "5.0.0" }, + { "Microsoft.AspNetCore.Mvc.Core", "5.0.0" }, + { "Microsoft.AspNetCore.Mvc.Cors", "5.0.0" }, + { "Microsoft.AspNetCore.Mvc.DataAnnotations", "5.0.0" }, + { "Microsoft.AspNetCore.Mvc.Formatters.Json", "5.0.0" }, + { "Microsoft.AspNetCore.Mvc.Formatters.Xml", "5.0.0" }, + { "Microsoft.AspNetCore.Mvc.Localization", "5.0.0" }, + { "Microsoft.AspNetCore.Mvc.Razor", "5.0.0" }, + { "Microsoft.AspNetCore.Mvc.RazorPages", "5.0.0" }, + { "Microsoft.AspNetCore.Mvc.TagHelpers", "5.0.0" }, + { "Microsoft.AspNetCore.Mvc.ViewFeatures", "5.0.0" }, + { "Microsoft.AspNetCore.Razor", "5.0.0" }, + { "Microsoft.AspNetCore.Razor.Runtime", "5.0.0" }, + { "Microsoft.AspNetCore.ResponseCaching", "5.0.0" }, + { "Microsoft.AspNetCore.ResponseCaching.Abstractions", "5.0.0" }, + { "Microsoft.AspNetCore.ResponseCompression", "5.0.0" }, + { "Microsoft.AspNetCore.Rewrite", "5.0.0" }, + { "Microsoft.AspNetCore.Routing", "5.0.0" }, + { "Microsoft.AspNetCore.Routing.Abstractions", "5.0.0" }, + { "Microsoft.AspNetCore.Server.HttpSys", "5.0.0" }, + { "Microsoft.AspNetCore.Server.IIS", "5.0.0" }, + { "Microsoft.AspNetCore.Server.IISIntegration", "5.0.0" }, + { "Microsoft.AspNetCore.Server.Kestrel", "5.0.0" }, + { "Microsoft.AspNetCore.Server.Kestrel.Core", "5.0.0" }, + { "Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets", "5.0.0" }, + { "Microsoft.AspNetCore.Session", "5.0.0" }, + { "Microsoft.AspNetCore.SignalR", "5.0.0" }, + { "Microsoft.AspNetCore.SignalR.Common", "5.0.0" }, + { "Microsoft.AspNetCore.SignalR.Core", "5.0.0" }, + { "Microsoft.AspNetCore.SignalR.Protocols.Json", "5.0.0" }, + { "Microsoft.AspNetCore.StaticFiles", "5.0.0" }, + { "Microsoft.AspNetCore.WebSockets", "5.0.0" }, + { "Microsoft.AspNetCore.WebUtilities", "5.0.0" }, + { "Microsoft.Extensions.Caching.Abstractions", "5.0.0" }, + { "Microsoft.Extensions.Caching.Memory", "5.0.0" }, + { "Microsoft.Extensions.Configuration", "5.0.0" }, + { "Microsoft.Extensions.Configuration.Abstractions", "5.0.0" }, + { "Microsoft.Extensions.Configuration.Binder", "5.0.0" }, + { "Microsoft.Extensions.Configuration.CommandLine", "5.0.0" }, + { "Microsoft.Extensions.Configuration.EnvironmentVariables", "5.0.0" }, + { "Microsoft.Extensions.Configuration.FileExtensions", "5.0.0" }, + { "Microsoft.Extensions.Configuration.Ini", "5.0.0" }, + { "Microsoft.Extensions.Configuration.Json", "5.0.0" }, + { "Microsoft.Extensions.Configuration.KeyPerFile", "5.0.0" }, + { "Microsoft.Extensions.Configuration.UserSecrets", "5.0.0" }, + { "Microsoft.Extensions.Configuration.Xml", "5.0.0" }, + { "Microsoft.Extensions.DependencyInjection", "5.0.0" }, + { "Microsoft.Extensions.DependencyInjection.Abstractions", "5.0.0" }, + { "Microsoft.Extensions.Diagnostics.HealthChecks", "5.0.0" }, + { "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions", "5.0.0" }, + { "Microsoft.Extensions.FileProviders.Abstractions", "5.0.0" }, + { "Microsoft.Extensions.FileProviders.Composite", "5.0.0" }, + { "Microsoft.Extensions.FileProviders.Embedded", "5.0.0" }, + { "Microsoft.Extensions.FileProviders.Physical", "5.0.0" }, + { "Microsoft.Extensions.FileSystemGlobbing", "5.0.0" }, + { "Microsoft.Extensions.Hosting", "5.0.0" }, + { "Microsoft.Extensions.Hosting.Abstractions", "5.0.0" }, + { "Microsoft.Extensions.Http", "5.0.0" }, + { "Microsoft.Extensions.Identity.Core", "5.0.0" }, + { "Microsoft.Extensions.Identity.Stores", "5.0.0" }, + { "Microsoft.Extensions.Localization", "5.0.0" }, + { "Microsoft.Extensions.Localization.Abstractions", "5.0.0" }, + { "Microsoft.Extensions.Logging", "5.0.0" }, + { "Microsoft.Extensions.Logging.Abstractions", "5.0.0" }, + { "Microsoft.Extensions.Logging.Configuration", "5.0.0" }, + { "Microsoft.Extensions.Logging.Console", "5.0.0" }, + { "Microsoft.Extensions.Logging.Debug", "5.0.0" }, + { "Microsoft.Extensions.Logging.EventLog", "5.0.0" }, + { "Microsoft.Extensions.Logging.EventSource", "5.0.0" }, + { "Microsoft.Extensions.Logging.TraceSource", "5.0.0" }, + { "Microsoft.Extensions.ObjectPool", "5.0.0" }, + { "Microsoft.Extensions.Options", "5.0.0" }, + { "Microsoft.Extensions.Options.ConfigurationExtensions", "5.0.0" }, + { "Microsoft.Extensions.Options.DataAnnotations", "5.0.0" }, + { "Microsoft.Extensions.Primitives", "5.0.0" }, + { "Microsoft.Extensions.WebEncoders", "5.0.0" }, + { "Microsoft.JSInterop", "5.0.0" }, + { "Microsoft.Net.Http.Headers", "5.0.0" }, + { "Microsoft.Win32.Registry", "5.0.0" }, + { "Microsoft.Win32.SystemEvents", "5.0.0" }, + { "System.Diagnostics.EventLog", "5.0.0" }, + { "System.Drawing.Common", "5.0.0" }, + { "System.IO.Pipelines", "5.0.0" }, + { "System.Security.AccessControl", "5.0.0" }, + { "System.Security.Cryptography.Cng", "5.0.0" }, + { "System.Security.Cryptography.Pkcs", "5.0.0" }, + { "System.Security.Cryptography.Xml", "5.0.0" }, + { "System.Security.Permissions", "5.0.0" }, + { "System.Security.Principal.Windows", "5.0.0" }, + { "System.Windows.Extensions", "5.0.0" }, + }; + + internal static FrameworkPackages WindowsDesktop { get; } = new(Net50, FrameworkNames.WindowsDesktopApp, NETCoreApp31.WindowsDesktop) + { + { "Microsoft.VisualBasic", "10.3.0" }, + { "Microsoft.Win32.Registry", "5.0.0" }, + { "Microsoft.Win32.Registry.AccessControl", "5.0.0" }, + { "Microsoft.Win32.SystemEvents", "5.0.0" }, + { "System.CodeDom", "5.0.0" }, + { "System.Configuration.ConfigurationManager", "5.0.0" }, + { "System.Diagnostics.EventLog", "5.0.0" }, + { "System.Diagnostics.PerformanceCounter", "5.0.0" }, + { "System.Drawing.Common", "5.0.0" }, + { "System.Formats.Asn1", "5.0.0" }, + { "System.IO.FileSystem.AccessControl", "5.0.0" }, + { "System.IO.Packaging", "5.0.0" }, + { "System.IO.Pipes.AccessControl", "5.0.0" }, + { "System.Resources.Extensions", "5.0.0" }, + { "System.Security.AccessControl", "5.0.0" }, + { "System.Security.Cryptography.Cng", "5.0.0" }, + { "System.Security.Cryptography.Pkcs", "5.0.0" }, + { "System.Security.Cryptography.ProtectedData", "5.0.0" }, + { "System.Security.Cryptography.Xml", "5.0.0" }, + { "System.Security.Permissions", "5.0.0" }, + { "System.Security.Principal.Windows", "5.0.0" }, + { "System.Threading.AccessControl", "5.0.0" }, + { "System.Windows.Extensions", "5.0.0" }, + }; + + internal static void Register() => FrameworkPackages.Register(Instance, AspNetCore, WindowsDesktop); + } +} diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.net6.0.cs b/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.net6.0.cs new file mode 100644 index 000000000000..dde6aa76815f --- /dev/null +++ b/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.net6.0.cs @@ -0,0 +1,183 @@ +namespace Microsoft.ComponentDetection.Detectors.NuGet; + +using static global::NuGet.Frameworks.FrameworkConstants.CommonFrameworks; + +/// +/// Framework packages for net6.0. +/// +internal partial class FrameworkPackages +{ + internal static class NETCoreApp60 + { + internal static FrameworkPackages Instance { get; } = new(Net60, FrameworkNames.NetCoreApp, NETCoreApp50.Instance) + { + { "System.Collections.Immutable", "6.0.0" }, + { "System.Diagnostics.DiagnosticSource", "6.0.0" }, + { "System.Formats.Asn1", "6.0.0" }, + { "System.Net.Http.Json", "6.0.0" }, + { "System.Reflection.Metadata", "6.0.0" }, + { "System.Runtime.CompilerServices.Unsafe", "6.0.0" }, + { "System.Security.AccessControl", "6.0.0" }, + { "System.Text.Encoding.CodePages", "6.0.0" }, + { "System.Text.Encodings.Web", "6.0.0" }, + { "System.Text.Json", "6.0.0" }, + { "System.Threading.Channels", "6.0.0" }, + { "System.Threading.Tasks.Dataflow", "6.0.0" }, + }; + + internal static FrameworkPackages AspNetCore { get; } = new(Net60, FrameworkNames.AspNetCoreApp, NETCoreApp50.AspNetCore) + { + { "Microsoft.AspNetCore", "6.0.0" }, + { "Microsoft.AspNetCore.Antiforgery", "6.0.0" }, + { "Microsoft.AspNetCore.Authentication", "6.0.0" }, + { "Microsoft.AspNetCore.Authentication.Abstractions", "6.0.0" }, + { "Microsoft.AspNetCore.Authentication.Cookies", "6.0.0" }, + { "Microsoft.AspNetCore.Authentication.Core", "6.0.0" }, + { "Microsoft.AspNetCore.Authentication.OAuth", "6.0.0" }, + { "Microsoft.AspNetCore.Authorization", "6.0.0" }, + { "Microsoft.AspNetCore.Authorization.Policy", "6.0.0" }, + { "Microsoft.AspNetCore.Components", "6.0.0" }, + { "Microsoft.AspNetCore.Components.Authorization", "6.0.0" }, + { "Microsoft.AspNetCore.Components.Forms", "6.0.0" }, + { "Microsoft.AspNetCore.Components.Server", "6.0.0" }, + { "Microsoft.AspNetCore.Components.Web", "6.0.0" }, + { "Microsoft.AspNetCore.Connections.Abstractions", "6.0.0" }, + { "Microsoft.AspNetCore.CookiePolicy", "6.0.0" }, + { "Microsoft.AspNetCore.Cors", "6.0.0" }, + { "Microsoft.AspNetCore.Cryptography.Internal", "6.0.0" }, + { "Microsoft.AspNetCore.Cryptography.KeyDerivation", "6.0.0" }, + { "Microsoft.AspNetCore.DataProtection", "6.0.0" }, + { "Microsoft.AspNetCore.DataProtection.Abstractions", "6.0.0" }, + { "Microsoft.AspNetCore.DataProtection.Extensions", "6.0.0" }, + { "Microsoft.AspNetCore.Diagnostics", "6.0.0" }, + { "Microsoft.AspNetCore.Diagnostics.Abstractions", "6.0.0" }, + { "Microsoft.AspNetCore.Diagnostics.HealthChecks", "6.0.0" }, + { "Microsoft.AspNetCore.HostFiltering", "6.0.0" }, + { "Microsoft.AspNetCore.Hosting", "6.0.0" }, + { "Microsoft.AspNetCore.Hosting.Abstractions", "6.0.0" }, + { "Microsoft.AspNetCore.Hosting.Server.Abstractions", "6.0.0" }, + { "Microsoft.AspNetCore.Html.Abstractions", "6.0.0" }, + { "Microsoft.AspNetCore.Http", "6.0.0" }, + { "Microsoft.AspNetCore.Http.Abstractions", "6.0.0" }, + { "Microsoft.AspNetCore.Http.Connections", "6.0.0" }, + { "Microsoft.AspNetCore.Http.Connections.Common", "6.0.0" }, + { "Microsoft.AspNetCore.Http.Extensions", "6.0.0" }, + { "Microsoft.AspNetCore.Http.Features", "6.0.0" }, + { "Microsoft.AspNetCore.Http.Results", "6.0.0" }, + { "Microsoft.AspNetCore.HttpLogging", "6.0.0" }, + { "Microsoft.AspNetCore.HttpOverrides", "6.0.0" }, + { "Microsoft.AspNetCore.HttpsPolicy", "6.0.0" }, + { "Microsoft.AspNetCore.Identity", "6.0.0" }, + { "Microsoft.AspNetCore.Localization", "6.0.0" }, + { "Microsoft.AspNetCore.Localization.Routing", "6.0.0" }, + { "Microsoft.AspNetCore.Metadata", "6.0.0" }, + { "Microsoft.AspNetCore.Mvc", "6.0.0" }, + { "Microsoft.AspNetCore.Mvc.Abstractions", "6.0.0" }, + { "Microsoft.AspNetCore.Mvc.ApiExplorer", "6.0.0" }, + { "Microsoft.AspNetCore.Mvc.Core", "6.0.0" }, + { "Microsoft.AspNetCore.Mvc.Cors", "6.0.0" }, + { "Microsoft.AspNetCore.Mvc.DataAnnotations", "6.0.0" }, + { "Microsoft.AspNetCore.Mvc.Formatters.Json", "6.0.0" }, + { "Microsoft.AspNetCore.Mvc.Formatters.Xml", "6.0.0" }, + { "Microsoft.AspNetCore.Mvc.Localization", "6.0.0" }, + { "Microsoft.AspNetCore.Mvc.Razor", "6.0.0" }, + { "Microsoft.AspNetCore.Mvc.RazorPages", "6.0.0" }, + { "Microsoft.AspNetCore.Mvc.TagHelpers", "6.0.0" }, + { "Microsoft.AspNetCore.Mvc.ViewFeatures", "6.0.0" }, + { "Microsoft.AspNetCore.Razor", "6.0.0" }, + { "Microsoft.AspNetCore.Razor.Runtime", "6.0.0" }, + { "Microsoft.AspNetCore.ResponseCaching", "6.0.0" }, + { "Microsoft.AspNetCore.ResponseCaching.Abstractions", "6.0.0" }, + { "Microsoft.AspNetCore.ResponseCompression", "6.0.0" }, + { "Microsoft.AspNetCore.Rewrite", "6.0.0" }, + { "Microsoft.AspNetCore.Routing", "6.0.0" }, + { "Microsoft.AspNetCore.Routing.Abstractions", "6.0.0" }, + { "Microsoft.AspNetCore.Server.HttpSys", "6.0.0" }, + { "Microsoft.AspNetCore.Server.IIS", "6.0.0" }, + { "Microsoft.AspNetCore.Server.IISIntegration", "6.0.0" }, + { "Microsoft.AspNetCore.Server.Kestrel", "6.0.0" }, + { "Microsoft.AspNetCore.Server.Kestrel.Core", "6.0.0" }, + { "Microsoft.AspNetCore.Server.Kestrel.Transport.Quic", "6.0.0" }, + { "Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets", "6.0.0" }, + { "Microsoft.AspNetCore.Session", "6.0.0" }, + { "Microsoft.AspNetCore.SignalR", "6.0.0" }, + { "Microsoft.AspNetCore.SignalR.Common", "6.0.0" }, + { "Microsoft.AspNetCore.SignalR.Core", "6.0.0" }, + { "Microsoft.AspNetCore.SignalR.Protocols.Json", "6.0.0" }, + { "Microsoft.AspNetCore.StaticFiles", "6.0.0" }, + { "Microsoft.AspNetCore.WebSockets", "6.0.0" }, + { "Microsoft.AspNetCore.WebUtilities", "6.0.0" }, + { "Microsoft.Extensions.Caching.Abstractions", "6.0.0" }, + { "Microsoft.Extensions.Caching.Memory", "6.0.0" }, + { "Microsoft.Extensions.Configuration", "6.0.0" }, + { "Microsoft.Extensions.Configuration.Abstractions", "6.0.0" }, + { "Microsoft.Extensions.Configuration.Binder", "6.0.0" }, + { "Microsoft.Extensions.Configuration.CommandLine", "6.0.0" }, + { "Microsoft.Extensions.Configuration.EnvironmentVariables", "6.0.0" }, + { "Microsoft.Extensions.Configuration.FileExtensions", "6.0.0" }, + { "Microsoft.Extensions.Configuration.Ini", "6.0.0" }, + { "Microsoft.Extensions.Configuration.Json", "6.0.0" }, + { "Microsoft.Extensions.Configuration.KeyPerFile", "6.0.0" }, + { "Microsoft.Extensions.Configuration.UserSecrets", "6.0.0" }, + { "Microsoft.Extensions.Configuration.Xml", "6.0.0" }, + { "Microsoft.Extensions.DependencyInjection", "6.0.0" }, + { "Microsoft.Extensions.DependencyInjection.Abstractions", "6.0.0" }, + { "Microsoft.Extensions.Diagnostics.HealthChecks", "6.0.0" }, + { "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions", "6.0.0" }, + { "Microsoft.Extensions.Features", "6.0.0" }, + { "Microsoft.Extensions.FileProviders.Abstractions", "6.0.0" }, + { "Microsoft.Extensions.FileProviders.Composite", "6.0.0" }, + { "Microsoft.Extensions.FileProviders.Embedded", "6.0.0" }, + { "Microsoft.Extensions.FileProviders.Physical", "6.0.0" }, + { "Microsoft.Extensions.FileSystemGlobbing", "6.0.0" }, + { "Microsoft.Extensions.Hosting", "6.0.0" }, + { "Microsoft.Extensions.Hosting.Abstractions", "6.0.0" }, + { "Microsoft.Extensions.Http", "6.0.0" }, + { "Microsoft.Extensions.Identity.Core", "6.0.0" }, + { "Microsoft.Extensions.Identity.Stores", "6.0.0" }, + { "Microsoft.Extensions.Localization", "6.0.0" }, + { "Microsoft.Extensions.Localization.Abstractions", "6.0.0" }, + { "Microsoft.Extensions.Logging", "6.0.0" }, + { "Microsoft.Extensions.Logging.Abstractions", "6.0.0" }, + { "Microsoft.Extensions.Logging.Configuration", "6.0.0" }, + { "Microsoft.Extensions.Logging.Console", "6.0.0" }, + { "Microsoft.Extensions.Logging.Debug", "6.0.0" }, + { "Microsoft.Extensions.Logging.EventLog", "6.0.0" }, + { "Microsoft.Extensions.Logging.EventSource", "6.0.0" }, + { "Microsoft.Extensions.Logging.TraceSource", "6.0.0" }, + { "Microsoft.Extensions.ObjectPool", "6.0.0" }, + { "Microsoft.Extensions.Options", "6.0.0" }, + { "Microsoft.Extensions.Options.ConfigurationExtensions", "6.0.0" }, + { "Microsoft.Extensions.Options.DataAnnotations", "6.0.0" }, + { "Microsoft.Extensions.Primitives", "6.0.0" }, + { "Microsoft.Extensions.WebEncoders", "6.0.0" }, + { "Microsoft.JSInterop", "6.0.0" }, + { "Microsoft.Net.Http.Headers", "6.0.0" }, + { "System.Diagnostics.EventLog", "6.0.0" }, + { "System.IO.Pipelines", "6.0.0" }, + { "System.Security.Cryptography.Pkcs", "6.0.0" }, + { "System.Security.Cryptography.Xml", "6.0.0" }, + }; + + internal static FrameworkPackages WindowsDesktop { get; } = new(Net60, FrameworkNames.WindowsDesktopApp, NETCoreApp50.WindowsDesktop) + { + { "Microsoft.Win32.Registry.AccessControl", "6.0.0" }, + { "Microsoft.Win32.SystemEvents", "6.0.0" }, + { "System.CodeDom", "6.0.0" }, + { "System.Configuration.ConfigurationManager", "6.0.0" }, + { "System.Diagnostics.EventLog", "6.0.0" }, + { "System.Diagnostics.PerformanceCounter", "6.0.0" }, + { "System.Drawing.Common", "6.0.0" }, + { "System.IO.Packaging", "6.0.0" }, + { "System.Resources.Extensions", "6.0.0" }, + { "System.Security.Cryptography.Pkcs", "6.0.0" }, + { "System.Security.Cryptography.ProtectedData", "6.0.0" }, + { "System.Security.Cryptography.Xml", "6.0.0" }, + { "System.Security.Permissions", "6.0.0" }, + { "System.Threading.AccessControl", "6.0.0" }, + { "System.Windows.Extensions", "6.0.0" }, + }; + + internal static void Register() => FrameworkPackages.Register(Instance, AspNetCore, WindowsDesktop); + } +} diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.net7.0.cs b/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.net7.0.cs new file mode 100644 index 000000000000..4e8d49af3f8e --- /dev/null +++ b/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.net7.0.cs @@ -0,0 +1,186 @@ +namespace Microsoft.ComponentDetection.Detectors.NuGet; + +using static global::NuGet.Frameworks.FrameworkConstants.CommonFrameworks; + +/// +/// Framework packages for net7.0. +/// +internal partial class FrameworkPackages +{ + internal static class NETCoreApp70 + { + internal static FrameworkPackages Instance { get; } = new(Net70, FrameworkNames.NetCoreApp, NETCoreApp60.Instance) + { + { "System.Collections.Immutable", "7.0.0" }, + { "System.Diagnostics.DiagnosticSource", "7.0.2" }, + { "System.Formats.Asn1", "7.0.0" }, + { "System.Net.Http.Json", "7.0.1" }, + { "System.Reflection.Metadata", "7.0.2" }, + { "System.Security.AccessControl", "6.0.1" }, + { "System.Text.Encoding.CodePages", "7.0.0" }, + { "System.Text.Encodings.Web", "7.0.0" }, + { "System.Text.Json", "7.0.4" }, + { "System.Threading.Channels", "7.0.0" }, + { "System.Threading.Tasks.Dataflow", "7.0.0" }, + }; + + internal static FrameworkPackages AspNetCore { get; } = new(Net70, FrameworkNames.AspNetCoreApp, NETCoreApp60.AspNetCore) + { + { "Microsoft.AspNetCore", "7.0.0" }, + { "Microsoft.AspNetCore.Antiforgery", "7.0.0" }, + { "Microsoft.AspNetCore.Authentication", "7.0.0" }, + { "Microsoft.AspNetCore.Authentication.Abstractions", "7.0.0" }, + { "Microsoft.AspNetCore.Authentication.Cookies", "7.0.0" }, + { "Microsoft.AspNetCore.Authentication.Core", "7.0.0" }, + { "Microsoft.AspNetCore.Authentication.OAuth", "7.0.0" }, + { "Microsoft.AspNetCore.Authorization", "7.0.0" }, + { "Microsoft.AspNetCore.Authorization.Policy", "7.0.0" }, + { "Microsoft.AspNetCore.Components", "7.0.0" }, + { "Microsoft.AspNetCore.Components.Authorization", "7.0.0" }, + { "Microsoft.AspNetCore.Components.Forms", "7.0.0" }, + { "Microsoft.AspNetCore.Components.Server", "7.0.0" }, + { "Microsoft.AspNetCore.Components.Web", "7.0.0" }, + { "Microsoft.AspNetCore.Connections.Abstractions", "7.0.0" }, + { "Microsoft.AspNetCore.CookiePolicy", "7.0.0" }, + { "Microsoft.AspNetCore.Cors", "7.0.0" }, + { "Microsoft.AspNetCore.Cryptography.Internal", "7.0.0" }, + { "Microsoft.AspNetCore.Cryptography.KeyDerivation", "7.0.0" }, + { "Microsoft.AspNetCore.DataProtection", "7.0.0" }, + { "Microsoft.AspNetCore.DataProtection.Abstractions", "7.0.0" }, + { "Microsoft.AspNetCore.DataProtection.Extensions", "7.0.0" }, + { "Microsoft.AspNetCore.Diagnostics", "7.0.0" }, + { "Microsoft.AspNetCore.Diagnostics.Abstractions", "7.0.0" }, + { "Microsoft.AspNetCore.Diagnostics.HealthChecks", "7.0.0" }, + { "Microsoft.AspNetCore.HostFiltering", "7.0.0" }, + { "Microsoft.AspNetCore.Hosting", "7.0.0" }, + { "Microsoft.AspNetCore.Hosting.Abstractions", "7.0.0" }, + { "Microsoft.AspNetCore.Hosting.Server.Abstractions", "7.0.0" }, + { "Microsoft.AspNetCore.Html.Abstractions", "7.0.0" }, + { "Microsoft.AspNetCore.Http", "7.0.0" }, + { "Microsoft.AspNetCore.Http.Abstractions", "7.0.0" }, + { "Microsoft.AspNetCore.Http.Connections", "7.0.0" }, + { "Microsoft.AspNetCore.Http.Connections.Common", "7.0.0" }, + { "Microsoft.AspNetCore.Http.Extensions", "7.0.0" }, + { "Microsoft.AspNetCore.Http.Features", "7.0.0" }, + { "Microsoft.AspNetCore.Http.Results", "7.0.0" }, + { "Microsoft.AspNetCore.HttpLogging", "7.0.0" }, + { "Microsoft.AspNetCore.HttpOverrides", "7.0.0" }, + { "Microsoft.AspNetCore.HttpsPolicy", "7.0.0" }, + { "Microsoft.AspNetCore.Identity", "7.0.0" }, + { "Microsoft.AspNetCore.Localization", "7.0.0" }, + { "Microsoft.AspNetCore.Localization.Routing", "7.0.0" }, + { "Microsoft.AspNetCore.Metadata", "7.0.0" }, + { "Microsoft.AspNetCore.Mvc", "7.0.0" }, + { "Microsoft.AspNetCore.Mvc.Abstractions", "7.0.0" }, + { "Microsoft.AspNetCore.Mvc.ApiExplorer", "7.0.0" }, + { "Microsoft.AspNetCore.Mvc.Core", "7.0.0" }, + { "Microsoft.AspNetCore.Mvc.Cors", "7.0.0" }, + { "Microsoft.AspNetCore.Mvc.DataAnnotations", "7.0.0" }, + { "Microsoft.AspNetCore.Mvc.Formatters.Json", "7.0.0" }, + { "Microsoft.AspNetCore.Mvc.Formatters.Xml", "7.0.0" }, + { "Microsoft.AspNetCore.Mvc.Localization", "7.0.0" }, + { "Microsoft.AspNetCore.Mvc.Razor", "7.0.0" }, + { "Microsoft.AspNetCore.Mvc.RazorPages", "7.0.0" }, + { "Microsoft.AspNetCore.Mvc.TagHelpers", "7.0.0" }, + { "Microsoft.AspNetCore.Mvc.ViewFeatures", "7.0.0" }, + { "Microsoft.AspNetCore.OutputCaching", "7.0.0" }, + { "Microsoft.AspNetCore.RateLimiting", "7.0.0" }, + { "Microsoft.AspNetCore.Razor", "7.0.0" }, + { "Microsoft.AspNetCore.Razor.Runtime", "7.0.0" }, + { "Microsoft.AspNetCore.RequestDecompression", "7.0.0" }, + { "Microsoft.AspNetCore.ResponseCaching", "7.0.0" }, + { "Microsoft.AspNetCore.ResponseCaching.Abstractions", "7.0.0" }, + { "Microsoft.AspNetCore.ResponseCompression", "7.0.0" }, + { "Microsoft.AspNetCore.Rewrite", "7.0.0" }, + { "Microsoft.AspNetCore.Routing", "7.0.0" }, + { "Microsoft.AspNetCore.Routing.Abstractions", "7.0.0" }, + { "Microsoft.AspNetCore.Server.HttpSys", "7.0.0" }, + { "Microsoft.AspNetCore.Server.IIS", "7.0.0" }, + { "Microsoft.AspNetCore.Server.IISIntegration", "7.0.0" }, + { "Microsoft.AspNetCore.Server.Kestrel", "7.0.0" }, + { "Microsoft.AspNetCore.Server.Kestrel.Core", "7.0.0" }, + { "Microsoft.AspNetCore.Server.Kestrel.Transport.Quic", "7.0.0" }, + { "Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets", "7.0.0" }, + { "Microsoft.AspNetCore.Session", "7.0.0" }, + { "Microsoft.AspNetCore.SignalR", "7.0.0" }, + { "Microsoft.AspNetCore.SignalR.Common", "7.0.0" }, + { "Microsoft.AspNetCore.SignalR.Core", "7.0.0" }, + { "Microsoft.AspNetCore.SignalR.Protocols.Json", "7.0.0" }, + { "Microsoft.AspNetCore.StaticFiles", "7.0.0" }, + { "Microsoft.AspNetCore.WebSockets", "7.0.0" }, + { "Microsoft.AspNetCore.WebUtilities", "7.0.0" }, + { "Microsoft.Extensions.Caching.Abstractions", "7.0.0" }, + { "Microsoft.Extensions.Caching.Memory", "7.0.0" }, + { "Microsoft.Extensions.Configuration", "7.0.0" }, + { "Microsoft.Extensions.Configuration.Abstractions", "7.0.0" }, + { "Microsoft.Extensions.Configuration.Binder", "7.0.0" }, + { "Microsoft.Extensions.Configuration.CommandLine", "7.0.0" }, + { "Microsoft.Extensions.Configuration.EnvironmentVariables", "7.0.0" }, + { "Microsoft.Extensions.Configuration.FileExtensions", "7.0.0" }, + { "Microsoft.Extensions.Configuration.Ini", "7.0.0" }, + { "Microsoft.Extensions.Configuration.Json", "7.0.0" }, + { "Microsoft.Extensions.Configuration.KeyPerFile", "7.0.0" }, + { "Microsoft.Extensions.Configuration.UserSecrets", "7.0.0" }, + { "Microsoft.Extensions.Configuration.Xml", "7.0.0" }, + { "Microsoft.Extensions.DependencyInjection", "7.0.0" }, + { "Microsoft.Extensions.DependencyInjection.Abstractions", "7.0.0" }, + { "Microsoft.Extensions.Diagnostics.HealthChecks", "7.0.0" }, + { "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions", "7.0.0" }, + { "Microsoft.Extensions.Features", "7.0.0" }, + { "Microsoft.Extensions.FileProviders.Abstractions", "7.0.0" }, + { "Microsoft.Extensions.FileProviders.Composite", "7.0.0" }, + { "Microsoft.Extensions.FileProviders.Embedded", "7.0.0" }, + { "Microsoft.Extensions.FileProviders.Physical", "7.0.0" }, + { "Microsoft.Extensions.FileSystemGlobbing", "7.0.0" }, + { "Microsoft.Extensions.Hosting", "7.0.0" }, + { "Microsoft.Extensions.Hosting.Abstractions", "7.0.0" }, + { "Microsoft.Extensions.Http", "7.0.0" }, + { "Microsoft.Extensions.Identity.Core", "7.0.0" }, + { "Microsoft.Extensions.Identity.Stores", "7.0.0" }, + { "Microsoft.Extensions.Localization", "7.0.0" }, + { "Microsoft.Extensions.Localization.Abstractions", "7.0.0" }, + { "Microsoft.Extensions.Logging", "7.0.0" }, + { "Microsoft.Extensions.Logging.Abstractions", "7.0.0" }, + { "Microsoft.Extensions.Logging.Configuration", "7.0.0" }, + { "Microsoft.Extensions.Logging.Console", "7.0.0" }, + { "Microsoft.Extensions.Logging.Debug", "7.0.0" }, + { "Microsoft.Extensions.Logging.EventLog", "7.0.0" }, + { "Microsoft.Extensions.Logging.EventSource", "7.0.0" }, + { "Microsoft.Extensions.Logging.TraceSource", "7.0.0" }, + { "Microsoft.Extensions.ObjectPool", "7.0.0" }, + { "Microsoft.Extensions.Options", "7.0.0" }, + { "Microsoft.Extensions.Options.ConfigurationExtensions", "7.0.0" }, + { "Microsoft.Extensions.Options.DataAnnotations", "7.0.0" }, + { "Microsoft.Extensions.Primitives", "7.0.0" }, + { "Microsoft.Extensions.WebEncoders", "7.0.0" }, + { "Microsoft.JSInterop", "7.0.0" }, + { "Microsoft.Net.Http.Headers", "7.0.0" }, + { "System.Diagnostics.EventLog", "7.0.0" }, + { "System.IO.Pipelines", "7.0.0" }, + { "System.Security.Cryptography.Pkcs", "7.0.0" }, + { "System.Security.Cryptography.Xml", "7.0.0" }, + { "System.Threading.RateLimiting", "7.0.0" }, + }; + + internal static FrameworkPackages WindowsDesktop { get; } = new(Net70, FrameworkNames.WindowsDesktopApp, NETCoreApp60.WindowsDesktop) + { + { "Microsoft.Win32.Registry.AccessControl", "7.0.0" }, + { "Microsoft.Win32.SystemEvents", "7.0.0" }, + { "System.CodeDom", "7.0.0" }, + { "System.Configuration.ConfigurationManager", "7.0.0" }, + { "System.Diagnostics.EventLog", "7.0.0" }, + { "System.Diagnostics.PerformanceCounter", "7.0.0" }, + { "System.Drawing.Common", "7.0.0" }, + { "System.IO.Packaging", "7.0.0" }, + { "System.Resources.Extensions", "7.0.0" }, + { "System.Security.Cryptography.Pkcs", "7.0.0" }, + { "System.Security.Cryptography.ProtectedData", "7.0.0" }, + { "System.Security.Cryptography.Xml", "7.0.0" }, + { "System.Security.Permissions", "7.0.0" }, + { "System.Threading.AccessControl", "7.0.0" }, + { "System.Windows.Extensions", "7.0.0" }, + }; + + internal static void Register() => FrameworkPackages.Register(Instance, AspNetCore, WindowsDesktop); + } +} diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.net8.0.cs b/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.net8.0.cs new file mode 100644 index 000000000000..f329bcdf7aac --- /dev/null +++ b/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.net8.0.cs @@ -0,0 +1,190 @@ +namespace Microsoft.ComponentDetection.Detectors.NuGet; + +using static global::NuGet.Frameworks.FrameworkConstants.CommonFrameworks; + +/// +/// Framework packages for net8.0. +/// +internal partial class FrameworkPackages +{ + internal static class NETCoreApp80 + { + internal static FrameworkPackages Instance { get; } = new(Net80, FrameworkNames.NetCoreApp, NETCoreApp70.Instance) + { + { "System.Collections.Immutable", "8.0.0" }, + { "System.Diagnostics.DiagnosticSource", "8.0.1" }, + { "System.Formats.Asn1", "8.0.1" }, + { "System.Net.Http.Json", "8.0.1" }, + { "System.Reflection.Metadata", "8.0.1" }, + { "System.Text.Encoding.CodePages", "8.0.0" }, + { "System.Text.Encodings.Web", "8.0.0" }, + { "System.Text.Json", "8.0.5" }, + { "System.Threading.Channels", "8.0.0" }, + { "System.Threading.Tasks.Dataflow", "8.0.1" }, + }; + + internal static FrameworkPackages AspNetCore { get; } = new(Net80, FrameworkNames.AspNetCoreApp, NETCoreApp70.AspNetCore) + { + { "Microsoft.AspNetCore", "8.0.0" }, + { "Microsoft.AspNetCore.Antiforgery", "8.0.0" }, + { "Microsoft.AspNetCore.Authentication", "8.0.0" }, + { "Microsoft.AspNetCore.Authentication.Abstractions", "8.0.0" }, + { "Microsoft.AspNetCore.Authentication.BearerToken", "8.0.0" }, + { "Microsoft.AspNetCore.Authentication.Cookies", "8.0.0" }, + { "Microsoft.AspNetCore.Authentication.Core", "8.0.0" }, + { "Microsoft.AspNetCore.Authentication.OAuth", "8.0.0" }, + { "Microsoft.AspNetCore.Authorization", "8.0.0" }, + { "Microsoft.AspNetCore.Authorization.Policy", "8.0.0" }, + { "Microsoft.AspNetCore.Components", "8.0.0" }, + { "Microsoft.AspNetCore.Components.Authorization", "8.0.0" }, + { "Microsoft.AspNetCore.Components.Endpoints", "8.0.0" }, + { "Microsoft.AspNetCore.Components.Forms", "8.0.0" }, + { "Microsoft.AspNetCore.Components.Server", "8.0.0" }, + { "Microsoft.AspNetCore.Components.Web", "8.0.0" }, + { "Microsoft.AspNetCore.Connections.Abstractions", "8.0.0" }, + { "Microsoft.AspNetCore.CookiePolicy", "8.0.0" }, + { "Microsoft.AspNetCore.Cors", "8.0.0" }, + { "Microsoft.AspNetCore.Cryptography.Internal", "8.0.0" }, + { "Microsoft.AspNetCore.Cryptography.KeyDerivation", "8.0.0" }, + { "Microsoft.AspNetCore.DataProtection", "8.0.0" }, + { "Microsoft.AspNetCore.DataProtection.Abstractions", "8.0.0" }, + { "Microsoft.AspNetCore.DataProtection.Extensions", "8.0.0" }, + { "Microsoft.AspNetCore.Diagnostics", "8.0.0" }, + { "Microsoft.AspNetCore.Diagnostics.Abstractions", "8.0.0" }, + { "Microsoft.AspNetCore.Diagnostics.HealthChecks", "8.0.0" }, + { "Microsoft.AspNetCore.HostFiltering", "8.0.0" }, + { "Microsoft.AspNetCore.Hosting", "8.0.0" }, + { "Microsoft.AspNetCore.Hosting.Abstractions", "8.0.0" }, + { "Microsoft.AspNetCore.Hosting.Server.Abstractions", "8.0.0" }, + { "Microsoft.AspNetCore.Html.Abstractions", "8.0.0" }, + { "Microsoft.AspNetCore.Http", "8.0.0" }, + { "Microsoft.AspNetCore.Http.Abstractions", "8.0.0" }, + { "Microsoft.AspNetCore.Http.Connections", "8.0.0" }, + { "Microsoft.AspNetCore.Http.Connections.Common", "8.0.0" }, + { "Microsoft.AspNetCore.Http.Extensions", "8.0.0" }, + { "Microsoft.AspNetCore.Http.Features", "8.0.0" }, + { "Microsoft.AspNetCore.Http.Results", "8.0.0" }, + { "Microsoft.AspNetCore.HttpLogging", "8.0.0" }, + { "Microsoft.AspNetCore.HttpOverrides", "8.0.0" }, + { "Microsoft.AspNetCore.HttpsPolicy", "8.0.0" }, + { "Microsoft.AspNetCore.Identity", "8.0.0" }, + { "Microsoft.AspNetCore.Localization", "8.0.0" }, + { "Microsoft.AspNetCore.Localization.Routing", "8.0.0" }, + { "Microsoft.AspNetCore.Metadata", "8.0.0" }, + { "Microsoft.AspNetCore.Mvc", "8.0.0" }, + { "Microsoft.AspNetCore.Mvc.Abstractions", "8.0.0" }, + { "Microsoft.AspNetCore.Mvc.ApiExplorer", "8.0.0" }, + { "Microsoft.AspNetCore.Mvc.Core", "8.0.0" }, + { "Microsoft.AspNetCore.Mvc.Cors", "8.0.0" }, + { "Microsoft.AspNetCore.Mvc.DataAnnotations", "8.0.0" }, + { "Microsoft.AspNetCore.Mvc.Formatters.Json", "8.0.0" }, + { "Microsoft.AspNetCore.Mvc.Formatters.Xml", "8.0.0" }, + { "Microsoft.AspNetCore.Mvc.Localization", "8.0.0" }, + { "Microsoft.AspNetCore.Mvc.Razor", "8.0.0" }, + { "Microsoft.AspNetCore.Mvc.RazorPages", "8.0.0" }, + { "Microsoft.AspNetCore.Mvc.TagHelpers", "8.0.0" }, + { "Microsoft.AspNetCore.Mvc.ViewFeatures", "8.0.0" }, + { "Microsoft.AspNetCore.OutputCaching", "8.0.0" }, + { "Microsoft.AspNetCore.RateLimiting", "8.0.0" }, + { "Microsoft.AspNetCore.Razor", "8.0.0" }, + { "Microsoft.AspNetCore.Razor.Runtime", "8.0.0" }, + { "Microsoft.AspNetCore.RequestDecompression", "8.0.0" }, + { "Microsoft.AspNetCore.ResponseCaching", "8.0.0" }, + { "Microsoft.AspNetCore.ResponseCaching.Abstractions", "8.0.0" }, + { "Microsoft.AspNetCore.ResponseCompression", "8.0.0" }, + { "Microsoft.AspNetCore.Rewrite", "8.0.0" }, + { "Microsoft.AspNetCore.Routing", "8.0.0" }, + { "Microsoft.AspNetCore.Routing.Abstractions", "8.0.0" }, + { "Microsoft.AspNetCore.Server.HttpSys", "8.0.0" }, + { "Microsoft.AspNetCore.Server.IIS", "8.0.0" }, + { "Microsoft.AspNetCore.Server.IISIntegration", "8.0.0" }, + { "Microsoft.AspNetCore.Server.Kestrel", "8.0.0" }, + { "Microsoft.AspNetCore.Server.Kestrel.Core", "8.0.0" }, + { "Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes", "8.0.0" }, + { "Microsoft.AspNetCore.Server.Kestrel.Transport.Quic", "8.0.0" }, + { "Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets", "8.0.0" }, + { "Microsoft.AspNetCore.Session", "8.0.0" }, + { "Microsoft.AspNetCore.SignalR", "8.0.0" }, + { "Microsoft.AspNetCore.SignalR.Common", "8.0.0" }, + { "Microsoft.AspNetCore.SignalR.Core", "8.0.0" }, + { "Microsoft.AspNetCore.SignalR.Protocols.Json", "8.0.0" }, + { "Microsoft.AspNetCore.StaticFiles", "8.0.0" }, + { "Microsoft.AspNetCore.WebSockets", "8.0.0" }, + { "Microsoft.AspNetCore.WebUtilities", "8.0.0" }, + { "Microsoft.Extensions.Caching.Abstractions", "8.0.0" }, + { "Microsoft.Extensions.Caching.Memory", "8.0.0" }, + { "Microsoft.Extensions.Configuration", "8.0.0" }, + { "Microsoft.Extensions.Configuration.Abstractions", "8.0.0" }, + { "Microsoft.Extensions.Configuration.Binder", "8.0.0" }, + { "Microsoft.Extensions.Configuration.CommandLine", "8.0.0" }, + { "Microsoft.Extensions.Configuration.EnvironmentVariables", "8.0.0" }, + { "Microsoft.Extensions.Configuration.FileExtensions", "8.0.0" }, + { "Microsoft.Extensions.Configuration.Ini", "8.0.0" }, + { "Microsoft.Extensions.Configuration.Json", "8.0.0" }, + { "Microsoft.Extensions.Configuration.KeyPerFile", "8.0.0" }, + { "Microsoft.Extensions.Configuration.UserSecrets", "8.0.0" }, + { "Microsoft.Extensions.Configuration.Xml", "8.0.0" }, + { "Microsoft.Extensions.DependencyInjection", "8.0.0" }, + { "Microsoft.Extensions.DependencyInjection.Abstractions", "8.0.0" }, + { "Microsoft.Extensions.Diagnostics", "8.0.0" }, + { "Microsoft.Extensions.Diagnostics.Abstractions", "8.0.0" }, + { "Microsoft.Extensions.Diagnostics.HealthChecks", "8.0.0" }, + { "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions", "8.0.0" }, + { "Microsoft.Extensions.Features", "8.0.0" }, + { "Microsoft.Extensions.FileProviders.Abstractions", "8.0.0" }, + { "Microsoft.Extensions.FileProviders.Composite", "8.0.0" }, + { "Microsoft.Extensions.FileProviders.Embedded", "8.0.0" }, + { "Microsoft.Extensions.FileProviders.Physical", "8.0.0" }, + { "Microsoft.Extensions.FileSystemGlobbing", "8.0.0" }, + { "Microsoft.Extensions.Hosting", "8.0.0" }, + { "Microsoft.Extensions.Hosting.Abstractions", "8.0.0" }, + { "Microsoft.Extensions.Http", "8.0.0" }, + { "Microsoft.Extensions.Identity.Core", "8.0.0" }, + { "Microsoft.Extensions.Identity.Stores", "8.0.0" }, + { "Microsoft.Extensions.Localization", "8.0.0" }, + { "Microsoft.Extensions.Localization.Abstractions", "8.0.0" }, + { "Microsoft.Extensions.Logging", "8.0.0" }, + { "Microsoft.Extensions.Logging.Abstractions", "8.0.0" }, + { "Microsoft.Extensions.Logging.Configuration", "8.0.0" }, + { "Microsoft.Extensions.Logging.Console", "8.0.0" }, + { "Microsoft.Extensions.Logging.Debug", "8.0.0" }, + { "Microsoft.Extensions.Logging.EventLog", "8.0.0" }, + { "Microsoft.Extensions.Logging.EventSource", "8.0.0" }, + { "Microsoft.Extensions.Logging.TraceSource", "8.0.0" }, + { "Microsoft.Extensions.ObjectPool", "8.0.0" }, + { "Microsoft.Extensions.Options", "8.0.0" }, + { "Microsoft.Extensions.Options.ConfigurationExtensions", "8.0.0" }, + { "Microsoft.Extensions.Options.DataAnnotations", "8.0.0" }, + { "Microsoft.Extensions.Primitives", "8.0.0" }, + { "Microsoft.Extensions.WebEncoders", "8.0.0" }, + { "Microsoft.JSInterop", "8.0.0" }, + { "Microsoft.Net.Http.Headers", "8.0.0" }, + { "System.Diagnostics.EventLog", "8.0.0" }, + { "System.IO.Pipelines", "8.0.0" }, + { "System.Security.Cryptography.Pkcs", "8.0.0" }, + { "System.Security.Cryptography.Xml", "8.0.0" }, + { "System.Threading.RateLimiting", "8.0.0" }, + }; + + internal static FrameworkPackages WindowsDesktop { get; } = new(Net80, FrameworkNames.WindowsDesktopApp, NETCoreApp70.WindowsDesktop) + { + { "Microsoft.Win32.Registry.AccessControl", "8.0.0" }, + { "Microsoft.Win32.SystemEvents", "8.0.0" }, + { "System.CodeDom", "8.0.0" }, + { "System.Configuration.ConfigurationManager", "8.0.0" }, + { "System.Diagnostics.EventLog", "8.0.0" }, + { "System.Diagnostics.PerformanceCounter", "8.0.0" }, + { "System.Drawing.Common", "8.0.0" }, + { "System.IO.Packaging", "8.0.0" }, + { "System.Resources.Extensions", "8.0.0" }, + { "System.Security.Cryptography.Pkcs", "8.0.0" }, + { "System.Security.Cryptography.ProtectedData", "8.0.0" }, + { "System.Security.Cryptography.Xml", "8.0.0" }, + { "System.Security.Permissions", "8.0.0" }, + { "System.Threading.AccessControl", "8.0.0" }, + { "System.Windows.Extensions", "8.0.0" }, + }; + + internal static void Register() => FrameworkPackages.Register(Instance, AspNetCore, WindowsDesktop); + } +} diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.net9.0.cs b/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.net9.0.cs new file mode 100644 index 000000000000..a8e88a5526cc --- /dev/null +++ b/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.net9.0.cs @@ -0,0 +1,196 @@ +namespace Microsoft.ComponentDetection.Detectors.NuGet; + +using System; +using global::NuGet.Frameworks; + +/// +/// Framework packages for net9.0. +/// +internal partial class FrameworkPackages +{ + internal static class NETCoreApp90 + { + private static NuGetFramework Net90 { get; } = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.NetCoreApp, new Version(9, 0)); + + internal static FrameworkPackages Instance { get; } = new(Net90, FrameworkNames.NetCoreApp, NETCoreApp80.Instance) + { + { "Microsoft.VisualBasic", "10.4.0" }, + { "System.Buffers", "5.0.0" }, + { "System.Collections.Immutable", "9.0.0" }, + { "System.Diagnostics.DiagnosticSource", "9.0.0" }, + { "System.Formats.Asn1", "9.0.0" }, + { "System.Formats.Tar", "9.0.0" }, + { "System.IO.Pipelines", "9.0.0" }, + { "System.Memory", "5.0.0" }, + { "System.Net.Http.Json", "9.0.0" }, + { "System.Numerics.Vectors", "5.0.0" }, + { "System.Private.Uri", "4.3.2" }, + { "System.Reflection.DispatchProxy", "6.0.0" }, + { "System.Reflection.Metadata", "9.0.0" }, + { "System.Runtime.CompilerServices.Unsafe", "7.0.0" }, + { "System.Text.Encoding.CodePages", "9.0.0" }, + { "System.Text.Encodings.Web", "9.0.0" }, + { "System.Text.Json", "9.0.0" }, + { "System.Threading.Channels", "9.0.0" }, + { "System.Threading.Tasks.Dataflow", "9.0.0" }, + { "System.Threading.Tasks.Extensions", "5.0.0" }, + { "System.Xml.XPath.XDocument", "5.0.0" }, + }; + + internal static FrameworkPackages AspNetCore { get; } = new(Net90, FrameworkNames.AspNetCoreApp, NETCoreApp80.AspNetCore) + { + { "Microsoft.AspNetCore", "9.0.0" }, + { "Microsoft.AspNetCore.Antiforgery", "9.0.0" }, + { "Microsoft.AspNetCore.Authentication", "9.0.0" }, + { "Microsoft.AspNetCore.Authentication.Abstractions", "9.0.0" }, + { "Microsoft.AspNetCore.Authentication.BearerToken", "9.0.0" }, + { "Microsoft.AspNetCore.Authentication.Cookies", "9.0.0" }, + { "Microsoft.AspNetCore.Authentication.Core", "9.0.0" }, + { "Microsoft.AspNetCore.Authentication.OAuth", "9.0.0" }, + { "Microsoft.AspNetCore.Authorization", "9.0.0" }, + { "Microsoft.AspNetCore.Authorization.Policy", "9.0.0" }, + { "Microsoft.AspNetCore.Components", "9.0.0" }, + { "Microsoft.AspNetCore.Components.Authorization", "9.0.0" }, + { "Microsoft.AspNetCore.Components.Endpoints", "9.0.0" }, + { "Microsoft.AspNetCore.Components.Forms", "9.0.0" }, + { "Microsoft.AspNetCore.Components.Server", "9.0.0" }, + { "Microsoft.AspNetCore.Components.Web", "9.0.0" }, + { "Microsoft.AspNetCore.Connections.Abstractions", "9.0.0" }, + { "Microsoft.AspNetCore.CookiePolicy", "9.0.0" }, + { "Microsoft.AspNetCore.Cors", "9.0.0" }, + { "Microsoft.AspNetCore.Cryptography.Internal", "9.0.0" }, + { "Microsoft.AspNetCore.Cryptography.KeyDerivation", "9.0.0" }, + { "Microsoft.AspNetCore.DataProtection", "9.0.0" }, + { "Microsoft.AspNetCore.DataProtection.Abstractions", "9.0.0" }, + { "Microsoft.AspNetCore.DataProtection.Extensions", "9.0.0" }, + { "Microsoft.AspNetCore.Diagnostics", "9.0.0" }, + { "Microsoft.AspNetCore.Diagnostics.Abstractions", "9.0.0" }, + { "Microsoft.AspNetCore.Diagnostics.HealthChecks", "9.0.0" }, + { "Microsoft.AspNetCore.HostFiltering", "9.0.0" }, + { "Microsoft.AspNetCore.Hosting", "9.0.0" }, + { "Microsoft.AspNetCore.Hosting.Abstractions", "9.0.0" }, + { "Microsoft.AspNetCore.Hosting.Server.Abstractions", "9.0.0" }, + { "Microsoft.AspNetCore.Html.Abstractions", "9.0.0" }, + { "Microsoft.AspNetCore.Http", "9.0.0" }, + { "Microsoft.AspNetCore.Http.Abstractions", "9.0.0" }, + { "Microsoft.AspNetCore.Http.Connections", "9.0.0" }, + { "Microsoft.AspNetCore.Http.Connections.Common", "9.0.0" }, + { "Microsoft.AspNetCore.Http.Extensions", "9.0.0" }, + { "Microsoft.AspNetCore.Http.Features", "9.0.0" }, + { "Microsoft.AspNetCore.Http.Results", "9.0.0" }, + { "Microsoft.AspNetCore.HttpLogging", "9.0.0" }, + { "Microsoft.AspNetCore.HttpOverrides", "9.0.0" }, + { "Microsoft.AspNetCore.HttpsPolicy", "9.0.0" }, + { "Microsoft.AspNetCore.Identity", "9.0.0" }, + { "Microsoft.AspNetCore.Localization", "9.0.0" }, + { "Microsoft.AspNetCore.Localization.Routing", "9.0.0" }, + { "Microsoft.AspNetCore.Metadata", "9.0.0" }, + { "Microsoft.AspNetCore.Mvc", "9.0.0" }, + { "Microsoft.AspNetCore.Mvc.Abstractions", "9.0.0" }, + { "Microsoft.AspNetCore.Mvc.ApiExplorer", "9.0.0" }, + { "Microsoft.AspNetCore.Mvc.Core", "9.0.0" }, + { "Microsoft.AspNetCore.Mvc.Cors", "9.0.0" }, + { "Microsoft.AspNetCore.Mvc.DataAnnotations", "9.0.0" }, + { "Microsoft.AspNetCore.Mvc.Formatters.Json", "9.0.0" }, + { "Microsoft.AspNetCore.Mvc.Formatters.Xml", "9.0.0" }, + { "Microsoft.AspNetCore.Mvc.Localization", "9.0.0" }, + { "Microsoft.AspNetCore.Mvc.Razor", "9.0.0" }, + { "Microsoft.AspNetCore.Mvc.RazorPages", "9.0.0" }, + { "Microsoft.AspNetCore.Mvc.TagHelpers", "9.0.0" }, + { "Microsoft.AspNetCore.Mvc.ViewFeatures", "9.0.0" }, + { "Microsoft.AspNetCore.OutputCaching", "9.0.0" }, + { "Microsoft.AspNetCore.RateLimiting", "9.0.0" }, + { "Microsoft.AspNetCore.Razor", "9.0.0" }, + { "Microsoft.AspNetCore.Razor.Runtime", "9.0.0" }, + { "Microsoft.AspNetCore.RequestDecompression", "9.0.0" }, + { "Microsoft.AspNetCore.ResponseCaching", "9.0.0" }, + { "Microsoft.AspNetCore.ResponseCaching.Abstractions", "9.0.0" }, + { "Microsoft.AspNetCore.ResponseCompression", "9.0.0" }, + { "Microsoft.AspNetCore.Rewrite", "9.0.0" }, + { "Microsoft.AspNetCore.Routing", "9.0.0" }, + { "Microsoft.AspNetCore.Routing.Abstractions", "9.0.0" }, + { "Microsoft.AspNetCore.Server.HttpSys", "9.0.0" }, + { "Microsoft.AspNetCore.Server.IIS", "9.0.0" }, + { "Microsoft.AspNetCore.Server.IISIntegration", "9.0.0" }, + { "Microsoft.AspNetCore.Server.Kestrel", "9.0.0" }, + { "Microsoft.AspNetCore.Server.Kestrel.Core", "9.0.0" }, + { "Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes", "9.0.0" }, + { "Microsoft.AspNetCore.Server.Kestrel.Transport.Quic", "9.0.0" }, + { "Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets", "9.0.0" }, + { "Microsoft.AspNetCore.Session", "9.0.0" }, + { "Microsoft.AspNetCore.SignalR", "9.0.0" }, + { "Microsoft.AspNetCore.SignalR.Common", "9.0.0" }, + { "Microsoft.AspNetCore.SignalR.Core", "9.0.0" }, + { "Microsoft.AspNetCore.SignalR.Protocols.Json", "9.0.0" }, + { "Microsoft.AspNetCore.StaticAssets", "9.0.0" }, + { "Microsoft.AspNetCore.StaticFiles", "9.0.0" }, + { "Microsoft.AspNetCore.WebSockets", "9.0.0" }, + { "Microsoft.AspNetCore.WebUtilities", "9.0.0" }, + { "Microsoft.Extensions.Caching.Abstractions", "9.0.0" }, + { "Microsoft.Extensions.Caching.Memory", "9.0.0" }, + { "Microsoft.Extensions.Configuration", "9.0.0" }, + { "Microsoft.Extensions.Configuration.Abstractions", "9.0.0" }, + { "Microsoft.Extensions.Configuration.Binder", "9.0.0" }, + { "Microsoft.Extensions.Configuration.CommandLine", "9.0.0" }, + { "Microsoft.Extensions.Configuration.EnvironmentVariables", "9.0.0" }, + { "Microsoft.Extensions.Configuration.FileExtensions", "9.0.0" }, + { "Microsoft.Extensions.Configuration.Ini", "9.0.0" }, + { "Microsoft.Extensions.Configuration.Json", "9.0.0" }, + { "Microsoft.Extensions.Configuration.KeyPerFile", "9.0.0" }, + { "Microsoft.Extensions.Configuration.UserSecrets", "9.0.0" }, + { "Microsoft.Extensions.Configuration.Xml", "9.0.0" }, + { "Microsoft.Extensions.DependencyInjection", "9.0.0" }, + { "Microsoft.Extensions.DependencyInjection.Abstractions", "9.0.0" }, + { "Microsoft.Extensions.Diagnostics", "9.0.0" }, + { "Microsoft.Extensions.Diagnostics.Abstractions", "9.0.0" }, + { "Microsoft.Extensions.Diagnostics.HealthChecks", "9.0.0" }, + { "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions", "9.0.0" }, + { "Microsoft.Extensions.Features", "9.0.0" }, + { "Microsoft.Extensions.FileProviders.Abstractions", "9.0.0" }, + { "Microsoft.Extensions.FileProviders.Composite", "9.0.0" }, + { "Microsoft.Extensions.FileProviders.Embedded", "9.0.0" }, + { "Microsoft.Extensions.FileProviders.Physical", "9.0.0" }, + { "Microsoft.Extensions.FileSystemGlobbing", "9.0.0" }, + { "Microsoft.Extensions.Hosting", "9.0.0" }, + { "Microsoft.Extensions.Hosting.Abstractions", "9.0.0" }, + { "Microsoft.Extensions.Http", "9.0.0" }, + { "Microsoft.Extensions.Identity.Core", "9.0.0" }, + { "Microsoft.Extensions.Identity.Stores", "9.0.0" }, + { "Microsoft.Extensions.Localization", "9.0.0" }, + { "Microsoft.Extensions.Localization.Abstractions", "9.0.0" }, + { "Microsoft.Extensions.Logging", "9.0.0" }, + { "Microsoft.Extensions.Logging.Abstractions", "9.0.0" }, + { "Microsoft.Extensions.Logging.Configuration", "9.0.0" }, + { "Microsoft.Extensions.Logging.Console", "9.0.0" }, + { "Microsoft.Extensions.Logging.Debug", "9.0.0" }, + { "Microsoft.Extensions.Logging.EventLog", "9.0.0" }, + { "Microsoft.Extensions.Logging.EventSource", "9.0.0" }, + { "Microsoft.Extensions.Logging.TraceSource", "9.0.0" }, + { "Microsoft.Extensions.ObjectPool", "9.0.0" }, + { "Microsoft.Extensions.Options", "9.0.0" }, + { "Microsoft.Extensions.Options.ConfigurationExtensions", "9.0.0" }, + { "Microsoft.Extensions.Options.DataAnnotations", "9.0.0" }, + { "Microsoft.Extensions.Primitives", "9.0.0" }, + { "Microsoft.Extensions.WebEncoders", "9.0.0" }, + { "Microsoft.JSInterop", "9.0.0" }, + { "Microsoft.Net.Http.Headers", "9.0.0" }, + { "System.Diagnostics.EventLog", "9.0.0" }, + { "System.Security.Cryptography.Pkcs", "8.0.1" }, + { "System.Security.Cryptography.Xml", "9.0.0" }, + { "System.Threading.RateLimiting", "9.0.0" }, + }; + + internal static FrameworkPackages WindowsDesktop { get; } = new(Net90, FrameworkNames.WindowsDesktopApp, NETCoreApp80.WindowsDesktop) + { + { "System.Configuration.ConfigurationManager", "8.0.1" }, + { "System.Diagnostics.EventLog", "8.0.1" }, + { "System.Diagnostics.PerformanceCounter", "8.0.1" }, + { "System.Drawing.Common", "8.0.10" }, + { "System.IO.Packaging", "8.0.1" }, + { "System.Security.Cryptography.Pkcs", "8.0.1" }, + { "System.Security.Cryptography.Xml", "8.0.2" }, + }; + + internal static void Register() => FrameworkPackages.Register(Instance, AspNetCore, WindowsDesktop); + } +} diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.netcoreapp2.0.cs b/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.netcoreapp2.0.cs new file mode 100644 index 000000000000..69272e1ad888 --- /dev/null +++ b/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.netcoreapp2.0.cs @@ -0,0 +1,213 @@ +namespace Microsoft.ComponentDetection.Detectors.NuGet; + +using static global::NuGet.Frameworks.FrameworkConstants.CommonFrameworks; + +/// +/// Framework packages for .NETCoreApp,Version=v2.0. +/// +internal partial class FrameworkPackages +{ + internal static class NETCoreApp20 + { + internal static FrameworkPackages Instance { get; } = new(NetCoreApp20, FrameworkNames.NetCoreApp, NETStandard20.Instance) + { + { "Microsoft.CSharp", "4.4.0" }, + { "Microsoft.NETCore.App", "2.0.0" }, + { "Microsoft.VisualBasic", "10.2.0" }, + { "Microsoft.Win32.Registry", "4.4.0" }, + { "runtime.any.System.Collections", "4.3.0" }, + { "runtime.any.System.Diagnostics.Tools", "4.3.0" }, + { "runtime.any.System.Diagnostics.Tracing", "4.3.0" }, + { "runtime.any.System.Globalization", "4.3.0" }, + { "runtime.any.System.Globalization.Calendars", "4.3.0" }, + { "runtime.any.System.IO", "4.3.0" }, + { "runtime.any.System.Reflection", "4.3.0" }, + { "runtime.any.System.Reflection.Extensions", "4.3.0" }, + { "runtime.any.System.Reflection.Primitives", "4.3.0" }, + { "runtime.any.System.Resources.ResourceManager", "4.3.0" }, + { "runtime.any.System.Runtime", "4.3.1" }, + { "runtime.any.System.Runtime.Handles", "4.3.0" }, + { "runtime.any.System.Runtime.InteropServices", "4.3.0" }, + { "runtime.any.System.Text.Encoding", "4.3.0" }, + { "runtime.any.System.Text.Encoding.Extensions", "4.3.0" }, + { "runtime.any.System.Threading.Tasks", "4.3.0" }, + { "runtime.any.System.Threading.Timer", "4.3.0" }, + { "runtime.aot.System.Collections", "4.3.0" }, + { "runtime.aot.System.Diagnostics.Tools", "4.3.0" }, + { "runtime.aot.System.Diagnostics.Tracing", "4.3.0" }, + { "runtime.aot.System.Globalization", "4.3.0" }, + { "runtime.aot.System.Globalization.Calendars", "4.3.0" }, + { "runtime.aot.System.IO", "4.3.0" }, + { "runtime.aot.System.Reflection", "4.3.0" }, + { "runtime.aot.System.Reflection.Extensions", "4.3.0" }, + { "runtime.aot.System.Reflection.Primitives", "4.3.0" }, + { "runtime.aot.System.Resources.ResourceManager", "4.3.0" }, + { "runtime.aot.System.Runtime", "4.3.1" }, + { "runtime.aot.System.Runtime.Handles", "4.3.0" }, + { "runtime.aot.System.Runtime.InteropServices", "4.3.0" }, + { "runtime.aot.System.Text.Encoding", "4.3.0" }, + { "runtime.aot.System.Text.Encoding.Extensions", "4.3.0" }, + { "runtime.aot.System.Threading.Tasks", "4.3.0" }, + { "runtime.aot.System.Threading.Timer", "4.3.0" }, + { "runtime.debian.8-x64.runtime.native.System", "4.3.1" }, + { "runtime.debian.8-x64.runtime.native.System.IO.Compression", "4.3.2" }, + { "runtime.debian.8-x64.runtime.native.System.Net.Http", "4.3.1" }, + { "runtime.debian.8-x64.runtime.native.System.Net.Security", "4.3.1" }, + { "runtime.debian.8-x64.runtime.native.System.Security.Cryptography", "4.3.4" }, + { "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl", "4.3.3" }, + { "runtime.debian.9-x64.runtime.native.System", "4.3.1" }, + { "runtime.debian.9-x64.runtime.native.System.IO.Compression", "4.3.2" }, + { "runtime.debian.9-x64.runtime.native.System.Net.Http", "4.3.1" }, + { "runtime.debian.9-x64.runtime.native.System.Net.Security", "4.3.1" }, + { "runtime.debian.9-x64.runtime.native.System.Security.Cryptography", "4.3.4" }, + { "runtime.debian.9-x64.runtime.native.System.Security.Cryptography.OpenSsl", "4.3.3" }, + { "runtime.fedora.23-x64.runtime.native.System", "4.3.1" }, + { "runtime.fedora.23-x64.runtime.native.System.IO.Compression", "4.3.2" }, + { "runtime.fedora.23-x64.runtime.native.System.Net.Http", "4.3.1" }, + { "runtime.fedora.23-x64.runtime.native.System.Net.Security", "4.3.1" }, + { "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography", "4.3.4" }, + { "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl", "4.3.3" }, + { "runtime.fedora.24-x64.runtime.native.System", "4.3.1" }, + { "runtime.fedora.24-x64.runtime.native.System.IO.Compression", "4.3.2" }, + { "runtime.fedora.24-x64.runtime.native.System.Net.Http", "4.3.1" }, + { "runtime.fedora.24-x64.runtime.native.System.Net.Security", "4.3.1" }, + { "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography", "4.3.4" }, + { "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl", "4.3.3" }, + { "runtime.fedora.27-x64.runtime.native.System", "4.3.1" }, + { "runtime.fedora.27-x64.runtime.native.System.IO.Compression", "4.3.2" }, + { "runtime.fedora.27-x64.runtime.native.System.Net.Http", "4.3.1" }, + { "runtime.fedora.27-x64.runtime.native.System.Net.Security", "4.3.1" }, + { "runtime.fedora.27-x64.runtime.native.System.Security.Cryptography", "4.3.4" }, + { "runtime.fedora.27-x64.runtime.native.System.Security.Cryptography.OpenSsl", "4.3.3" }, + { "runtime.fedora.28-x64.runtime.native.System", "4.3.1" }, + { "runtime.fedora.28-x64.runtime.native.System.IO.Compression", "4.3.2" }, + { "runtime.fedora.28-x64.runtime.native.System.Net.Http", "4.3.1" }, + { "runtime.fedora.28-x64.runtime.native.System.Net.Security", "4.3.1" }, + { "runtime.fedora.28-x64.runtime.native.System.Security.Cryptography", "4.3.4" }, + { "runtime.fedora.28-x64.runtime.native.System.Security.Cryptography.OpenSsl", "4.3.3" }, + { "runtime.native.System.Security.Cryptography", "4.3.4" }, + { "runtime.native.System.Security.Cryptography.Apple", "4.3.1" }, + { "runtime.native.System.Security.Cryptography.OpenSsl", "4.3.3" }, + { "runtime.opensuse.13.2-x64.runtime.native.System", "4.3.1" }, + { "runtime.opensuse.13.2-x64.runtime.native.System.IO.Compression", "4.3.2" }, + { "runtime.opensuse.13.2-x64.runtime.native.System.Net.Http", "4.3.1" }, + { "runtime.opensuse.13.2-x64.runtime.native.System.Net.Security", "4.3.1" }, + { "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography", "4.3.4" }, + { "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl", "4.3.3" }, + { "runtime.opensuse.42.1-x64.runtime.native.System", "4.3.1" }, + { "runtime.opensuse.42.1-x64.runtime.native.System.IO.Compression", "4.3.2" }, + { "runtime.opensuse.42.1-x64.runtime.native.System.Net.Http", "4.3.1" }, + { "runtime.opensuse.42.1-x64.runtime.native.System.Net.Security", "4.3.1" }, + { "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography", "4.3.4" }, + { "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl", "4.3.3" }, + { "runtime.opensuse.42.3-x64.runtime.native.System", "4.3.1" }, + { "runtime.opensuse.42.3-x64.runtime.native.System.IO.Compression", "4.3.2" }, + { "runtime.opensuse.42.3-x64.runtime.native.System.Net.Http", "4.3.1" }, + { "runtime.opensuse.42.3-x64.runtime.native.System.Net.Security", "4.3.1" }, + { "runtime.opensuse.42.3-x64.runtime.native.System.Security.Cryptography", "4.3.4" }, + { "runtime.opensuse.42.3-x64.runtime.native.System.Security.Cryptography.OpenSsl", "4.3.3" }, + { "runtime.osx.10.10-x64.runtime.native.System", "4.3.1" }, + { "runtime.osx.10.10-x64.runtime.native.System.IO.Compression", "4.3.2" }, + { "runtime.osx.10.10-x64.runtime.native.System.Net.Http", "4.3.1" }, + { "runtime.osx.10.10-x64.runtime.native.System.Net.Security", "4.3.1" }, + { "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography", "4.3.4" }, + { "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple", "4.3.1" }, + { "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl", "4.3.3" }, + { "runtime.rhel.7-x64.runtime.native.System", "4.3.1" }, + { "runtime.rhel.7-x64.runtime.native.System.IO.Compression", "4.3.2" }, + { "runtime.rhel.7-x64.runtime.native.System.Net.Http", "4.3.1" }, + { "runtime.rhel.7-x64.runtime.native.System.Net.Security", "4.3.1" }, + { "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography", "4.3.4" }, + { "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl", "4.3.3" }, + { "runtime.ubuntu.14.04-x64.runtime.native.System", "4.3.1" }, + { "runtime.ubuntu.14.04-x64.runtime.native.System.IO.Compression", "4.3.2" }, + { "runtime.ubuntu.14.04-x64.runtime.native.System.Net.Http", "4.3.1" }, + { "runtime.ubuntu.14.04-x64.runtime.native.System.Net.Security", "4.3.1" }, + { "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography", "4.3.4" }, + { "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl", "4.3.3" }, + { "runtime.ubuntu.16.04-x64.runtime.native.System", "4.3.1" }, + { "runtime.ubuntu.16.04-x64.runtime.native.System.IO.Compression", "4.3.2" }, + { "runtime.ubuntu.16.04-x64.runtime.native.System.Net.Http", "4.3.1" }, + { "runtime.ubuntu.16.04-x64.runtime.native.System.Net.Security", "4.3.1" }, + { "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography", "4.3.4" }, + { "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl", "4.3.3" }, + { "runtime.ubuntu.16.10-x64.runtime.native.System", "4.3.1" }, + { "runtime.ubuntu.16.10-x64.runtime.native.System.IO.Compression", "4.3.2" }, + { "runtime.ubuntu.16.10-x64.runtime.native.System.Net.Http", "4.3.1" }, + { "runtime.ubuntu.16.10-x64.runtime.native.System.Net.Security", "4.3.1" }, + { "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography", "4.3.4" }, + { "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl", "4.3.3" }, + { "runtime.ubuntu.18.04-x64.runtime.native.System", "4.3.1" }, + { "runtime.ubuntu.18.04-x64.runtime.native.System.IO.Compression", "4.3.2" }, + { "runtime.ubuntu.18.04-x64.runtime.native.System.Net.Http", "4.3.1" }, + { "runtime.ubuntu.18.04-x64.runtime.native.System.Net.Security", "4.3.1" }, + { "runtime.ubuntu.18.04-x64.runtime.native.System.Security.Cryptography", "4.3.4" }, + { "runtime.ubuntu.18.04-x64.runtime.native.System.Security.Cryptography.OpenSsl", "4.3.3" }, + { "runtime.unix.Microsoft.Win32.Primitives", "4.3.0" }, + { "runtime.unix.System.Console", "4.3.1" }, + { "runtime.unix.System.Diagnostics.Debug", "4.3.0" }, + { "runtime.unix.System.IO.FileSystem", "4.3.0" }, + { "runtime.unix.System.Net.Primitives", "4.3.0" }, + { "runtime.unix.System.Net.Sockets", "4.3.0" }, + { "runtime.unix.System.Private.Uri", "4.3.1" }, + { "runtime.unix.System.Runtime.Extensions", "4.3.1" }, + { "runtime.win.Microsoft.Win32.Primitives", "4.3.0" }, + { "runtime.win.System.Console", "4.3.1" }, + { "runtime.win.System.Diagnostics.Debug", "4.3.0" }, + { "runtime.win.System.IO.FileSystem", "4.3.0" }, + { "runtime.win.System.Net.Primitives", "4.3.0" }, + { "runtime.win.System.Net.Sockets", "4.3.0" }, + { "runtime.win.System.Runtime.Extensions", "4.3.1" }, + { "runtime.win10-arm-aot.runtime.native.System.IO.Compression", "4.0.1" }, + { "runtime.win10-arm64.runtime.native.System.IO.Compression", "4.3.2" }, + { "runtime.win10-x64-aot.runtime.native.System.IO.Compression", "4.0.1" }, + { "runtime.win10-x86-aot.runtime.native.System.IO.Compression", "4.0.1" }, + { "runtime.win7-x64.runtime.native.System.IO.Compression", "4.3.2" }, + { "runtime.win7-x86.runtime.native.System.IO.Compression", "4.3.2" }, + { "runtime.win7.System.Private.Uri", "4.3.1" }, + { "runtime.win8-arm.runtime.native.System.IO.Compression", "4.3.2" }, + { "System.Buffers", "4.4.0" }, + { "System.Collections.Concurrent", "4.3.0" }, + { "System.Collections.Immutable", "1.4.0" }, + { "System.ComponentModel", "4.3.0" }, + { "System.ComponentModel.Annotations", "4.4.0" }, + { "System.ComponentModel.EventBasedAsync", "4.3.0" }, + { "System.Diagnostics.Contracts", "4.3.0" }, + { "System.Diagnostics.DiagnosticSource", "4.4.1" }, + { "System.Dynamic.Runtime", "4.3.0" }, + { "System.IO.FileSystem.AccessControl", "4.4.0" }, + { "System.Linq.Parallel", "4.3.0" }, + { "System.Linq.Queryable", "4.3.0" }, + { "System.Net.Requests", "4.3.0" }, + { "System.Net.WebHeaderCollection", "4.3.0" }, + { "System.Numerics.Vectors", "4.4.0" }, + { "System.ObjectModel", "4.3.0" }, + { "System.Private.DataContractSerialization", "4.3.0" }, + { "System.Private.Uri", "4.3.0" }, + { "System.Reflection.DispatchProxy", "4.4.0" }, + { "System.Reflection.Emit", "4.7.0" }, + { "System.Reflection.Emit.ILGeneration", "4.7.0" }, + { "System.Reflection.Emit.Lightweight", "4.7.0" }, + { "System.Reflection.Metadata", "1.5.0" }, + { "System.Reflection.TypeExtensions", "4.7.0" }, + { "System.Runtime.InteropServices.WindowsRuntime", "4.3.0" }, + { "System.Runtime.Loader", "4.3.0" }, + { "System.Runtime.Numerics", "4.3.0" }, + { "System.Runtime.Serialization.Json", "4.3.0" }, + { "System.Security.AccessControl", "4.4.0" }, + { "System.Security.Cryptography.Cng", "4.4.0" }, + { "System.Security.Cryptography.OpenSsl", "4.4.0" }, + { "System.Security.Principal", "4.3.0" }, + { "System.Security.Principal.Windows", "4.4.0" }, + { "System.Text.RegularExpressions", "4.3.1" }, + { "System.Threading", "4.3.0" }, + { "System.Threading.Tasks.Dataflow", "4.8.0" }, + { "System.Threading.Tasks.Extensions", "4.4.0" }, + { "System.Threading.Tasks.Parallel", "4.3.0" }, + { "System.Xml.XDocument", "4.3.0" }, + { "System.Xml.XmlSerializer", "4.3.0" }, + }; + + internal static void Register() => FrameworkPackages.Register(Instance); + } +} diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.netcoreapp2.1.cs b/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.netcoreapp2.1.cs new file mode 100644 index 000000000000..a046281fb09e --- /dev/null +++ b/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.netcoreapp2.1.cs @@ -0,0 +1,39 @@ +namespace Microsoft.ComponentDetection.Detectors.NuGet; + +using static global::NuGet.Frameworks.FrameworkConstants.CommonFrameworks; + +/// +/// Framework packages for .NETCoreApp,Version=v2.1. +/// +internal partial class FrameworkPackages +{ + internal static class NETCoreApp21 + { + internal static FrameworkPackages Instance { get; } = new(NetCoreApp21, FrameworkNames.NetCoreApp, NETCoreApp20.Instance) + { + { "Microsoft.CSharp", "4.5.0" }, + { "Microsoft.NETCore.App", "2.1.0" }, + { "Microsoft.VisualBasic", "10.3.0" }, + { "Microsoft.Win32.Registry", "4.5.0" }, + { "System.Buffers", "4.5.0" }, + { "System.Collections.Immutable", "1.5.0" }, + { "System.ComponentModel.Annotations", "4.5.0" }, + { "System.Diagnostics.DiagnosticSource", "4.5.0" }, + { "System.IO.FileSystem.AccessControl", "4.5.0" }, + { "System.IO.Pipes.AccessControl", "4.5.0" }, + { "System.Memory", "4.5.5" }, + { "System.Numerics.Vectors", "4.5.0" }, + { "System.Reflection.DispatchProxy", "4.5.0" }, + { "System.Reflection.Metadata", "1.6.0" }, + { "System.Security.AccessControl", "4.5.0" }, + { "System.Security.Cryptography.Cng", "4.5.2" }, + { "System.Security.Cryptography.OpenSsl", "4.5.0" }, + { "System.Security.Principal.Windows", "4.5.0" }, + { "System.Threading.Tasks.Dataflow", "4.9.0" }, + { "System.Threading.Tasks.Extensions", "4.5.4" }, + { "System.ValueTuple", "4.5.0" }, + }; + + internal static void Register() => FrameworkPackages.Register(Instance); + } +} diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.netcoreapp2.2.cs b/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.netcoreapp2.2.cs new file mode 100644 index 000000000000..a3a28741fe16 --- /dev/null +++ b/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.netcoreapp2.2.cs @@ -0,0 +1,17 @@ +namespace Microsoft.ComponentDetection.Detectors.NuGet; + +using static global::NuGet.Frameworks.FrameworkConstants.CommonFrameworks; + +/// +/// Framework packages for .NETCoreApp,Version=v2.2. +/// +internal partial class FrameworkPackages +{ + internal static class NETCoreApp22 + { + // .NETCore 2.2 was the same as .NETCore 2.1 + internal static FrameworkPackages Instance { get; } = new(NetCoreApp22, FrameworkNames.NetCoreApp, NETCoreApp21.Instance); + + internal static void Register() => FrameworkPackages.Register(Instance); + } +} diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.netcoreapp3.0.cs b/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.netcoreapp3.0.cs new file mode 100644 index 000000000000..079a9a0cd678 --- /dev/null +++ b/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.netcoreapp3.0.cs @@ -0,0 +1,197 @@ +namespace Microsoft.ComponentDetection.Detectors.NuGet; + +using static global::NuGet.Frameworks.FrameworkConstants.CommonFrameworks; + +/// +/// Framework packages for .NETCoreApp,Version=v3.0. +/// +internal partial class FrameworkPackages +{ + internal static class NETCoreApp30 + { + internal static FrameworkPackages Instance { get; } = new(NetCoreApp30, FrameworkNames.NetCoreApp, NETCoreApp21.Instance) + { + { "Microsoft.CSharp", "4.6.0" }, + { "Microsoft.Win32.Registry", "4.6.0" }, + { "System.Buffers", "4.5.1" }, + { "System.Collections.Immutable", "1.6.0" }, + { "System.ComponentModel.Annotations", "4.6.0" }, + { "System.Data.DataSetExtensions", "4.5.0" }, + { "System.Diagnostics.DiagnosticSource", "4.6.0" }, + { "System.IO.FileSystem.AccessControl", "4.6.0" }, + { "System.IO.Pipes.AccessControl", "4.6.0" }, + { "System.Reflection.DispatchProxy", "4.6.0" }, + { "System.Reflection.Metadata", "1.7.0" }, + { "System.Runtime.CompilerServices.Unsafe", "4.6.0" }, + { "System.Runtime.WindowsRuntime", "4.6.0" }, + { "System.Runtime.WindowsRuntime.UI.Xaml", "4.6.0" }, + { "System.Security.AccessControl", "4.6.0" }, + { "System.Security.Cryptography.Cng", "4.6.0" }, + { "System.Security.Cryptography.OpenSsl", "4.6.0" }, + { "System.Security.Cryptography.Xml", "4.4.0" }, + { "System.Security.Principal.Windows", "4.6.0" }, + { "System.Text.Encoding.CodePages", "4.6.0" }, + { "System.Text.Encodings.Web", "4.6.0" }, + { "System.Text.Json", "4.6.0" }, + { "System.Threading.Channels", "4.6.0" }, + { "System.Threading.Tasks.Dataflow", "4.10.0" }, + }; + + internal static FrameworkPackages AspNetCore { get; } = new(NetCoreApp30, FrameworkNames.AspNetCoreApp) + { + { "Microsoft.AspNetCore", "3.0.0" }, + { "Microsoft.AspNetCore.Antiforgery", "3.0.0" }, + { "Microsoft.AspNetCore.Authentication", "3.0.0" }, + { "Microsoft.AspNetCore.Authentication.Abstractions", "3.0.0" }, + { "Microsoft.AspNetCore.Authentication.Cookies", "3.0.0" }, + { "Microsoft.AspNetCore.Authentication.Core", "3.0.0" }, + { "Microsoft.AspNetCore.Authentication.OAuth", "3.0.0" }, + { "Microsoft.AspNetCore.Authorization", "3.0.0" }, + { "Microsoft.AspNetCore.Authorization.Policy", "3.0.0" }, + { "Microsoft.AspNetCore.Components", "3.0.0" }, + { "Microsoft.AspNetCore.Components.Authorization", "3.0.0" }, + { "Microsoft.AspNetCore.Components.Forms", "3.0.0" }, + { "Microsoft.AspNetCore.Components.Server", "3.0.0" }, + { "Microsoft.AspNetCore.Components.Web", "3.0.0" }, + { "Microsoft.AspNetCore.Connections.Abstractions", "3.0.0" }, + { "Microsoft.AspNetCore.CookiePolicy", "3.0.0" }, + { "Microsoft.AspNetCore.Cors", "3.0.0" }, + { "Microsoft.AspNetCore.Cryptography.Internal", "3.0.0" }, + { "Microsoft.AspNetCore.Cryptography.KeyDerivation", "3.0.0" }, + { "Microsoft.AspNetCore.DataProtection", "3.0.0" }, + { "Microsoft.AspNetCore.DataProtection.Abstractions", "3.0.0" }, + { "Microsoft.AspNetCore.DataProtection.Extensions", "3.0.0" }, + { "Microsoft.AspNetCore.Diagnostics", "3.0.0" }, + { "Microsoft.AspNetCore.Diagnostics.Abstractions", "3.0.0" }, + { "Microsoft.AspNetCore.Diagnostics.HealthChecks", "3.0.0" }, + { "Microsoft.AspNetCore.HostFiltering", "3.0.0" }, + { "Microsoft.AspNetCore.Hosting", "3.0.0" }, + { "Microsoft.AspNetCore.Hosting.Abstractions", "3.0.0" }, + { "Microsoft.AspNetCore.Hosting.Server.Abstractions", "3.0.0" }, + { "Microsoft.AspNetCore.Html.Abstractions", "3.0.0" }, + { "Microsoft.AspNetCore.Http", "3.0.0" }, + { "Microsoft.AspNetCore.Http.Abstractions", "3.0.0" }, + { "Microsoft.AspNetCore.Http.Connections", "3.0.0" }, + { "Microsoft.AspNetCore.Http.Connections.Common", "3.0.0" }, + { "Microsoft.AspNetCore.Http.Extensions", "3.0.0" }, + { "Microsoft.AspNetCore.Http.Features", "3.0.0" }, + { "Microsoft.AspNetCore.HttpOverrides", "3.0.0" }, + { "Microsoft.AspNetCore.HttpsPolicy", "3.0.0" }, + { "Microsoft.AspNetCore.Identity", "3.0.0" }, + { "Microsoft.AspNetCore.Localization", "3.0.0" }, + { "Microsoft.AspNetCore.Localization.Routing", "3.0.0" }, + { "Microsoft.AspNetCore.Metadata", "3.0.0" }, + { "Microsoft.AspNetCore.Mvc", "3.0.0" }, + { "Microsoft.AspNetCore.Mvc.Abstractions", "3.0.0" }, + { "Microsoft.AspNetCore.Mvc.ApiExplorer", "3.0.0" }, + { "Microsoft.AspNetCore.Mvc.Core", "3.0.0" }, + { "Microsoft.AspNetCore.Mvc.Cors", "3.0.0" }, + { "Microsoft.AspNetCore.Mvc.DataAnnotations", "3.0.0" }, + { "Microsoft.AspNetCore.Mvc.Formatters.Json", "3.0.0" }, + { "Microsoft.AspNetCore.Mvc.Formatters.Xml", "3.0.0" }, + { "Microsoft.AspNetCore.Mvc.Localization", "3.0.0" }, + { "Microsoft.AspNetCore.Mvc.Razor", "3.0.0" }, + { "Microsoft.AspNetCore.Mvc.RazorPages", "3.0.0" }, + { "Microsoft.AspNetCore.Mvc.TagHelpers", "3.0.0" }, + { "Microsoft.AspNetCore.Mvc.ViewFeatures", "3.0.0" }, + { "Microsoft.AspNetCore.Razor", "3.0.0" }, + { "Microsoft.AspNetCore.Razor.Runtime", "3.0.0" }, + { "Microsoft.AspNetCore.ResponseCaching", "3.0.0" }, + { "Microsoft.AspNetCore.ResponseCaching.Abstractions", "3.0.0" }, + { "Microsoft.AspNetCore.ResponseCompression", "3.0.0" }, + { "Microsoft.AspNetCore.Rewrite", "3.0.0" }, + { "Microsoft.AspNetCore.Routing", "3.0.0" }, + { "Microsoft.AspNetCore.Routing.Abstractions", "3.0.0" }, + { "Microsoft.AspNetCore.Server.HttpSys", "3.0.0" }, + { "Microsoft.AspNetCore.Server.IIS", "3.0.0" }, + { "Microsoft.AspNetCore.Server.IISIntegration", "3.0.0" }, + { "Microsoft.AspNetCore.Server.Kestrel", "3.0.0" }, + { "Microsoft.AspNetCore.Server.Kestrel.Core", "3.0.0" }, + { "Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets", "3.0.0" }, + { "Microsoft.AspNetCore.Session", "3.0.0" }, + { "Microsoft.AspNetCore.SignalR", "3.0.0" }, + { "Microsoft.AspNetCore.SignalR.Common", "3.0.0" }, + { "Microsoft.AspNetCore.SignalR.Core", "3.0.0" }, + { "Microsoft.AspNetCore.SignalR.Protocols.Json", "3.0.0" }, + { "Microsoft.AspNetCore.StaticFiles", "3.0.0" }, + { "Microsoft.AspNetCore.WebSockets", "3.0.0" }, + { "Microsoft.AspNetCore.WebUtilities", "3.0.0" }, + { "Microsoft.Extensions.Caching.Abstractions", "3.0.0" }, + { "Microsoft.Extensions.Caching.Memory", "3.0.0" }, + { "Microsoft.Extensions.Configuration", "3.0.0" }, + { "Microsoft.Extensions.Configuration.Abstractions", "3.0.0" }, + { "Microsoft.Extensions.Configuration.Binder", "3.0.0" }, + { "Microsoft.Extensions.Configuration.CommandLine", "3.0.0" }, + { "Microsoft.Extensions.Configuration.EnvironmentVariables", "3.0.0" }, + { "Microsoft.Extensions.Configuration.FileExtensions", "3.0.0" }, + { "Microsoft.Extensions.Configuration.Ini", "3.0.0" }, + { "Microsoft.Extensions.Configuration.Json", "3.0.0" }, + { "Microsoft.Extensions.Configuration.KeyPerFile", "3.0.0" }, + { "Microsoft.Extensions.Configuration.UserSecrets", "3.0.0" }, + { "Microsoft.Extensions.Configuration.Xml", "3.0.0" }, + { "Microsoft.Extensions.DependencyInjection", "3.0.0" }, + { "Microsoft.Extensions.DependencyInjection.Abstractions", "3.0.0" }, + { "Microsoft.Extensions.Diagnostics.HealthChecks", "3.0.0" }, + { "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions", "3.0.0" }, + { "Microsoft.Extensions.FileProviders.Abstractions", "3.0.0" }, + { "Microsoft.Extensions.FileProviders.Composite", "3.0.0" }, + { "Microsoft.Extensions.FileProviders.Embedded", "3.0.0" }, + { "Microsoft.Extensions.FileProviders.Physical", "3.0.0" }, + { "Microsoft.Extensions.FileSystemGlobbing", "3.0.0" }, + { "Microsoft.Extensions.Hosting", "3.0.0" }, + { "Microsoft.Extensions.Hosting.Abstractions", "3.0.0" }, + { "Microsoft.Extensions.Http", "3.0.0" }, + { "Microsoft.Extensions.Identity.Core", "3.0.0" }, + { "Microsoft.Extensions.Identity.Stores", "3.0.0" }, + { "Microsoft.Extensions.Localization", "3.0.0" }, + { "Microsoft.Extensions.Localization.Abstractions", "3.0.0" }, + { "Microsoft.Extensions.Logging", "3.0.0" }, + { "Microsoft.Extensions.Logging.Abstractions", "3.0.0" }, + { "Microsoft.Extensions.Logging.Configuration", "3.0.0" }, + { "Microsoft.Extensions.Logging.Console", "3.0.0" }, + { "Microsoft.Extensions.Logging.Debug", "3.0.0" }, + { "Microsoft.Extensions.Logging.EventLog", "3.0.0" }, + { "Microsoft.Extensions.Logging.EventSource", "3.0.0" }, + { "Microsoft.Extensions.Logging.TraceSource", "3.0.0" }, + { "Microsoft.Extensions.ObjectPool", "3.0.0" }, + { "Microsoft.Extensions.Options", "3.0.0" }, + { "Microsoft.Extensions.Options.ConfigurationExtensions", "3.0.0" }, + { "Microsoft.Extensions.Options.DataAnnotations", "3.0.0" }, + { "Microsoft.Extensions.Primitives", "3.0.0" }, + { "Microsoft.Extensions.WebEncoders", "3.0.0" }, + { "Microsoft.JSInterop", "3.0.0" }, + { "Microsoft.Net.Http.Headers", "3.0.0" }, + { "Microsoft.Win32.Registry", "4.6.0" }, + { "System.Diagnostics.EventLog", "4.6.0" }, + { "System.IO.Pipelines", "4.6.0" }, + { "System.Security.AccessControl", "4.6.0" }, + { "System.Security.Cryptography.Cng", "4.6.0" }, + { "System.Security.Cryptography.Xml", "4.6.0" }, + { "System.Security.Permissions", "4.6.0" }, + { "System.Security.Principal.Windows", "4.6.0" }, + { "System.Windows.Extensions", "4.6.0" }, + }; + + internal static FrameworkPackages WindowsDesktop { get; } = new(NetCoreApp30, FrameworkNames.WindowsDesktopApp) + { + { "Microsoft.Win32.Registry.AccessControl", "4.6.0" }, + { "Microsoft.Win32.SystemEvents", "4.6.0" }, + { "System.CodeDom", "4.6.0" }, + { "System.Configuration.ConfigurationManager", "4.6.0" }, + { "System.Diagnostics.EventLog", "4.6.0" }, + { "System.Diagnostics.PerformanceCounter", "4.5.0" }, + { "System.DirectoryServices", "4.6.0" }, + { "System.Drawing.Common", "4.7.3" }, + { "System.IO.Packaging", "4.6.0" }, + { "System.Resources.Extensions", "4.6.0" }, + { "System.Security.Cryptography.Pkcs", "4.6.0" }, + { "System.Security.Cryptography.ProtectedData", "4.6.0" }, + { "System.Security.Cryptography.Xml", "4.6.0" }, + { "System.Security.Permissions", "4.6.0" }, + { "System.Threading.AccessControl", "4.6.0" }, + { "System.Windows.Extensions", "4.6.0" }, + }; + + internal static void Register() => FrameworkPackages.Register(Instance, AspNetCore, WindowsDesktop); + } +} diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.netcoreapp3.1.cs b/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.netcoreapp3.1.cs new file mode 100644 index 000000000000..ce3338d80a5b --- /dev/null +++ b/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.netcoreapp3.1.cs @@ -0,0 +1,194 @@ +namespace Microsoft.ComponentDetection.Detectors.NuGet; + +using static global::NuGet.Frameworks.FrameworkConstants.CommonFrameworks; + +/// +/// Framework packages for .NETCoreApp,Version=v3.1. +/// +internal partial class FrameworkPackages +{ + internal static class NETCoreApp31 + { + internal static FrameworkPackages Instance { get; } = new(NetCoreApp31, FrameworkNames.NetCoreApp, NETCoreApp30.Instance) + { + { "Microsoft.CSharp", "4.7.0" }, + { "Microsoft.Win32.Registry", "4.7.0" }, + { "System.Collections.Immutable", "1.7.0" }, + { "System.ComponentModel.Annotations", "4.7.0" }, + { "System.Diagnostics.DiagnosticSource", "4.7.0" }, + { "System.IO.FileSystem.AccessControl", "4.7.0" }, + { "System.Reflection.DispatchProxy", "4.7.0" }, + { "System.Reflection.Metadata", "1.8.0" }, + { "System.Runtime.CompilerServices.Unsafe", "4.7.1" }, + { "System.Runtime.WindowsRuntime", "4.7.0" }, + { "System.Runtime.WindowsRuntime.UI.Xaml", "4.7.0" }, + { "System.Security.AccessControl", "4.7.0" }, + { "System.Security.Cryptography.OpenSsl", "4.7.0" }, + { "System.Security.Principal.Windows", "4.7.0" }, + { "System.Text.Encoding.CodePages", "4.7.0" }, + { "System.Text.Encodings.Web", "4.7.0" }, + { "System.Text.Json", "4.7.0" }, + { "System.Threading.Channels", "4.7.0" }, + { "System.Threading.Tasks.Dataflow", "4.11.0" }, + }; + + internal static FrameworkPackages AspNetCore { get; } = new(NetCoreApp31, FrameworkNames.AspNetCoreApp, NETCoreApp30.AspNetCore) + { + { "Microsoft.AspNetCore", "3.1.0" }, + { "Microsoft.AspNetCore.Antiforgery", "3.1.0" }, + { "Microsoft.AspNetCore.Authentication", "3.1.0" }, + { "Microsoft.AspNetCore.Authentication.Abstractions", "3.1.0" }, + { "Microsoft.AspNetCore.Authentication.Cookies", "3.1.0" }, + { "Microsoft.AspNetCore.Authentication.Core", "3.1.0" }, + { "Microsoft.AspNetCore.Authentication.OAuth", "3.1.0" }, + { "Microsoft.AspNetCore.Authorization", "3.1.0" }, + { "Microsoft.AspNetCore.Authorization.Policy", "3.1.0" }, + { "Microsoft.AspNetCore.Components", "3.1.0" }, + { "Microsoft.AspNetCore.Components.Authorization", "3.1.0" }, + { "Microsoft.AspNetCore.Components.Forms", "3.1.0" }, + { "Microsoft.AspNetCore.Components.Server", "3.1.0" }, + { "Microsoft.AspNetCore.Components.Web", "3.1.0" }, + { "Microsoft.AspNetCore.Connections.Abstractions", "3.1.0" }, + { "Microsoft.AspNetCore.CookiePolicy", "3.1.0" }, + { "Microsoft.AspNetCore.Cors", "3.1.0" }, + { "Microsoft.AspNetCore.Cryptography.Internal", "3.1.0" }, + { "Microsoft.AspNetCore.Cryptography.KeyDerivation", "3.1.0" }, + { "Microsoft.AspNetCore.DataProtection", "3.1.0" }, + { "Microsoft.AspNetCore.DataProtection.Abstractions", "3.1.0" }, + { "Microsoft.AspNetCore.DataProtection.Extensions", "3.1.0" }, + { "Microsoft.AspNetCore.Diagnostics", "3.1.0" }, + { "Microsoft.AspNetCore.Diagnostics.Abstractions", "3.1.0" }, + { "Microsoft.AspNetCore.Diagnostics.HealthChecks", "3.1.0" }, + { "Microsoft.AspNetCore.HostFiltering", "3.1.0" }, + { "Microsoft.AspNetCore.Hosting", "3.1.0" }, + { "Microsoft.AspNetCore.Hosting.Abstractions", "3.1.0" }, + { "Microsoft.AspNetCore.Hosting.Server.Abstractions", "3.1.0" }, + { "Microsoft.AspNetCore.Html.Abstractions", "3.1.0" }, + { "Microsoft.AspNetCore.Http", "3.1.0" }, + { "Microsoft.AspNetCore.Http.Abstractions", "3.1.0" }, + { "Microsoft.AspNetCore.Http.Connections", "3.1.0" }, + { "Microsoft.AspNetCore.Http.Connections.Common", "3.1.0" }, + { "Microsoft.AspNetCore.Http.Extensions", "3.1.0" }, + { "Microsoft.AspNetCore.Http.Features", "3.1.0" }, + { "Microsoft.AspNetCore.HttpOverrides", "3.1.0" }, + { "Microsoft.AspNetCore.HttpsPolicy", "3.1.0" }, + { "Microsoft.AspNetCore.Identity", "3.1.0" }, + { "Microsoft.AspNetCore.Localization", "3.1.0" }, + { "Microsoft.AspNetCore.Localization.Routing", "3.1.0" }, + { "Microsoft.AspNetCore.Metadata", "3.1.0" }, + { "Microsoft.AspNetCore.Mvc", "3.1.0" }, + { "Microsoft.AspNetCore.Mvc.Abstractions", "3.1.0" }, + { "Microsoft.AspNetCore.Mvc.ApiExplorer", "3.1.0" }, + { "Microsoft.AspNetCore.Mvc.Core", "3.1.0" }, + { "Microsoft.AspNetCore.Mvc.Cors", "3.1.0" }, + { "Microsoft.AspNetCore.Mvc.DataAnnotations", "3.1.0" }, + { "Microsoft.AspNetCore.Mvc.Formatters.Json", "3.1.0" }, + { "Microsoft.AspNetCore.Mvc.Formatters.Xml", "3.1.0" }, + { "Microsoft.AspNetCore.Mvc.Localization", "3.1.0" }, + { "Microsoft.AspNetCore.Mvc.Razor", "3.1.0" }, + { "Microsoft.AspNetCore.Mvc.RazorPages", "3.1.0" }, + { "Microsoft.AspNetCore.Mvc.TagHelpers", "3.1.0" }, + { "Microsoft.AspNetCore.Mvc.ViewFeatures", "3.1.0" }, + { "Microsoft.AspNetCore.Razor", "3.1.0" }, + { "Microsoft.AspNetCore.Razor.Runtime", "3.1.0" }, + { "Microsoft.AspNetCore.ResponseCaching", "3.1.0" }, + { "Microsoft.AspNetCore.ResponseCaching.Abstractions", "3.1.0" }, + { "Microsoft.AspNetCore.ResponseCompression", "3.1.0" }, + { "Microsoft.AspNetCore.Rewrite", "3.1.0" }, + { "Microsoft.AspNetCore.Routing", "3.1.0" }, + { "Microsoft.AspNetCore.Routing.Abstractions", "3.1.0" }, + { "Microsoft.AspNetCore.Server.HttpSys", "3.1.0" }, + { "Microsoft.AspNetCore.Server.IIS", "3.1.0" }, + { "Microsoft.AspNetCore.Server.IISIntegration", "3.1.0" }, + { "Microsoft.AspNetCore.Server.Kestrel", "3.1.0" }, + { "Microsoft.AspNetCore.Server.Kestrel.Core", "3.1.0" }, + { "Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets", "3.1.0" }, + { "Microsoft.AspNetCore.Session", "3.1.0" }, + { "Microsoft.AspNetCore.SignalR", "3.1.0" }, + { "Microsoft.AspNetCore.SignalR.Common", "3.1.0" }, + { "Microsoft.AspNetCore.SignalR.Core", "3.1.0" }, + { "Microsoft.AspNetCore.SignalR.Protocols.Json", "3.1.0" }, + { "Microsoft.AspNetCore.StaticFiles", "3.1.0" }, + { "Microsoft.AspNetCore.WebSockets", "3.1.0" }, + { "Microsoft.AspNetCore.WebUtilities", "3.1.0" }, + { "Microsoft.Extensions.Caching.Abstractions", "3.1.0" }, + { "Microsoft.Extensions.Caching.Memory", "3.1.0" }, + { "Microsoft.Extensions.Configuration", "3.1.0" }, + { "Microsoft.Extensions.Configuration.Abstractions", "3.1.0" }, + { "Microsoft.Extensions.Configuration.Binder", "3.1.0" }, + { "Microsoft.Extensions.Configuration.CommandLine", "3.1.0" }, + { "Microsoft.Extensions.Configuration.EnvironmentVariables", "3.1.0" }, + { "Microsoft.Extensions.Configuration.FileExtensions", "3.1.0" }, + { "Microsoft.Extensions.Configuration.Ini", "3.1.0" }, + { "Microsoft.Extensions.Configuration.Json", "3.1.0" }, + { "Microsoft.Extensions.Configuration.KeyPerFile", "3.1.0" }, + { "Microsoft.Extensions.Configuration.UserSecrets", "3.1.0" }, + { "Microsoft.Extensions.Configuration.Xml", "3.1.0" }, + { "Microsoft.Extensions.DependencyInjection", "3.1.0" }, + { "Microsoft.Extensions.DependencyInjection.Abstractions", "3.1.0" }, + { "Microsoft.Extensions.Diagnostics.HealthChecks", "3.1.0" }, + { "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions", "3.1.0" }, + { "Microsoft.Extensions.FileProviders.Abstractions", "3.1.0" }, + { "Microsoft.Extensions.FileProviders.Composite", "3.1.0" }, + { "Microsoft.Extensions.FileProviders.Embedded", "3.1.0" }, + { "Microsoft.Extensions.FileProviders.Physical", "3.1.0" }, + { "Microsoft.Extensions.FileSystemGlobbing", "3.1.0" }, + { "Microsoft.Extensions.Hosting", "3.1.0" }, + { "Microsoft.Extensions.Hosting.Abstractions", "3.1.0" }, + { "Microsoft.Extensions.Http", "3.1.0" }, + { "Microsoft.Extensions.Identity.Core", "3.1.0" }, + { "Microsoft.Extensions.Identity.Stores", "3.1.0" }, + { "Microsoft.Extensions.Localization", "3.1.0" }, + { "Microsoft.Extensions.Localization.Abstractions", "3.1.0" }, + { "Microsoft.Extensions.Logging", "3.1.0" }, + { "Microsoft.Extensions.Logging.Abstractions", "3.1.0" }, + { "Microsoft.Extensions.Logging.Configuration", "3.1.0" }, + { "Microsoft.Extensions.Logging.Console", "3.1.0" }, + { "Microsoft.Extensions.Logging.Debug", "3.1.0" }, + { "Microsoft.Extensions.Logging.EventLog", "3.1.0" }, + { "Microsoft.Extensions.Logging.EventSource", "3.1.0" }, + { "Microsoft.Extensions.Logging.TraceSource", "3.1.0" }, + { "Microsoft.Extensions.ObjectPool", "3.1.0" }, + { "Microsoft.Extensions.Options", "3.1.0" }, + { "Microsoft.Extensions.Options.ConfigurationExtensions", "3.1.0" }, + { "Microsoft.Extensions.Options.DataAnnotations", "3.1.0" }, + { "Microsoft.Extensions.Primitives", "3.1.0" }, + { "Microsoft.Extensions.WebEncoders", "3.1.0" }, + { "Microsoft.JSInterop", "3.1.0" }, + { "Microsoft.Net.Http.Headers", "3.1.0" }, + { "Microsoft.Win32.Registry", "4.7.0" }, + { "Microsoft.Win32.SystemEvents", "4.7.0" }, + { "System.Diagnostics.EventLog", "4.7.0" }, + { "System.Drawing.Common", "4.7.3" }, + { "System.IO.Pipelines", "4.7.0" }, + { "System.Security.AccessControl", "4.7.0" }, + { "System.Security.Cryptography.Cng", "4.7.0" }, + { "System.Security.Cryptography.Pkcs", "4.7.0" }, + { "System.Security.Cryptography.Xml", "4.7.0" }, + { "System.Security.Permissions", "4.7.0" }, + { "System.Security.Principal.Windows", "4.7.0" }, + { "System.Windows.Extensions", "4.7.0" }, + }; + + internal static FrameworkPackages WindowsDesktop { get; } = new(NetCoreApp31, FrameworkNames.WindowsDesktopApp, NETCoreApp30.WindowsDesktop) + { + { "Microsoft.Win32.Registry.AccessControl", "4.7.0" }, + { "Microsoft.Win32.SystemEvents", "4.7.0" }, + { "System.CodeDom", "4.7.0" }, + { "System.Configuration.ConfigurationManager", "4.7.0" }, + { "System.Diagnostics.EventLog", "4.7.0" }, + { "System.Diagnostics.PerformanceCounter", "4.7.0" }, + { "System.DirectoryServices", "8.0.0" }, + { "System.IO.Packaging", "4.7.0" }, + { "System.Resources.Extensions", "4.7.0" }, + { "System.Security.Cryptography.Pkcs", "4.7.0" }, + { "System.Security.Cryptography.ProtectedData", "4.7.0" }, + { "System.Security.Cryptography.Xml", "4.7.0" }, + { "System.Security.Permissions", "4.7.0" }, + { "System.Threading.AccessControl", "4.7.0" }, + { "System.Windows.Extensions", "4.7.0" }, + }; + + internal static void Register() => FrameworkPackages.Register(Instance, AspNetCore, WindowsDesktop); + } +} diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.netstandard2.0.cs b/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.netstandard2.0.cs new file mode 100644 index 000000000000..66c9bdd64cdf --- /dev/null +++ b/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.netstandard2.0.cs @@ -0,0 +1,110 @@ +namespace Microsoft.ComponentDetection.Detectors.NuGet; + +using static global::NuGet.Frameworks.FrameworkConstants.CommonFrameworks; + +/// +/// Framework packages for .NETStandard,Version=v2.0. +/// +internal partial class FrameworkPackages +{ + internal static class NETStandard20 + { + internal static FrameworkPackages Instance { get; } = new(NetStandard20, FrameworkNames.NetStandardLibrary) + { + { "Microsoft.Win32.Primitives", "4.3.0" }, + { "System.AppContext", "4.3.0" }, + { "System.Collections", "4.3.0" }, + { "System.Collections.NonGeneric", "4.3.0" }, + { "System.Collections.Specialized", "4.3.0" }, + { "System.ComponentModel", "4.0.1" }, + { "System.ComponentModel.EventBasedAsync", "4.0.11" }, + { "System.ComponentModel.Primitives", "4.3.0" }, + { "System.ComponentModel.TypeConverter", "4.3.0" }, + { "System.Console", "4.3.1" }, + { "System.Data.Common", "4.3.0" }, + { "System.Diagnostics.Contracts", "4.0.1" }, + { "System.Diagnostics.Debug", "4.3.0" }, + { "System.Diagnostics.FileVersionInfo", "4.3.0" }, + { "System.Diagnostics.Process", "4.3.0" }, + { "System.Diagnostics.StackTrace", "4.3.0" }, + { "System.Diagnostics.TextWriterTraceListener", "4.3.0" }, + { "System.Diagnostics.Tools", "4.3.0" }, + { "System.Diagnostics.TraceSource", "4.3.0" }, + { "System.Diagnostics.Tracing", "4.3.0" }, + { "System.Drawing.Primitives", "4.3.0" }, + { "System.Dynamic.Runtime", "4.0.11" }, + { "System.Globalization", "4.3.0" }, + { "System.Globalization.Calendars", "4.3.0" }, + { "System.Globalization.Extensions", "4.3.0" }, + { "System.IO", "4.3.0" }, + { "System.IO.Compression", "4.3.0" }, + { "System.IO.Compression.ZipFile", "4.3.0" }, + { "System.IO.FileSystem", "4.3.0" }, + { "System.IO.FileSystem.DriveInfo", "4.3.1" }, + { "System.IO.FileSystem.Primitives", "4.3.0" }, + { "System.IO.FileSystem.Watcher", "4.3.0" }, + { "System.IO.IsolatedStorage", "4.3.0" }, + { "System.IO.MemoryMappedFiles", "4.3.0" }, + { "System.IO.Pipes", "4.3.0" }, + { "System.IO.UnmanagedMemoryStream", "4.3.0" }, + { "System.Linq", "4.3.0" }, + { "System.Linq.Expressions", "4.3.0" }, + { "System.Linq.Parallel", "4.0.1" }, + { "System.Linq.Queryable", "4.0.1" }, + { "System.Net.Http", "4.3.4" }, + { "System.Net.NameResolution", "4.3.0" }, + { "System.Net.NetworkInformation", "4.3.0" }, + { "System.Net.Ping", "4.3.0" }, + { "System.Net.Primitives", "4.3.1" }, + { "System.Net.Requests", "4.0.11" }, + { "System.Net.Security", "4.3.2" }, + { "System.Net.Sockets", "4.3.0" }, + { "System.Net.WebHeaderCollection", "4.0.1" }, + { "System.Net.WebSockets", "4.3.0" }, + { "System.Net.WebSockets.Client", "4.3.2" }, + { "System.Reflection", "4.3.0" }, + { "System.Reflection.Extensions", "4.3.0" }, + { "System.Reflection.Primitives", "4.3.0" }, + { "System.Resources.Reader", "4.3.0" }, + { "System.Resources.ResourceManager", "4.3.0" }, + { "System.Resources.Writer", "4.3.0" }, + { "System.Runtime", "4.3.1" }, + { "System.Runtime.CompilerServices.VisualC", "4.3.0" }, + { "System.Runtime.Extensions", "4.3.1" }, + { "System.Runtime.Handles", "4.3.0" }, + { "System.Runtime.InteropServices", "4.3.0" }, + { "System.Runtime.InteropServices.RuntimeInformation", "4.3.0" }, + { "System.Runtime.Numerics", "4.0.1" }, + { "System.Runtime.Serialization.Formatters", "4.3.0" }, + { "System.Runtime.Serialization.Primitives", "4.3.0" }, + { "System.Runtime.Serialization.Xml", "4.3.0" }, + { "System.Security.Claims", "4.3.0" }, + { "System.Security.Cryptography.Algorithms", "4.3.1" }, + { "System.Security.Cryptography.Csp", "4.3.0" }, + { "System.Security.Cryptography.Encoding", "4.3.0" }, + { "System.Security.Cryptography.Primitives", "4.3.0" }, + { "System.Security.Cryptography.X509Certificates", "4.3.2" }, + { "System.Security.Principal", "4.0.1" }, + { "System.Security.SecureString", "4.3.0" }, + { "System.Text.Encoding", "4.3.0" }, + { "System.Text.Encoding.Extensions", "4.3.0" }, + { "System.Text.RegularExpressions", "4.3.0" }, + { "System.Threading", "4.0.11" }, + { "System.Threading.Overlapped", "4.3.0" }, + { "System.Threading.Tasks", "4.3.0" }, + { "System.Threading.Tasks.Parallel", "4.0.1" }, + { "System.Threading.Thread", "4.3.0" }, + { "System.Threading.ThreadPool", "4.3.0" }, + { "System.Threading.Timer", "4.3.0" }, + { "System.ValueTuple", "4.4.0" }, + { "System.Xml.ReaderWriter", "4.3.1" }, + { "System.Xml.XDocument", "4.0.11" }, + { "System.Xml.XmlDocument", "4.3.0" }, + { "System.Xml.XmlSerializer", "4.0.11" }, + { "System.Xml.XPath", "4.3.0" }, + { "System.Xml.XPath.XDocument", "4.3.0" }, + }; + + internal static void Register() => FrameworkPackages.Register(Instance); + } +} diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.netstandard2.1.cs b/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.netstandard2.1.cs new file mode 100644 index 000000000000..5b6aeb282854 --- /dev/null +++ b/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/FrameworkPackages.netstandard2.1.cs @@ -0,0 +1,50 @@ +namespace Microsoft.ComponentDetection.Detectors.NuGet; + +using static global::NuGet.Frameworks.FrameworkConstants.CommonFrameworks; + +/// +/// Framework packages for .NETStandard,Version=v2.1. +/// +internal partial class FrameworkPackages +{ + internal static class NETStandard21 + { + internal static FrameworkPackages Instance { get; } = new(NetStandard21, FrameworkNames.NetStandardLibrary, NETStandard20.Instance) + { + { "System.Buffers", "4.5.1" }, + { "System.Collections.Concurrent", "4.3.0" }, + { "System.Collections.Immutable", "1.4.0" }, + { "System.ComponentModel", "4.3.0" }, + { "System.ComponentModel.Composition", "4.5.0" }, + { "System.ComponentModel.EventBasedAsync", "4.3.0" }, + { "System.Diagnostics.Contracts", "4.3.0" }, + { "System.Dynamic.Runtime", "4.3.0" }, + { "System.Linq.Queryable", "4.3.0" }, + { "System.Memory", "4.5.5" }, + { "System.Net.Requests", "4.3.0" }, + { "System.Net.WebHeaderCollection", "4.3.0" }, + { "System.Numerics.Vectors", "4.5.0" }, + { "System.ObjectModel", "4.3.0" }, + { "System.Private.DataContractSerialization", "4.3.0" }, + { "System.Reflection.DispatchProxy", "4.5.1" }, + { "System.Reflection.Emit", "4.7.0" }, + { "System.Reflection.Emit.ILGeneration", "4.7.0" }, + { "System.Reflection.Emit.Lightweight", "4.7.0" }, + { "System.Reflection.TypeExtensions", "4.3.0" }, + { "System.Runtime.Loader", "4.3.0" }, + { "System.Runtime.Numerics", "4.3.0" }, + { "System.Runtime.Serialization.Json", "4.3.0" }, + { "System.Security.AccessControl", "4.4.0" }, + { "System.Security.Cryptography.Xml", "4.4.0" }, + { "System.Security.Principal", "4.3.0" }, + { "System.Security.Principal.Windows", "4.4.0" }, + { "System.Threading", "4.3.0" }, + { "System.Threading.Tasks.Extensions", "4.5.4" }, + { "System.Threading.Tasks.Parallel", "4.3.0" }, + { "System.Xml.XDocument", "4.3.0" }, + { "System.Xml.XmlSerializer", "4.3.0" }, + }; + + internal static void Register() => FrameworkPackages.Register(Instance); + } +} diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/Readme.md b/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/Readme.md new file mode 100644 index 000000000000..cbf05a6a5db2 --- /dev/null +++ b/src/Tasks/Microsoft.NET.Build.Tasks/FrameworkPackages/Readme.md @@ -0,0 +1,3 @@ +The code in this folder was copied from https://github.com/microsoft/component-detection/tree/main/src/Microsoft.ComponentDetection.Detectors/nuget/FrameworkPackages + +In the future, we plan to work on a different process for acquiring and updating this data, but this is an easy way to get the prune package reference support working. \ No newline at end of file diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/GetPackagesToPrune.cs b/src/Tasks/Microsoft.NET.Build.Tasks/GetPackagesToPrune.cs new file mode 100644 index 000000000000..07d087be1721 --- /dev/null +++ b/src/Tasks/Microsoft.NET.Build.Tasks/GetPackagesToPrune.cs @@ -0,0 +1,122 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; +using Microsoft.ComponentDetection.Detectors.NuGet; +using NuGet.Frameworks; +using NuGet.Versioning; + +namespace Microsoft.NET.Build.Tasks +{ + public class GetPackagesToPrune : TaskBase + { + [Required] + public string TargetFrameworkIdentifier { get; set; } + + [Required] + public string TargetFrameworkVersion { get; set; } + + [Required] + public ITaskItem[] FrameworkReferences { get; set; } + + public string TargetingPackRoot { get; set; } + + [Output] + public ITaskItem[] PackagesToPrune { get; set; } + + class CacheKey + { + public string TargetFrameworkIdentifier { get; set; } + public string TargetFrameworkVersion { get; set; } + public HashSet FrameworkReferences { get; set; } + + public override bool Equals(object? obj) => obj is CacheKey key && + TargetFrameworkIdentifier == key.TargetFrameworkIdentifier && + TargetFrameworkVersion == key.TargetFrameworkVersion && + FrameworkReferences.SetEquals(key.FrameworkReferences); + public override int GetHashCode() + { +#if NET + var hashCode = new HashCode(); + hashCode.Add(TargetFrameworkIdentifier); + hashCode.Add(TargetFrameworkVersion); + foreach (var frameworkReference in FrameworkReferences) + { + hashCode.Add(frameworkReference); + } + return hashCode.ToHashCode(); +#else + int hashCode = 1436330440; + hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(TargetFrameworkIdentifier); + hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(TargetFrameworkVersion); + + foreach (var frameworkReference in FrameworkReferences) + { + hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(frameworkReference); + } + return hashCode; +#endif + } + } + + + protected override void ExecuteCore() + { + + // Filter out transitive framework references. Normally they wouldn't be passed to this task, but in Visual Studio design-time builds + // the ResolvePackageAssets and AddTransitiveFrameworkReferences targets may have already run. Filtering these references out should + // avoid a bug similar to https://github.com/dotnet/sdk/issues/14641 + var filteredFrameworkReferences = FrameworkReferences.Where( + i => i.GetMetadata("IsTransitiveFrameworkReference") is string transitiveVal && !transitiveVal.Equals("true", StringComparison.OrdinalIgnoreCase)).ToList(); + + CacheKey key = new() + { + TargetFrameworkIdentifier = TargetFrameworkIdentifier, + TargetFrameworkVersion = TargetFrameworkVersion, + FrameworkReferences = filteredFrameworkReferences.Select(i => i.ItemSpec).ToHashSet() + }; + + // Cache framework package values per build + var existingResult = BuildEngine4.GetRegisteredTaskObject(key, RegisteredTaskObjectLifetime.Build); + if (existingResult != null) + { + PackagesToPrune = (ITaskItem[])existingResult; + return; + } + + var nugetFramework = new NuGetFramework(TargetFrameworkIdentifier, Version.Parse(TargetFrameworkVersion)); + + Dictionary packagesToPrune = new(); + + var frameworkPackages = FrameworkPackages.GetFrameworkPackages(nugetFramework, filteredFrameworkReferences.Select(fr => fr.ItemSpec).ToArray(), TargetingPackRoot) + .SelectMany(packages => packages); + + foreach (var kvp in frameworkPackages) + { + if (packagesToPrune.TryGetValue(kvp.Key, out NuGetVersion existingVersion)) + { + if (kvp.Value > existingVersion) + { + packagesToPrune[kvp.Key] = kvp.Value; + } + } + else + { + packagesToPrune[kvp.Key] = kvp.Value; + } + } + + PackagesToPrune = packagesToPrune.Select(p => + { + var item = new TaskItem(p.Key); + item.SetMetadata("Version", p.Value.ToString()); + return item; + }).ToArray(); + + BuildEngine4.RegisterTaskObject(key, PackagesToPrune, RegisteredTaskObjectLifetime.Build, true); + } + } +} diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/Microsoft.NET.Build.Tasks.csproj b/src/Tasks/Microsoft.NET.Build.Tasks/Microsoft.NET.Build.Tasks.csproj index 6b8bb0d8aca5..1b62d98ba613 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/Microsoft.NET.Build.Tasks.csproj +++ b/src/Tasks/Microsoft.NET.Build.Tasks/Microsoft.NET.Build.Tasks.csproj @@ -119,6 +119,10 @@ + + + + <_NugetBuildTasksPackPath>$(NuGetPackageRoot)nuget.build.tasks.pack\$(NuGetBuildTasksPackageVersion) diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets index 9f0f3032b69b..308ce7f7899b 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets +++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets @@ -18,6 +18,7 @@ Copyright (c) .NET Foundation. All rights reserved. + @@ -49,7 +50,19 @@ Copyright (c) .NET Foundation. All rights reserved. - + + + + + + + + +