diff --git a/build/RuntimeStore.targets b/build/RuntimeStore.targets deleted file mode 100644 index 318a2693e0..0000000000 --- a/build/RuntimeStore.targets +++ /dev/null @@ -1,237 +0,0 @@ - - - <_BuildScriptsDirectory>$(MSBuildThisFileDirectory)tools\scripts\ - <_WorkRoot>$(RepositoryRoot).w\ - <_RuntimeStoreWorkDirectory>$(_WorkRoot).rw\ - <_RuntimeStoreOutputDirectory>$(_WorkRoot).ro\ - <_TemplatesDirectory>$(MSBuildThisFileDirectory)tools\templates\ - <_SrcDirectory>$(RepositoryRoot)src\ - <_AllMetapackageDirectory>$(_SrcDirectory)Microsoft.AspNetCore.All\ - <_ExistingManifestsDirectory>$(_AllMetapackageDirectory)build\ - <_ArtifactsZipDirectory>$(ArtifactsDir)zip\ - <_StoreZipDirectory>$(_ArtifactsZipDirectory)rs\ - <_SymbolsZipDirectory>$(_ArtifactsZipDirectory)symbols\ - <_DepsOutputDirectory>$(ArtifactsDir)deps\ - - - - - - - - - $(_WorkRoot)Microsoft.AspNetCore.All\ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $(_WorkRoot)RS.References\ - - - - - - - - - - - - - - - - - - - - - - - - - <_RuntimeStoreRestoreSources Include="$(DependencyPackageDir)" Condition="Exists($(DependencyPackageDir))" /> - <_RuntimeStoreRestoreSources Include="$(DependencyMirrorPackageDir)" Condition="Exists($(DependencyMirrorPackageDir))" /> - <_RuntimeStoreRestoreSources Include="$(BuildDir)" Condition="Exists($(BuildDir))" /> - - - - - - <_RsManifestProps>MicrosoftAspNetCoreAllPackageVersion=$(PackageVersion) - <_RsManifestProps>$(_RsManifestProps);DotNetRestoreSourcesPropsPath=$(GeneratedRestoreSourcesPropsPath) - - - - - - - - win7-$(RuntimeStoreArch) - linux-$(RuntimeStoreArch) - osx-$(RuntimeStoreArch) - - - - - - - - - - <__ComposeStoreProps /> - <_ComposeStoreProps>$(_ComposeStoreProps);$(_RsManifestProps) - <_ComposeStoreProps>$(_ComposeStoreProps);ComposeDir=$(_RuntimeStoreOutputDirectory) - <_ComposeStoreProps>$(_ComposeStoreProps);ComposeWorkingDir=$(_RuntimeStoreWorkDirectory) - <_ComposeStoreProps>$(_ComposeStoreProps);RuntimeIdentifier=$(RuntimeStoreRID) - <_ComposeStoreProps>$(_ComposeStoreProps);RuntimeFrameworkVersion=$(MicrosoftNETCoreApp20PackageVersion) - - - - - - - - - - - - - - - - - - - - - - - - - $(ArtifactsDir)aspnetcore-store-$(PackageVersion)-$(RuntimeStoreRID).zip - $(ArtifactsDir)aspnetcore-symbols-$(PackageVersion)-$(RuntimeStoreRID).zip - - - - - - - - - - - - - - - - - - - - - - - - - - - - - aspnetcore-store-$(PackageVersion)-common.xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/artifacts.props b/build/artifacts.props index 38bf46716a..40da9c42dc 100644 --- a/build/artifacts.props +++ b/build/artifacts.props @@ -4,7 +4,6 @@ false false - false false false @@ -16,128 +15,128 @@ - + - - + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + - - + + - - - - - - - - + + + + + + + + - - - - - - - + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - + + + + + - + - - + + - - - - + + + + - - - - - - + + + + + + - + - + - - - - - - - + + + + + + + @@ -149,92 +148,92 @@ - + - + - - - + + + - - + + - - - - - + + + + + - - - - + + + + - - - - + + + + - - - - - + + + + + - - - - - - + + + + + + - - + + - - - - - - - - + + + + + + + + - - - - - - - - - + + + + + + + + + - - - - + + + + - + - + - - - + + + - + @@ -243,14 +242,14 @@ - + - + - + diff --git a/build/external-dependencies.props b/build/external-dependencies.props index f7a6a96970..bfdcdc19fe 100644 --- a/build/external-dependencies.props +++ b/build/external-dependencies.props @@ -15,8 +15,6 @@ false false - - false false diff --git a/build/repo.targets b/build/repo.targets index 3bd55133bd..d16b901ae0 100644 --- a/build/repo.targets +++ b/build/repo.targets @@ -1,6 +1,5 @@ - diff --git a/build/tasks/AddRSReferences.cs b/build/tasks/AddRSReferences.cs deleted file mode 100644 index 1cbc504661..0000000000 --- a/build/tasks/AddRSReferences.cs +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Linq; -using System.Xml; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; -using RepoTasks.Utilities; - -namespace RepoTasks -{ - public class AddRSReferences : Task - { - [Required] - public string ReferencePackagePath { get; set; } - - [Required] - public ITaskItem[] BuildArtifacts { get; set; } - - [Required] - public ITaskItem[] PackageArtifacts { get; set; } - - [Required] - public ITaskItem[] ExternalDependencies { get; set; } - - public override bool Execute() - { - // Parse input - var runtimeStoreArtifacts = PackageArtifacts.Where(p => p.GetMetadata("RuntimeStore") == "true"); - var externalArtifacts = ExternalDependencies.Where(p => p.GetMetadata("RuntimeStore") == "true"); - var buildArtifacts = BuildArtifacts.Select(ArtifactInfo.Parse) - .OfType() - .Where(p => !p.IsSymbolsArtifact); - - var xmlDoc = new XmlDocument(); - xmlDoc.Load(ReferencePackagePath); - - // Project - var projectElement = xmlDoc.FirstChild; - - // Items - var itemGroupElement = xmlDoc.CreateElement("ItemGroup"); - Log.LogMessage(MessageImportance.High, $"Runtime store will include the following packages"); - - foreach (var package in runtimeStoreArtifacts) - { - var packageName = package.ItemSpec; - var packageVersion = buildArtifacts - .Single(p => string.Equals(p.PackageInfo.Id, packageName, StringComparison.OrdinalIgnoreCase)) - .PackageInfo.Version.ToString(); - Log.LogMessage(MessageImportance.High, $" - Package: {packageName} Version: {packageVersion}"); - - var packageReferenceElement = xmlDoc.CreateElement("PackageReference"); - packageReferenceElement.SetAttribute("Include", packageName); - packageReferenceElement.SetAttribute("Version", packageVersion); - packageReferenceElement.SetAttribute("PrivateAssets", "None"); - - itemGroupElement.AppendChild(packageReferenceElement); - } - - foreach (var package in externalArtifacts) - { - var packageName = package.ItemSpec; - var packageVersion = package.GetMetadata("Version"); - Log.LogMessage(MessageImportance.High, $" - Package: {packageName} Version: {packageVersion}"); - - var packageReferenceElement = xmlDoc.CreateElement("PackageReference"); - packageReferenceElement.SetAttribute("Include", packageName); - packageReferenceElement.SetAttribute("Version", packageVersion); - packageReferenceElement.SetAttribute("PrivateAssets", "None"); - - itemGroupElement.AppendChild(packageReferenceElement); - } - - projectElement.AppendChild(itemGroupElement); - - // Save updated file - xmlDoc.AppendChild(projectElement); - xmlDoc.Save(ReferencePackagePath); - - return true; - } - } -} diff --git a/build/tasks/ComposeNewStore.cs b/build/tasks/ComposeNewStore.cs deleted file mode 100644 index 90f601e0a2..0000000000 --- a/build/tasks/ComposeNewStore.cs +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Collections.Generic; -using System.IO; -using System.Xml; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; - -namespace RepoTasks -{ - public class ComposeNewStore : Task - { - [Required] - public ITaskItem[] ExistingManifests { get; set; } - - [Required] - public ITaskItem[] NewManifests { get; set; } - - [Required] - public ITaskItem[] RuntimeStoreFiles { get; set; } - - [Required] - public ITaskItem[] RuntimeStoreSymbolFiles { get; set; } - - [Required] - public string ManifestDestination { get; set; } - - [Required] - public string StoreDestination { get; set; } - - [Required] - public string SymbolsDestination { get; set; } - - public override bool Execute() - { - var existingFiles = new Dictionary>(); - var newRuntimeStoreFiles = new List(); - var newRuntimeStoreSymbolFiles = new List(); - - // Construct database of existing assets - foreach (var manifest in ExistingManifests) - { - var xmlDoc = new XmlDocument(); - xmlDoc.Load(manifest.GetMetadata("FullPath")); - var storeArtifacts = xmlDoc.SelectSingleNode("/StoreArtifacts"); - - foreach (XmlNode artifact in storeArtifacts.ChildNodes) - { - if (existingFiles.TryGetValue(artifact.Attributes["Id"].Value, out var versions)) - { - versions.Add(artifact.Attributes["Version"].Value); - } - else - { - existingFiles[artifact.Attributes["Id"].Value] = new HashSet{ artifact.Attributes["Version"].Value }; - } - } - } - - // Insert new runtime store files - foreach (var storeFile in RuntimeStoreFiles) - { - // format: {bitness}}/{tfm}}/{id}/{version}}/... - var recursiveDir = storeFile.GetMetadata("RecursiveDir"); - var components = recursiveDir.Split(Path.DirectorySeparatorChar); - var id = components[2]; - var version = components[3]; - - if (!existingFiles.TryGetValue(id, out var versions) || !versions.Contains(version)) - { - var destinationDir = Path.Combine(StoreDestination, recursiveDir); - if (!Directory.Exists(Path.Combine(StoreDestination, recursiveDir))) - { - Directory.CreateDirectory(destinationDir); - } - - File.Copy(storeFile.GetMetadata("FullPath"), Path.Combine(destinationDir, $"{storeFile.GetMetadata("Filename")}{storeFile.GetMetadata("Extension")}"), overwrite: true); - } - } - - // Insert new runtime store files - foreach (var symbolFile in RuntimeStoreSymbolFiles) - { - // format: {bitness}}/{tfm}}/{id}/{version}}/... - var recursiveDir = symbolFile.GetMetadata("RecursiveDir"); - var components = recursiveDir.Split(Path.DirectorySeparatorChar); - var id = components[2]; - var version = components[3]; - - if (!existingFiles.TryGetValue(id, out var versions) || !versions.Contains(version)) - { - var destinationDir = Path.Combine(SymbolsDestination, recursiveDir); - if (!Directory.Exists(Path.Combine(SymbolsDestination, recursiveDir))) - { - Directory.CreateDirectory(destinationDir); - } - - File.Copy(symbolFile.GetMetadata("FullPath"), Path.Combine(destinationDir, $"{symbolFile.GetMetadata("Filename")}{symbolFile.GetMetadata("Extension")}"), overwrite: true); - } - } - - // Purge existing packages from manifest - foreach (var newManifest in NewManifests) - { - var newManifestPath = newManifest.GetMetadata("FullPath"); - var xmlDoc = new XmlDocument(); - xmlDoc.Load(newManifestPath); - var storeArtifacts = xmlDoc.SelectSingleNode("/StoreArtifacts"); - var artifactsToRemove = new List(); - - foreach (XmlNode artifact in storeArtifacts.ChildNodes) - { - if (existingFiles.TryGetValue(artifact.Attributes["Id"].Value, out var versions) && versions.Contains(artifact.Attributes["Version"].Value)) - { - artifactsToRemove.Add(artifact); - } - } - - foreach (var artifactToRemove in artifactsToRemove) - { - storeArtifacts.RemoveChild(artifactToRemove); - } - - xmlDoc.Save(ManifestDestination); - } - - return true; - } - } -} diff --git a/build/tasks/ConsolidateManifests.cs b/build/tasks/ConsolidateManifests.cs deleted file mode 100644 index 12838855a6..0000000000 --- a/build/tasks/ConsolidateManifests.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections.Generic; -using System.Xml; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; - -namespace RepoTasks -{ - // Takes multiple runtime store manifests and create a consolidated manifest containing all unique entries. - public class ConsolidateManifests : Task - { - [Required] - public ITaskItem[] Manifests { get; set; } - - [Required] - public string ManifestDestination { get; set; } - - public override bool Execute() - { - var artifacts = new HashSet>(); - - // Construct database of all artifacts - foreach (var manifest in Manifests) - { - var xmlDoc = new XmlDocument(); - xmlDoc.Load(manifest.GetMetadata("FullPath")); - var storeArtifacts = xmlDoc.SelectSingleNode("/StoreArtifacts"); - - foreach (XmlNode artifact in storeArtifacts.ChildNodes) - { - artifacts.Add(new Tuple(artifact.Attributes["Id"].Value, artifact.Attributes["Version"].Value)); - } - } - - - var consolidatedXmlDoc = new XmlDocument(); - var packagesElement = consolidatedXmlDoc.CreateElement("StoreArtifacts"); - - foreach (var artifact in artifacts) - { - var packageElement = consolidatedXmlDoc.CreateElement("Package"); - packageElement.SetAttribute("Id", artifact.Item1); - packageElement.SetAttribute("Version", artifact.Item2); - - packagesElement.AppendChild(packageElement); - } - - consolidatedXmlDoc.AppendChild(packagesElement); - consolidatedXmlDoc.Save(ManifestDestination); - - return true; - } - } -} diff --git a/build/tasks/CreateCommonManifest.cs b/build/tasks/CreateCommonManifest.cs deleted file mode 100644 index 5a412fa8e9..0000000000 --- a/build/tasks/CreateCommonManifest.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Linq; -using System.Xml; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; - -namespace RepoTasks -{ - /// - /// Creates a common manifest file used for trimming publish output given a list of packages and package definitions containing their versions. - /// - public class CreateCommonManifest : Task - { - /// - /// The path for the common manifest file to be created. - /// - /// - [Required] - public string DestinationFilePath { get; set; } - - /// - /// The packages to include in the common manifest file. - /// - /// - [Required] - public ITaskItem[] Packages { get; set; } - - /// - /// The package definitions used for resolving package versions. - /// - /// - [Required] - public ITaskItem[] PackageDefinitions { get; set; } - - public override bool Execute() - { - var xmlDoc = new XmlDocument(); - var packagesElement = xmlDoc.CreateElement("StoreArtifacts"); - - foreach (var package in Packages) - { - var packageName = package.ItemSpec; - var packageElement = xmlDoc.CreateElement("Package"); - packageElement.SetAttribute("Id", packageName); - packageElement.SetAttribute("Version", PackageDefinitions - .Where(p => string.Equals(p.GetMetadata("Name"), packageName, StringComparison.OrdinalIgnoreCase)) - .Select(p => p.GetMetadata("Version")).Single()); - - packagesElement.AppendChild(packageElement); - } - - xmlDoc.AppendChild(packagesElement); - xmlDoc.Save(DestinationFilePath); - - return true; - } - } -} diff --git a/build/tasks/ReplaceInFile.cs b/build/tasks/ReplaceInFile.cs deleted file mode 100644 index 6833277787..0000000000 --- a/build/tasks/ReplaceInFile.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.IO; -using System.Linq; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; - -namespace RepoTasks -{ - public class ReplaceInFile : Task - { - [Required] - public string Filename { get; set; } - - [Required] - public ITaskItem[] Items { get; set; } - - public override bool Execute() - { - var fileText = File.ReadAllText(Filename); - - foreach (var item in Items) - { - fileText = fileText.Replace(item.ItemSpec, item.GetMetadata("Replacement")); - } - - File.WriteAllText(Filename, fileText); - - return true; - } - } -} diff --git a/build/tasks/RepoTasks.tasks b/build/tasks/RepoTasks.tasks index 10b37233ce..1b8dbe7e76 100644 --- a/build/tasks/RepoTasks.tasks +++ b/build/tasks/RepoTasks.tasks @@ -9,12 +9,6 @@ - - - - - - diff --git a/build/tasks/ResolveHostingStartupPackages.cs b/build/tasks/ResolveHostingStartupPackages.cs deleted file mode 100644 index 8bfc27399c..0000000000 --- a/build/tasks/ResolveHostingStartupPackages.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Linq; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; - -namespace RepoTasks -{ - public class ResolveHostingStartupPackages : Task - { - [Required] - public ITaskItem[] BuildArtifacts { get; set; } - - [Required] - public ITaskItem[] PackageArtifacts { get; set; } - - [Output] - public ITaskItem[] HostingStartupArtifacts { get; set; } - - public override bool Execute() - { - // Parse input - var hostingStartupArtifacts = PackageArtifacts.Where(p => p.GetMetadata("HostingStartup") == "true"); - HostingStartupArtifacts = BuildArtifacts.Where(p => hostingStartupArtifacts.Any(h => h.GetMetadata("Identity") == p.GetMetadata("PackageId"))).ToArray(); - - return true; - } - } -}