diff --git a/build/RepositoryBuild.targets b/build/RepositoryBuild.targets index 4a42a91fff..23dadbcd76 100644 --- a/build/RepositoryBuild.targets +++ b/build/RepositoryBuild.targets @@ -67,6 +67,8 @@ + true + $(RepositoryBuildArguments) /p:AspNetUniverseBuildOffline=true @@ -78,6 +80,7 @@ $(RepositoryBuildArguments) /noconsolelogger '/l:RepoTasks.FlowLogger,$(MSBuildThisFileDirectory)tasks\bin\publish\RepoTasks.dll;Summary;FlowId=$(RepositoryToBuild)' $(RepositoryBuildArguments) '/p:DotNetAssetRootAccessTokenSuffix=$(DotNetAssetRootAccessTokenSuffix)' $(RepositoryBuildArguments) '/p:DotNetAssetRootUrl=$(DotNetAssetRootUrl)' + $(RepositoryBuildArguments) /p:SkipAspNetCoreRuntimeInstall=true $(RepositoryRoot)korebuild-lock.txt $(BuildRepositoryRoot)korebuild-lock.txt @@ -148,9 +151,12 @@ + + + - - + diff --git a/build/SharedFx.targets b/build/SharedFx.targets index 2fbdc33202..7cbdb99c5c 100644 --- a/build/SharedFx.targets +++ b/build/SharedFx.targets @@ -2,10 +2,6 @@ - - $(GetArtifactInfoDependsOn);GetMetapackageArtifactInfo - - $([MSBuild]::NormalizeDirectory($(ArtifactsDir)))assets\Runtime\$(PackageVersion)\ @@ -71,8 +67,7 @@ ReferencePackagePath="$(MetapackageWorkDirectory)$(MetapackageName).csproj" MetapackageReferenceType="$(MetapackageReferenceType)" DependencyVersionRangeType="$(MetapackageDependencyVersionRangeType)" - BuildArtifacts="@(ArtifactInfo)" - PackageArtifacts="@(PackageArtifact)" + PackageArtifacts="@(_PackageArtifactSpec)" ExternalDependencies="@(ExternalDependency)" /> diff --git a/build/Templating.targets b/build/Templating.targets deleted file mode 100644 index 5f2867073d..0000000000 --- a/build/Templating.targets +++ /dev/null @@ -1,78 +0,0 @@ - - - $(MSBuildThisFileDirectory)..\modules\Templating\ - $(GetArtifactInfoDependsOn);GetTemplateArtifactInfo - $(TestDependsOn);TestTemplates - false - - - - - RepositoryRoot=$(TemplatingProjectRoot); - BuildNumber=$(BuildNumber); - Configuration=$(Configuration); - IsFinalBuild=$(IsFinalBuild); - - - - - - - - - - - - <_BuildTemplateProjProperties> - $(TemplateProjProperties); - SkipAspNetCoreRuntimeInstall=true; - DotNetRestoreSourcePropsPath=$(GeneratedRestoreSourcesPropsPath); - DotNetPackageVersionPropsPath=$(GeneratedPackageVersionPropsPath); - SkipTests=true; - - - - - - - - - - - - - - - - - - - - - - - - - <_TestTemplateProjProperties> - $(TemplateProjProperties); - SkipAspNetCoreRuntimeInstall=true; - DotNetRestoreSourcePropsPath=$(GeneratedRestoreSourcesPropsPath); - DotNetPackageVersionPropsPath=$(GeneratedPackageVersionPropsPath); - NoBuild=true; - - - - - - - diff --git a/build/artifacts.props b/build/artifacts.props index 1082591c06..22df9cce35 100644 --- a/build/artifacts.props +++ b/build/artifacts.props @@ -31,8 +31,8 @@ - - + + @@ -144,7 +144,7 @@ - + @@ -166,12 +166,15 @@ + + + @@ -192,7 +195,6 @@ - @@ -216,6 +218,7 @@ + diff --git a/build/buildorder.props b/build/buildorder.props index 25caa29109..0c20ba10c9 100644 --- a/build/buildorder.props +++ b/build/buildorder.props @@ -46,6 +46,7 @@ + diff --git a/build/dependencies.props b/build/dependencies.props index 65a4297141..cd1d245a32 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -28,8 +28,8 @@ 4.2.1 3.1.0 1.10.0 - 2.1.0 2.1.1 + 2.1.0 1.7.3.4 2.1.1 2.2.1 @@ -92,6 +92,10 @@ 2.0.1 6.0.1 2.2.0 + 0.20.0 + 3.12.1 + 17.17134.0 + 3.12.1 1.4.0 3.2.0 1.1.11 diff --git a/build/external-dependencies.props b/build/external-dependencies.props index e0ae9909d7..f0261d2212 100644 --- a/build/external-dependencies.props +++ b/build/external-dependencies.props @@ -106,9 +106,13 @@ - + + + + + @@ -127,8 +131,8 @@ - + @@ -148,7 +152,6 @@ - @@ -156,16 +159,7 @@ - - - - - - - - - - + diff --git a/build/repo.targets b/build/repo.targets index d75f91f299..507dcaa1c0 100644 --- a/build/repo.targets +++ b/build/repo.targets @@ -2,7 +2,6 @@ - @@ -20,17 +19,16 @@ $(CleanDependsOn);CleanArtifacts;CleanUniverseArtifacts $(RestoreDependsOn);InstallDotNet $(CompileDependsOn);BuildRepositories - $(PackageDependsOn);BuildMetapackages;BuildTemplates;CheckExpectedPackagesExist + $(PackageDependsOn);BuildMetapackages;CheckExpectedPackagesExist $(TestDependsOn);_TestRepositories - $(VerifyDependsOn);VerifyCoherentVersions - $(GetArtifactInfoDependsOn);ResolveRepoInfo;GetLineupPackageInfo + $(GetArtifactInfoDependsOn);ResolveRepoInfo - + MicrosoftNETCoreAppPackageVersion=$(MicrosoftNETCoreAppPackageVersion); @@ -75,8 +73,41 @@ - - <_ShippedSolution Update="@(_ShippedSolution)" Build="false" Shipped="true" /> + <_Temp Remove="@(_Temp)" /> + <_Temp Include="@(PackageArtifact)" /> + + + + + + + + + + <_PackageArtifactWithoutMatchingInfo Include="@(_Temp)" Exclude="@(PackageArtifact)" /> + + + + + + + + %(ShippedArtifactInfo.Version) + + + + <_PackageArtifactSpec Include="@(PackageArtifact)" /> + + + + + <_ShippedSolution Update="@(_ShippedSolution)" Build="false" IsPatching="false" /> <_NoBuildSolution Update="@(_NoBuildSolution)" Build="false" /> @@ -182,6 +213,10 @@ + + + + @@ -240,17 +276,6 @@ - - - - - - - - - diff --git a/build/submodules.props b/build/submodules.props index 01498c9a97..bc6c068555 100644 --- a/build/submodules.props +++ b/build/submodules.props @@ -2,59 +2,89 @@ true + + + ProductChangesOnly + + false + ProductChangesOnly + + + true + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/tasks/AddMetapackageReferences.cs b/build/tasks/AddMetapackageReferences.cs index 4f799b19c1..57a9675061 100644 --- a/build/tasks/AddMetapackageReferences.cs +++ b/build/tasks/AddMetapackageReferences.cs @@ -29,9 +29,6 @@ namespace RepoTasks MajorMinor, // [1.1.1, 1.2.0) } - [Required] - public ITaskItem[] BuildArtifacts { get; set; } - [Required] public ITaskItem[] PackageArtifacts { get; set; } @@ -49,9 +46,6 @@ namespace RepoTasks // Parse input var metapackageArtifacts = PackageArtifacts.Where(p => p.GetMetadata(MetapackageReferenceType) == "true"); var externalArtifacts = ExternalDependencies.Where(p => p.GetMetadata(MetapackageReferenceType) == "true"); - var buildArtifacts = BuildArtifacts.Select(ArtifactInfo.Parse) - .OfType() - .Where(p => !p.IsSymbolsArtifact); var xmlDoc = new XmlDocument(); xmlDoc.Load(ReferencePackagePath); @@ -66,19 +60,7 @@ namespace RepoTasks foreach (var package in metapackageArtifacts) { var packageName = package.ItemSpec; - string packageVersion; - try - { - packageVersion = buildArtifacts - .Single(p => string.Equals(p.PackageInfo.Id, packageName, StringComparison.OrdinalIgnoreCase)) - .PackageInfo.Version.ToString(); - } - catch (InvalidOperationException) - { - Log.LogError($"Missing Package: {packageName} from build artifacts"); - throw; - } - + var packageVersion = package.GetMetadata("Version"); if (string.IsNullOrEmpty(packageVersion)) { Log.LogError("Missing version information for package {0}", packageName); diff --git a/build/tasks/AnalyzeBuildGraph.cs b/build/tasks/AnalyzeBuildGraph.cs index d695e172ff..a7193d7735 100644 --- a/build/tasks/AnalyzeBuildGraph.cs +++ b/build/tasks/AnalyzeBuildGraph.cs @@ -31,6 +31,9 @@ namespace RepoTasks [Required] public ITaskItem[] Artifacts { get; set; } + [Required] + public ITaskItem[] Repositories { get; set; } + [Required] public ITaskItem[] Dependencies { get; set; } @@ -69,6 +72,18 @@ namespace RepoTasks var solutions = factory.Create(Solutions, props, defaultConfig, _cts.Token); Log.LogMessage($"Found {solutions.Count} and {solutions.Sum(p => p.Projects.Count)} projects"); + var policies = new Dictionary(); + foreach (var repo in Repositories) + { + policies.Add(repo.ItemSpec, Enum.Parse(repo.GetMetadata("PatchPolicy"))); + } + + foreach (var solution in solutions) + { + var repoName = Path.GetFileName(solution.Directory); + solution.PatchPolicy = policies[repoName]; + } + if (_cts.IsCancellationRequested) { return false; @@ -109,9 +124,7 @@ namespace RepoTasks } var inconsistentVersions = new List(); - var reposThatShouldPatch = new HashSet(); - // TODO cleanup the 4-deep nested loops foreach (var solution in solutions) foreach (var project in solution.Projects) foreach (var tfm in project.Frameworks) @@ -147,19 +160,25 @@ namespace RepoTasks continue; } - if (!solution.ShouldBuild && solution.Shipped) + var shouldCascade = (solution.PatchPolicy & PatchPolicy.CascadeVersions) != 0; + if (!solution.ShouldBuild && !solution.IsPatching && shouldCascade) { - reposThatShouldPatch.Add(Path.GetFileName(Path.GetDirectoryName(solution.FullPath))); + var repoName = Path.GetFileName(Path.GetDirectoryName(solution.FullPath)); + Log.LogError($"{repoName} should not be marked 'IsPatching=false'. Version changes in other repositories mean it should be patched to perserve cascading version upgrades."); + } - inconsistentVersions.Add(new VersionMismatch + if (shouldCascade) { - Solution = solution, - Project = project, - PackageId = dependency.Key, - ActualVersion = dependency.Value.Version, - ExpectedVersion = package.PackageInfo.Version, - }); + inconsistentVersions.Add(new VersionMismatch + { + Solution = solution, + Project = project, + PackageId = dependency.Key, + ActualVersion = dependency.Value.Version, + ExpectedVersion = package.PackageInfo.Version, + }); + } } if (inconsistentVersions.Count != 0) @@ -192,11 +211,6 @@ namespace RepoTasks Log.LogMessage(MessageImportance.Normal, $"Potentially unused external dependency: {item.PackageId}/{item.Version}. See https://github.com/aspnet/Universe/wiki/Build-warning-and-error-codes for details."); } } - - foreach (var repo in reposThatShouldPatch) - { - Log.LogError($"{repo} should not be a 'ShippedRepository'. Version changes in other repositories mean it should be patched to perserve cascading version upgrades."); - } } private ITaskItem[] GetRepositoryBuildOrder(IEnumerable artifacts, IEnumerable solutions) diff --git a/build/tasks/CheckRepoGraph.cs b/build/tasks/CheckRepoGraph.cs index 5502d7316c..eecd32580e 100644 --- a/build/tasks/CheckRepoGraph.cs +++ b/build/tasks/CheckRepoGraph.cs @@ -155,6 +155,15 @@ namespace RepoTasks var repoName = GetDirectoryName(src.Directory); var repo = repos[repoName]; + var policy = Enum.Parse(repo.GetMetadata("PatchPolicy")); + + if ((policy & PatchPolicy.AlwaysUpdate) != 0 && !src.IsPatching) + { + Log.LogError($"{repoName} is not currently set to patch, but it should because the policy is set to always include this in servicing updates. Update the configuration in submodule.props."); + continue; + } + + var srcShouldCascade = (policy & PatchPolicy.CascadeVersions) != 0; for (var j = 0; j < repoGraph.Count; j++) { if (j == i) continue; @@ -164,9 +173,9 @@ namespace RepoTasks var targetRepoName = GetDirectoryName(target.Directory); var targetRepo = repos[targetRepoName]; - if (src.Shipped && !target.Shipped) + if (srcShouldCascade && !src.IsPatching && target.IsPatching) { - Log.LogError($"{repoName} cannot depend on {targetRepoName}. Repos marked as 'Shipped' cannot depend on repos that are rebuilding. Update the configuration in submodule.props."); + Log.LogError($"{repoName} should be patching because it depend on {targetRepoName} and its patch policy is to cascade version changes. Update the configuration in submodule.props."); } } } diff --git a/build/tasks/ProjectModel/PatchPolicy.cs b/build/tasks/ProjectModel/PatchPolicy.cs new file mode 100644 index 0000000000..a28451cabb --- /dev/null +++ b/build/tasks/ProjectModel/PatchPolicy.cs @@ -0,0 +1,31 @@ +// 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.Linq; +using NuGet.Frameworks; + +namespace RepoTasks.ProjectModel +{ + [Flags] + internal enum PatchPolicy + { + /// + /// Only produce new package versions if there were changes to product code. + /// + ProductChangesOnly = 1 << 0, + + /// + /// Packages should update in every patch. + /// + AlwaysUpdate = 1 << 1, + + /// + /// Produce new package versions if there were changes to product code, or if one of the package dependencies has updated. + /// + CascadeVersions = 1 << 2, + + AlwaysUpdateAndCascadeVersions = CascadeVersions | AlwaysUpdate, + } +} diff --git a/build/tasks/ProjectModel/SolutionInfo.cs b/build/tasks/ProjectModel/SolutionInfo.cs index 21af5e5291..cacc521367 100644 --- a/build/tasks/ProjectModel/SolutionInfo.cs +++ b/build/tasks/ProjectModel/SolutionInfo.cs @@ -9,7 +9,7 @@ namespace RepoTasks.ProjectModel { internal class SolutionInfo { - public SolutionInfo(string fullPath, string configName, IReadOnlyList projects, bool shouldBuild, bool shipped) + public SolutionInfo(string fullPath, string configName, IReadOnlyList projects, bool shouldBuild, bool isPatching) { if (string.IsNullOrEmpty(fullPath)) { @@ -26,8 +26,7 @@ namespace RepoTasks.ProjectModel ConfigName = configName; Projects = projects ?? throw new ArgumentNullException(nameof(projects)); ShouldBuild = shouldBuild; - Shipped = shipped; - + IsPatching = isPatching; foreach (var proj in Projects) { proj.SolutionInfo = this; @@ -39,6 +38,7 @@ namespace RepoTasks.ProjectModel public string ConfigName { get; } public IReadOnlyList Projects { get; } public bool ShouldBuild { get; } - public bool Shipped { get; } + public bool IsPatching { get; } + public PatchPolicy PatchPolicy { get; set; } } } diff --git a/build/tasks/ProjectModel/SolutionInfoFactory.cs b/build/tasks/ProjectModel/SolutionInfoFactory.cs index 4099399118..aac69cff08 100644 --- a/build/tasks/ProjectModel/SolutionInfoFactory.cs +++ b/build/tasks/ProjectModel/SolutionInfoFactory.cs @@ -85,14 +85,14 @@ namespace RepoTasks.ProjectModel } bool.TryParse(solution.GetMetadata("Build"), out var shouldBuild); - bool.TryParse(solution.GetMetadata("Shipped"), out var shipped); + bool.TryParse(solution.GetMetadata("IsPatching"), out var isPatching); var solutionInfo = new SolutionInfo( solutionFile, configName, projects.ToArray(), shouldBuild, - shipped); + isPatching); _buildEngine.RegisterTaskObject(key, solutionInfo, RegisteredTaskObjectLifetime.Build, allowEarlyCollection: true); diff --git a/build/tasks/RepoTasks.tasks b/build/tasks/RepoTasks.tasks index ce7b31fa2c..1339fcba27 100644 --- a/build/tasks/RepoTasks.tasks +++ b/build/tasks/RepoTasks.tasks @@ -18,7 +18,6 @@ - diff --git a/build/tasks/VerifyCoherentVersions.cs b/build/tasks/VerifyCoherentVersions.cs deleted file mode 100644 index a9b0f92644..0000000000 --- a/build/tasks/VerifyCoherentVersions.cs +++ /dev/null @@ -1,133 +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.IO; -using System.Linq; -using System.Text; -using Microsoft.Build.Framework; -using NuGet.Frameworks; -using NuGet.Packaging; -using NuGet.Packaging.Core; -using NuGet.Versioning; -using RepoTasks.ProjectModel; - -namespace RepoTasks -{ - public class VerifyCoherentVersions : Microsoft.Build.Utilities.Task - { - [Required] - public ITaskItem[] PackageFiles { get; set; } - - [Required] - public ITaskItem[] ExternalDependencies { get; set; } - - public override bool Execute() - { - if (PackageFiles.Length == 0) - { - Log.LogError("Did not find any packages to verify for version coherence"); - return false; - } - - var packageLookup = new Dictionary(StringComparer.OrdinalIgnoreCase); - var dependencyMap = new Dictionary>(StringComparer.OrdinalIgnoreCase); - - foreach (var dep in ExternalDependencies) - { - if (!dependencyMap.TryGetValue(dep.ItemSpec, out var list)) - { - dependencyMap[dep.ItemSpec] = list = new List(); - } - - list.Add(dep.GetMetadata("Version")); - } - - foreach (var file in PackageFiles) - { - PackageInfo package; - using (var reader = new PackageArchiveReader(file.ItemSpec)) - { - var identity = reader.GetIdentity(); - var metadata = new PackageBuilder(reader.GetNuspec(), basePath: null); - package = new PackageInfo(identity.Id, identity.Version, - source: Path.GetDirectoryName(file.ItemSpec), - dependencyGroups: metadata.DependencyGroups.ToArray()); - } - - if (packageLookup.TryGetValue(package.Id, out var existingPackage)) - { - Log.LogError("Multiple copies of the following package were found: " + - Environment.NewLine + - existingPackage + - Environment.NewLine + - package); - continue; - } - - packageLookup[package.Id] = package; - } - - foreach (var packageInfo in packageLookup.Values) - { - Visit(packageLookup, dependencyMap, packageInfo); - } - - Log.LogMessage(MessageImportance.High, $"Verified {PackageFiles.Length} package(s) have coherent versions"); - return !Log.HasLoggedErrors; - } - - private void Visit( - IReadOnlyDictionary packageLookup, - IReadOnlyDictionary> dependencyMap, - PackageInfo packageInfo) - { - Log.LogMessage(MessageImportance.Low, $"Processing package {packageInfo.Id}"); - try - { - foreach (var dependencySet in packageInfo.DependencyGroups) - { - foreach (var dependency in dependencySet.Packages) - { - PackageInfo dependencyPackageInfo; - var depVersion = dependency.VersionRange.MinVersion.ToString(); - if (dependencyMap.TryGetValue(dependency.Id, out var externalDepVersions)) - { - var matchedVersion = externalDepVersions.FirstOrDefault(d => depVersion.Equals(d)); - - if (matchedVersion == null) - { - var versions = string.Join(" or ", externalDepVersions); - Log.LogError($"Package {packageInfo.Id} has an external dependency on the wrong version of {dependency.Id}. " - + $"It uses {depVersion} but only {versions} is allowed."); - } - - continue; - } - else if (!packageLookup.TryGetValue(dependency.Id, out dependencyPackageInfo)) - { - Log.LogError($"Package {packageInfo.Id} has an undefined external dependency on {dependency.Id}/{depVersion}. " + - "If the package is built in aspnet/Universe, make sure it is also marked as 'ship'. " + - "If it is an external dependency, add it as a new ExternalDependency."); - continue; - } - - if (dependencyPackageInfo.Version != dependency.VersionRange.MinVersion) - { - // For any dependency in the universe - // Add a mismatch if the min version doesn't work out - // (we only really care about >= minVersion) - Log.LogError($"{packageInfo.Id} depends on {dependency.Id} " + - $"{dependency.VersionRange} ({dependencySet.TargetFramework}) when the latest build is {dependencyPackageInfo.Version}."); - } - } - } - } - catch (Exception ex) - { - Log.LogError($"Unexpected error while attempting to verify package {packageInfo.Id}.\r\n{ex}"); - } - } - } -} diff --git a/modules/AADIntegration b/modules/AADIntegration index bb49eeebe6..6f02048c3c 160000 --- a/modules/AADIntegration +++ b/modules/AADIntegration @@ -1 +1 @@ -Subproject commit bb49eeebe64905ce705f0e70f59869085adc9dce +Subproject commit 6f02048c3c5c0ee6684c241721422c2b8eebddbc diff --git a/modules/Antiforgery b/modules/Antiforgery index c26db4bb8f..93b496090e 160000 --- a/modules/Antiforgery +++ b/modules/Antiforgery @@ -1 +1 @@ -Subproject commit c26db4bb8f276c6582c3beae561342c1126eee83 +Subproject commit 93b496090e65a66bba27b67b1e22ff6adec8effc diff --git a/modules/AuthSamples b/modules/AuthSamples index 99e5f7ec0f..d861b70515 160000 --- a/modules/AuthSamples +++ b/modules/AuthSamples @@ -1 +1 @@ -Subproject commit 99e5f7ec0fae94f9f12ba473f8447e2fabb0506d +Subproject commit d861b7051505fe3f86d1498fd065e98cdd602313 diff --git a/modules/AzureIntegration b/modules/AzureIntegration index d65c138c80..88a615ba46 160000 --- a/modules/AzureIntegration +++ b/modules/AzureIntegration @@ -1 +1 @@ -Subproject commit d65c138c80b474841ce7324cd609ea6533d7345a +Subproject commit 88a615ba46c3c01ad62cc112e569ee9d4da8fd6c diff --git a/modules/BasicMiddleware b/modules/BasicMiddleware index d6a29161ee..1de636cd18 160000 --- a/modules/BasicMiddleware +++ b/modules/BasicMiddleware @@ -1 +1 @@ -Subproject commit d6a29161ee5fffd91b3269380325970d42e5d9f0 +Subproject commit 1de636cd18309070792b68888ca29c8b85fac98b diff --git a/modules/BrowserLink b/modules/BrowserLink index f818b554fd..05f8eac8a2 160000 --- a/modules/BrowserLink +++ b/modules/BrowserLink @@ -1 +1 @@ -Subproject commit f818b554fd86c3a476abfd602c5045cd3039b853 +Subproject commit 05f8eac8a233685d5bc3e8d3b59552839add4d79 diff --git a/modules/CORS b/modules/CORS index d9f5f35b7a..ec429447bf 160000 --- a/modules/CORS +++ b/modules/CORS @@ -1 +1 @@ -Subproject commit d9f5f35b7a3a7c7512e8fecad43e5ff4ffd6b587 +Subproject commit ec429447bfd5f419b9f40676b03b85a954b40f74 diff --git a/modules/Caching b/modules/Caching index 4dc546ecf4..ced279b071 160000 --- a/modules/Caching +++ b/modules/Caching @@ -1 +1 @@ -Subproject commit 4dc546ecf47cfe64104457b783e172a9f4ee36be +Subproject commit ced279b071920f055a309cd81acc333780ef2bf4 diff --git a/modules/Common b/modules/Common index 6db5f35309..6812ed2ea7 160000 --- a/modules/Common +++ b/modules/Common @@ -1 +1 @@ -Subproject commit 6db5f353092a3191cee71853fbbcebf81f1ce259 +Subproject commit 6812ed2ea751ac0c8ad0977b2e38706032b7f468 diff --git a/modules/Configuration b/modules/Configuration index 143012a16f..ef29dc86b9 160000 --- a/modules/Configuration +++ b/modules/Configuration @@ -1 +1 @@ -Subproject commit 143012a16f63a9c666d26ec053db6fd24965e3de +Subproject commit ef29dc86b970893147fd2a27d527f5a907af9fdd diff --git a/modules/DataProtection b/modules/DataProtection index 7803b6ba25..b62bb5778b 160000 --- a/modules/DataProtection +++ b/modules/DataProtection @@ -1 +1 @@ -Subproject commit 7803b6ba25f7fd12828e5a09dbb321af129933b4 +Subproject commit b62bb5778be59cbde9b2e6bbdef20f40eef42355 diff --git a/modules/DependencyInjection b/modules/DependencyInjection index 4dca2813ae..7a283947c2 160000 --- a/modules/DependencyInjection +++ b/modules/DependencyInjection @@ -1 +1 @@ -Subproject commit 4dca2813ae6e131c3d0d109656709283864fdf6c +Subproject commit 7a283947c231b6585c8ac95e653950b660f3da96 diff --git a/modules/Diagnostics b/modules/Diagnostics index d1b1a8097b..8893337fb0 160000 --- a/modules/Diagnostics +++ b/modules/Diagnostics @@ -1 +1 @@ -Subproject commit d1b1a8097be41bd9c4408c554b190a43f3eafb99 +Subproject commit 8893337fb090c523843564a91054996bfcc3cc42 diff --git a/modules/DotNetTools b/modules/DotNetTools index 4d3886fa37..084406441e 160000 --- a/modules/DotNetTools +++ b/modules/DotNetTools @@ -1 +1 @@ -Subproject commit 4d3886fa378e61ccc21e8b8adb5e1666de0ecb40 +Subproject commit 084406441e607886565bca38b9a756442bc7469e diff --git a/modules/EntityFrameworkCore b/modules/EntityFrameworkCore index 036a773d65..7a4539d408 160000 --- a/modules/EntityFrameworkCore +++ b/modules/EntityFrameworkCore @@ -1 +1 @@ -Subproject commit 036a773d65b6c89927dae3dfe54b94e63432a004 +Subproject commit 7a4539d4080163cce39f658248e7649d9b12d8a8 diff --git a/modules/EventNotification b/modules/EventNotification index 7981758af4..69d9ba1300 160000 --- a/modules/EventNotification +++ b/modules/EventNotification @@ -1 +1 @@ -Subproject commit 7981758af4141ef81f6388a92c988869aa105993 +Subproject commit 69d9ba130050107409fc5c3d9d834ca55fc7a95d diff --git a/modules/FileSystem b/modules/FileSystem index cb0eb99f24..baebb8b0c6 160000 --- a/modules/FileSystem +++ b/modules/FileSystem @@ -1 +1 @@ -Subproject commit cb0eb99f2481695d48669a3daa3b34a138e3c9d1 +Subproject commit baebb8b0c672ab37bac72d7196da1b919d362cc5 diff --git a/modules/Hosting b/modules/Hosting index cf4654189f..958d41f738 160000 --- a/modules/Hosting +++ b/modules/Hosting @@ -1 +1 @@ -Subproject commit cf4654189f59386d38afd66c9250cb1c423ecce6 +Subproject commit 958d41f73858d0d2a388e82a36f7cc719dd0eb5f diff --git a/modules/HtmlAbstractions b/modules/HtmlAbstractions index 47c5edd37a..252ae0c434 160000 --- a/modules/HtmlAbstractions +++ b/modules/HtmlAbstractions @@ -1 +1 @@ -Subproject commit 47c5edd37aad2a12d14c9dea8cfb22ef48ddb005 +Subproject commit 252ae0c434d93f5bfaf949c35edb9ef59730d0a3 diff --git a/modules/HttpAbstractions b/modules/HttpAbstractions index 78ce5dd2be..d142d58eb4 160000 --- a/modules/HttpAbstractions +++ b/modules/HttpAbstractions @@ -1 +1 @@ -Subproject commit 78ce5dd2bef4e4d37fb23d2b76770421196e1085 +Subproject commit d142d58eb43626961117136c51993d51dfb7371d diff --git a/modules/HttpClientFactory b/modules/HttpClientFactory index 3495644354..cf7cf83ee8 160000 --- a/modules/HttpClientFactory +++ b/modules/HttpClientFactory @@ -1 +1 @@ -Subproject commit 3495644354aa4bf8fc14304c2e939fb9027f857f +Subproject commit cf7cf83ee869ed50a41852f5e880d073386b7fe7 diff --git a/modules/HttpSysServer b/modules/HttpSysServer index cbbe2975bc..d8d1f36f28 160000 --- a/modules/HttpSysServer +++ b/modules/HttpSysServer @@ -1 +1 @@ -Subproject commit cbbe2975bcc1a8b1b44d0bd015d0b77a6c725c5a +Subproject commit d8d1f36f28359b76f838a99e425b2af2565538f0 diff --git a/modules/IISIntegration b/modules/IISIntegration index 4aa93d0bef..4d2e776c41 160000 --- a/modules/IISIntegration +++ b/modules/IISIntegration @@ -1 +1 @@ -Subproject commit 4aa93d0bef9e39f533913527713daca14382cbbc +Subproject commit 4d2e776c41f4ea5f696ff715b3b9e572007b0600 diff --git a/modules/Identity b/modules/Identity index 0ab8e15f05..2634637fd5 160000 --- a/modules/Identity +++ b/modules/Identity @@ -1 +1 @@ -Subproject commit 0ab8e15f0592c0529a2f9fe37edd5aab2d8c474f +Subproject commit 2634637fd535b229762b5e4a49cdd128f4d8f12e diff --git a/modules/JavaScriptServices b/modules/JavaScriptServices index a04813edc3..ea3a7bc897 160000 --- a/modules/JavaScriptServices +++ b/modules/JavaScriptServices @@ -1 +1 @@ -Subproject commit a04813edc3456446dfb2e8059a7589f9d405db16 +Subproject commit ea3a7bc8974271d6e9eeb9e890f23f953b8b40e2 diff --git a/modules/JsonPatch b/modules/JsonPatch index 5d39e86f19..218064c300 160000 --- a/modules/JsonPatch +++ b/modules/JsonPatch @@ -1 +1 @@ -Subproject commit 5d39e86f1985d99d0c530e312d5b478ddc8682a4 +Subproject commit 218064c300a7cf5a76669e133340a98a0c5517a5 diff --git a/modules/KestrelHttpServer b/modules/KestrelHttpServer index 181e521b40..85bf01da82 160000 --- a/modules/KestrelHttpServer +++ b/modules/KestrelHttpServer @@ -1 +1 @@ -Subproject commit 181e521b4003d4adb61f749d58ffeb6c2f42ff27 +Subproject commit 85bf01da82a2e6fd20c7dd3b9693468fcb2552e2 diff --git a/modules/Localization b/modules/Localization index bd43a693aa..0bcac31dd7 160000 --- a/modules/Localization +++ b/modules/Localization @@ -1 +1 @@ -Subproject commit bd43a693aac3decd8137816496f84c1842b846ad +Subproject commit 0bcac31dd705fb9db60723f5d7eaeffb728358f5 diff --git a/modules/Logging b/modules/Logging index 13c6e50447..3a553dca9b 160000 --- a/modules/Logging +++ b/modules/Logging @@ -1 +1 @@ -Subproject commit 13c6e50447e0922522ad75199c1c359c5a589cd4 +Subproject commit 3a553dca9bd3e9ab7d9351e87b75a012cd0a3b0d diff --git a/modules/MetaPackages b/modules/MetaPackages index e4d891c6f6..24a80d7553 160000 --- a/modules/MetaPackages +++ b/modules/MetaPackages @@ -1 +1 @@ -Subproject commit e4d891c6f67c9f8e3105081d338091b05f357296 +Subproject commit 24a80d755343220557f44723a26d0d1fbe91b184 diff --git a/modules/Microsoft.Data.Sqlite b/modules/Microsoft.Data.Sqlite index 3f42b6de57..3e0cdfefaf 160000 --- a/modules/Microsoft.Data.Sqlite +++ b/modules/Microsoft.Data.Sqlite @@ -1 +1 @@ -Subproject commit 3f42b6de5709b6cafb7b0d6a82d843eae2c781e1 +Subproject commit 3e0cdfefaf5ab605bdf7e82e328315c7aa64edde diff --git a/modules/MusicStore b/modules/MusicStore index 450aa97f86..c14416f26f 160000 --- a/modules/MusicStore +++ b/modules/MusicStore @@ -1 +1 @@ -Subproject commit 450aa97f861d81d1e8b020d087aafbb381e8a3b6 +Subproject commit c14416f26f3f575665d5142a4b9f677487cfcef4 diff --git a/modules/Mvc b/modules/Mvc index bd995d4cb1..d46948da1d 160000 --- a/modules/Mvc +++ b/modules/Mvc @@ -1 +1 @@ -Subproject commit bd995d4cb1d5a64b607f5de316f08acc9ff0f7d9 +Subproject commit d46948da1d4709bcb8ae0094074a307ece636b4d diff --git a/modules/MvcPrecompilation b/modules/MvcPrecompilation index 7bf7b14cf8..72d6f6ae4a 160000 --- a/modules/MvcPrecompilation +++ b/modules/MvcPrecompilation @@ -1 +1 @@ -Subproject commit 7bf7b14cf8540fa9b558a75a9ed9bfc0a10d29f8 +Subproject commit 72d6f6ae4a35c94086081319a9f86afe633a3067 diff --git a/modules/Options b/modules/Options index 8aee0a2143..2ea21ace21 160000 --- a/modules/Options +++ b/modules/Options @@ -1 +1 @@ -Subproject commit 8aee0a21430299dab73d59b661564997215912c5 +Subproject commit 2ea21ace21105df2839766a5f13e8e2636b7fc41 diff --git a/modules/Razor b/modules/Razor index e7db3f840b..056940710a 160000 --- a/modules/Razor +++ b/modules/Razor @@ -1 +1 @@ -Subproject commit e7db3f840b119e2fe08550d1e568b51dd0256eda +Subproject commit 056940710a07c2e740975ea8291ce2374d19e5c4 diff --git a/modules/ResponseCaching b/modules/ResponseCaching index 88796f41f8..777b2fbf7e 160000 --- a/modules/ResponseCaching +++ b/modules/ResponseCaching @@ -1 +1 @@ -Subproject commit 88796f41f879e201504d1d21fb2a6b45032d5e40 +Subproject commit 777b2fbf7e768221c528243773037a50423b7b34 diff --git a/modules/Routing b/modules/Routing index 9c23ffb215..58b66f7cbb 160000 --- a/modules/Routing +++ b/modules/Routing @@ -1 +1 @@ -Subproject commit 9c23ffb2159a3f3ce30511e9e7cbca6603c835bc +Subproject commit 58b66f7cbb3858aa1b7b8b2848b8d3cec4df0e40 diff --git a/modules/Scaffolding b/modules/Scaffolding index 9bcbfb021e..1ccbfe828d 160000 --- a/modules/Scaffolding +++ b/modules/Scaffolding @@ -1 +1 @@ -Subproject commit 9bcbfb021e6b5d64dd849e885b4cefd0cb3178b0 +Subproject commit 1ccbfe828da5cbe18ebed526e44a6be36a9ab00b diff --git a/modules/Security b/modules/Security index d2a8d3a61c..930ed239e4 160000 --- a/modules/Security +++ b/modules/Security @@ -1 +1 @@ -Subproject commit d2a8d3a61c4f393170be4f6e49b287d0f3a4d96d +Subproject commit 930ed239e41d7547edf06f31efa3461d1a2c6bad diff --git a/modules/ServerTests b/modules/ServerTests index 60564e7d5b..6ed63da79c 160000 --- a/modules/ServerTests +++ b/modules/ServerTests @@ -1 +1 @@ -Subproject commit 60564e7d5bb63ae2d6cc0137c5fbd508eddd2e17 +Subproject commit 6ed63da79c1605b06e69c7f3976db4db99db8e2c diff --git a/modules/Session b/modules/Session index 246aedb5bf..d20c2c8f04 160000 --- a/modules/Session +++ b/modules/Session @@ -1 +1 @@ -Subproject commit 246aedb5bf97059d25cc3e2d8de715de5156f6f6 +Subproject commit d20c2c8f04e6779239abd65c033fa66eb6c2002f diff --git a/modules/SignalR b/modules/SignalR index 475700209a..172b68a836 160000 --- a/modules/SignalR +++ b/modules/SignalR @@ -1 +1 @@ -Subproject commit 475700209abf40ecd51b4f511b29717de59c134d +Subproject commit 172b68a8360fc7e4c55c746102e44d818e400674 diff --git a/modules/StaticFiles b/modules/StaticFiles index d1235cdda0..2b285667a8 160000 --- a/modules/StaticFiles +++ b/modules/StaticFiles @@ -1 +1 @@ -Subproject commit d1235cdda0c40541cf8e50f475f6d2168d624eb9 +Subproject commit 2b285667a8b387b5b6f754029f152db21df489f1 diff --git a/modules/Templating b/modules/Templating index dbc930cc78..201a35e095 160000 --- a/modules/Templating +++ b/modules/Templating @@ -1 +1 @@ -Subproject commit dbc930cc789220920bfc7ac5e15d708addee17ad +Subproject commit 201a35e095d00c085bb5b16d39d41e9f68ec08c6 diff --git a/modules/Testing b/modules/Testing index 1eedb2ce3f..8639233365 160000 --- a/modules/Testing +++ b/modules/Testing @@ -1 +1 @@ -Subproject commit 1eedb2ce3ff4ab8d010dd7e16b53a9c8795f9d4e +Subproject commit 8639233365b85997c7e0b97b50f23aaddd36f671 diff --git a/modules/WebSockets b/modules/WebSockets index 7922b27c65..9e7dfc4d15 160000 --- a/modules/WebSockets +++ b/modules/WebSockets @@ -1 +1 @@ -Subproject commit 7922b27c65a94ba952aefc1306aaa1f7e5f5c58d +Subproject commit 9e7dfc4d150f728e911dae44890fe17ce4872239 diff --git a/scripts/PatchVersionPrefix.ps1 b/scripts/PatchVersionPrefix.ps1 index 7ca81a78c5..d8cce86487 100755 --- a/scripts/PatchVersionPrefix.ps1 +++ b/scripts/PatchVersionPrefix.ps1 @@ -5,11 +5,19 @@ Updates the version.props file in repos to a newer patch version .PARAMETER Repos A list of the repositories that should be patched +.PARAMETER Mode + Version bump options: Major, Minor, Patch +.PARAMETER VersionSuffix + The version suffix to use #> -[CmdletBinding()] +[cmdletbinding(SupportsShouldProcess = $true)] param( [Parameter(Mandatory = $true)] [string[]]$Repos, + [Parameter(Mandatory = $true)] + [ValidateSet('Major', 'Minor', 'Patch')] + [string]$Mode, + [string]$VersionSuffix = $null, [switch]$NoCommit ) @@ -17,12 +25,39 @@ $ErrorActionPreference = 'Stop' Import-Module -Scope Local -Force "$PSScriptRoot/common.psm1" -function BumpPatch([System.Xml.XmlNode]$node) { +function SetVersionSuffix([System.Xml.XmlNode]$node) { + if (-not $node) { + return + } + $node.InnerText = $VersionSuffix + return "Setting $($node.Name) to $VersionSuffix" +} + +function BumpVersion([System.Xml.XmlNode]$node) { if (-not $node) { return } [version] $version = $node.InnerText - $node.InnerText = "{0}.{1}.{2}" -f $version.Major, $version.Minor, ($version.Build + 1) + + $experimental = $version.Major -eq 0 + + switch ($mode) { + { ($_ -ne 'Patch') -and $experimental} { + $node.InnerText = "{0}.{1}.{2}" -f $version.Major, ($version.Minor + 1), 0 + } + { ($_ -eq 'Major') -and -not $experimental } { + $node.InnerText = "{0}.{1}.{2}" -f ($version.Major + 1), 0, 0 + } + { ($_ -eq 'Minor') -and -not $experimental } { + $node.InnerText = "{0}.{1}.{2}" -f $version.Major, ($version.Minor + 1), 0 + } + 'Patch' { + $node.InnerText = "{0}.{1}.{2}" -f $version.Major, $version.Minor, ($version.Build + 1) + } + default { + throw "Could not figure out how to apply patch policy $mode" + } + } return "Bumping version from $version to $($node.InnerText)" } @@ -46,17 +81,26 @@ foreach ($repo in $Repos) { write-error "$path does not have VersionSuffix" } + if ($VersionSuffix) { + SetVersionSuffix $xml.SelectSingleNode('/Project/PropertyGroup/VersionSuffix') | write-host + SetVersionSuffix $xml.SelectSingleNode('/Project/PropertyGroup/ExperimentalProjectVersionSuffix') | write-host + SetVersionSuffix $xml.SelectSingleNode('/Project/PropertyGroup/ExperimentalVersionSuffix') | write-host + } + $versionPrefix = $xml.SelectSingleNode('/Project/PropertyGroup/VersionPrefix') $epxVersionPrefix = $xml.SelectSingleNode('/Project/PropertyGroup/ExperimentalProjectVersionPrefix') $exVersionPrefix = $xml.SelectSingleNode('/Project/PropertyGroup/ExperimentalVersionPrefix') - BumpPatch $epxVersionPrefix | write-host - BumpPatch $exVersionPrefix | write-host - $message = BumpPatch $versionPrefix + BumpVersion $epxVersionPrefix | write-host + BumpVersion $exVersionPrefix | write-host + $message = BumpVersion $versionPrefix Write-Host $message - SaveXml $xml $path - if (-not $NoCommit) { - Invoke-Block { & git add $path } - Invoke-Block { & git commit -m $message } + + if ($PSCmdlet.ShouldProcess("Update $path")) { + SaveXml $xml $path + if (-not $NoCommit) { + Invoke-Block { & git add $path } + Invoke-Block { & git commit -m $message } + } } } finally