diff --git a/src/core-sdk-tasks/CalculateTemplateVersions.cs b/src/core-sdk-tasks/CalculateTemplateVersions.cs index b133ea29c3b6..ed392ed4a43b 100644 --- a/src/core-sdk-tasks/CalculateTemplateVersions.cs +++ b/src/core-sdk-tasks/CalculateTemplateVersions.cs @@ -12,9 +12,6 @@ public class CalculateTemplateVersions : Task [Required] public string AspNetCorePackageVersionTemplate { get; set; } - [Required] - public string VersionSuffix { get; set; } - [Output] public string BundledTemplateInstallPath { get; set; } @@ -28,7 +25,7 @@ public class CalculateTemplateVersions : Task public override bool Execute() { - var result = Calculate(AspNetCorePackageVersionTemplate, VersionSuffix); + var result = Calculate(AspNetCorePackageVersionTemplate); BundledTemplateInstallPath = result.BundledTemplateInstallPath; BundledTemplateMajorMinorVersion = result.BundledTemplateMajorMinorVersion; BundledTemplateMajorMinorPatchVersion = result.BundledTemplateMajorMinorPatchVersion; @@ -40,16 +37,14 @@ public static (string BundledTemplateInstallPath, string BundledTemplateMajorMinorVersion, string BundledTemplateMajorMinorPatchVersion) - Calculate( - string aspNetCorePackageVersionTemplate, - string versionSuffix) + Calculate(string aspNetCorePackageVersionTemplate) { var aspNetCoreTemplate = NuGetVersion.Parse(aspNetCorePackageVersionTemplate); NuGetVersion baseMajorMinorPatch = GetBaseMajorMinorPatch(aspNetCoreTemplate); string bundledTemplateInstallPath = aspNetCoreTemplate.IsPrerelease - ? $"{baseMajorMinorPatch.Major}.{baseMajorMinorPatch.Minor}.{baseMajorMinorPatch.Patch}-{versionSuffix}" + ? $"{baseMajorMinorPatch.Major}.{baseMajorMinorPatch.Minor}.{baseMajorMinorPatch.Patch}-{aspNetCoreTemplate.Release}" : $"{baseMajorMinorPatch.Major}.{baseMajorMinorPatch.Minor}.{baseMajorMinorPatch.Patch}"; return ( diff --git a/src/redist/targets/BundledTemplates.targets b/src/redist/targets/BundledTemplates.targets index b80378d09063..00a31f8a3a7a 100644 --- a/src/redist/targets/BundledTemplates.targets +++ b/src/redist/targets/BundledTemplates.targets @@ -1,29 +1,25 @@ - + - + - + - + diff --git a/test/core-sdk-tasks.Tests/CalculateTemplateVerionsTests.cs b/test/core-sdk-tasks.Tests/CalculateTemplateVerionsTests.cs index 3d5082f324fd..29c56731fec7 100644 --- a/test/core-sdk-tasks.Tests/CalculateTemplateVerionsTests.cs +++ b/test/core-sdk-tasks.Tests/CalculateTemplateVerionsTests.cs @@ -9,7 +9,7 @@ public class CalculateTemplateVersionsTests [Fact] public void WhenAspNetCoreTemplateMajorVersionLowerthan3ItCanCalculateTemplateVersionsInStableBuilds() { - var result = CalculateTemplateVersions.Calculate("3.1.0", "dev"); + var result = CalculateTemplateVersions.Calculate("3.1.0"); result.Should() .Be(("3.1.1", "3.1", "3.1.1"), @@ -20,16 +20,16 @@ public void WhenAspNetCoreTemplateMajorVersionLowerthan3ItCanCalculateTemplateVe [Fact] public void WhenAspNetCoreTemplateMajorVersionLowerthan3ItCanCalculateTemplateVersionsInNonStableBuilds() { - var result = CalculateTemplateVersions.Calculate("3.0.0-alpha.1.20071.6", "dev"); + var result = CalculateTemplateVersions.Calculate("3.0.0-alpha.1.20071.6"); result.Should() - .Be(("3.0.1-dev", "3.0", "3.0.1")); + .Be(("3.0.1-alpha.1.20071.6", "3.0", "3.0.1")); } [Fact] public void WhenAspNetCoreTemplateMajorVersionHigherthan3ItCanCalculateTemplateVersionsInStableBuilds() { - var result = CalculateTemplateVersions.Calculate("5.1.0", "dev"); + var result = CalculateTemplateVersions.Calculate("5.1.0"); result.Should() .Be(("5.1.0", "5.1", "5.1.0"), @@ -40,10 +40,10 @@ public void WhenAspNetCoreTemplateMajorVersionHigherthan3ItCanCalculateTemplateV [Fact] public void WhenAspNetCoreTemplateMajorVersionHigherthan3ItCanCalculateTemplateVersionsInNonStableBuilds() { - var result = CalculateTemplateVersions.Calculate("5.0.0-alpha.1.20071.6", "dev"); + var result = CalculateTemplateVersions.Calculate("5.0.0-alpha.1.20071.6"); result.Should() - .Be(("5.0.0-dev", "5.0", "5.0.0")); + .Be(("5.0.0-alpha.1.20071.6", "5.0", "5.0.0")); } } }