Merge pull request #6246 from dotnet-maestro-bot/merge/release/3.1.2xx-to-master
[automated] Merge branch 'release/3.1.2xx' => 'release/5.0.1xx-preview1'
This commit is contained in:
commit
ec94177b8b
12 changed files with 175 additions and 96 deletions
|
@ -21,6 +21,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Dotnet.Sdk.Intern
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SdkTests", "test\SdkTests\SdkTests.csproj", "{CB1EE94E-CB83-4071-9DD0-9929AE2B7282}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SdkTests", "test\SdkTests\SdkTests.csproj", "{CB1EE94E-CB83-4071-9DD0-9929AE2B7282}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "core-sdk-tasks.Tests", "test\core-sdk-tasks.Tests\core-sdk-tasks.Tests.csproj", "{658EF9BE-452C-4D31-AA24-B9E2235799A8}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
@ -55,6 +57,10 @@ Global
|
||||||
{CB1EE94E-CB83-4071-9DD0-9929AE2B7282}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{CB1EE94E-CB83-4071-9DD0-9929AE2B7282}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{CB1EE94E-CB83-4071-9DD0-9929AE2B7282}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{CB1EE94E-CB83-4071-9DD0-9929AE2B7282}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{CB1EE94E-CB83-4071-9DD0-9929AE2B7282}.Release|Any CPU.Build.0 = Release|Any CPU
|
{CB1EE94E-CB83-4071-9DD0-9929AE2B7282}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{658EF9BE-452C-4D31-AA24-B9E2235799A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{658EF9BE-452C-4D31-AA24-B9E2235799A8}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{658EF9BE-452C-4D31-AA24-B9E2235799A8}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{658EF9BE-452C-4D31-AA24-B9E2235799A8}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
@ -66,6 +72,7 @@ Global
|
||||||
{78E15EC1-7732-41E3-8591-934E9F583254} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7}
|
{78E15EC1-7732-41E3-8591-934E9F583254} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7}
|
||||||
{7EE15292-2CAD-44FA-8A1F-BAC4688A49E0} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F}
|
{7EE15292-2CAD-44FA-8A1F-BAC4688A49E0} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F}
|
||||||
{CB1EE94E-CB83-4071-9DD0-9929AE2B7282} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7}
|
{CB1EE94E-CB83-4071-9DD0-9929AE2B7282} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7}
|
||||||
|
{658EF9BE-452C-4D31-AA24-B9E2235799A8} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
SolutionGuid = {B526D2CE-EE2D-4AD4-93EF-1867D90FF1F5}
|
SolutionGuid = {B526D2CE-EE2D-4AD4-93EF-1867D90FF1F5}
|
||||||
|
|
79
src/core-sdk-tasks/CalculateTemplateVersions.cs
Normal file
79
src/core-sdk-tasks/CalculateTemplateVersions.cs
Normal file
|
@ -0,0 +1,79 @@
|
||||||
|
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
||||||
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
|
||||||
|
using Microsoft.Build.Framework;
|
||||||
|
using Microsoft.Build.Utilities;
|
||||||
|
using NuGet.Versioning;
|
||||||
|
|
||||||
|
namespace Microsoft.DotNet.Cli.Build
|
||||||
|
{
|
||||||
|
public class CalculateTemplateVersions : Task
|
||||||
|
{
|
||||||
|
[Required]
|
||||||
|
public string AspNetCorePackageVersionTemplate { get; set; }
|
||||||
|
|
||||||
|
[Required]
|
||||||
|
public string VersionSuffix { get; set; }
|
||||||
|
|
||||||
|
[Output]
|
||||||
|
public string BundledTemplateInstallPath { get; set; }
|
||||||
|
|
||||||
|
[Output]
|
||||||
|
public string BundledTemplateMajorMinorVersion { get; set; }
|
||||||
|
|
||||||
|
[Output]
|
||||||
|
public string BundledTemplateMajorMinorPatchVersion { get; set; }
|
||||||
|
|
||||||
|
private const int _patchVersionResetOffset = 1;
|
||||||
|
|
||||||
|
public override bool Execute()
|
||||||
|
{
|
||||||
|
var result = Calculate(AspNetCorePackageVersionTemplate, VersionSuffix);
|
||||||
|
BundledTemplateInstallPath = result.BundledTemplateInstallPath;
|
||||||
|
BundledTemplateMajorMinorVersion = result.BundledTemplateMajorMinorVersion;
|
||||||
|
BundledTemplateMajorMinorPatchVersion = result.BundledTemplateMajorMinorPatchVersion;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static
|
||||||
|
(string BundledTemplateInstallPath,
|
||||||
|
string BundledTemplateMajorMinorVersion,
|
||||||
|
string BundledTemplateMajorMinorPatchVersion)
|
||||||
|
Calculate(
|
||||||
|
string aspNetCorePackageVersionTemplate,
|
||||||
|
string versionSuffix)
|
||||||
|
{
|
||||||
|
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}";
|
||||||
|
|
||||||
|
return (
|
||||||
|
bundledTemplateInstallPath,
|
||||||
|
$"{baseMajorMinorPatch.Major}.{baseMajorMinorPatch.Minor}",
|
||||||
|
$"{baseMajorMinorPatch.Major}.{baseMajorMinorPatch.Minor}.{baseMajorMinorPatch.Patch}");
|
||||||
|
}
|
||||||
|
|
||||||
|
private static NuGetVersion GetBaseMajorMinorPatch(NuGetVersion aspNetCoreTemplate)
|
||||||
|
{
|
||||||
|
// due to historical bug https://github.com/dotnet/core-sdk/issues/6243
|
||||||
|
// we need to increase patch version by one in order to "reset" existing install ComponentId
|
||||||
|
// more in the above bug's detail.
|
||||||
|
// There is no non-deterministic existing ComponentId under Major version 5.
|
||||||
|
// so only apply the patch bump when below 5
|
||||||
|
|
||||||
|
int basePatch =
|
||||||
|
aspNetCoreTemplate.Major < 5
|
||||||
|
? aspNetCoreTemplate.Patch + _patchVersionResetOffset
|
||||||
|
: aspNetCoreTemplate.Patch;
|
||||||
|
|
||||||
|
var baseMajorMinorPatch = new NuGetVersion(aspNetCoreTemplate.Major, aspNetCoreTemplate.Minor,
|
||||||
|
basePatch);
|
||||||
|
return baseMajorMinorPatch;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -15,7 +15,6 @@
|
||||||
<SharedFrameworkNugetName>$(SharedFrameworkName)</SharedFrameworkNugetName>
|
<SharedFrameworkNugetName>$(SharedFrameworkName)</SharedFrameworkNugetName>
|
||||||
<BundledTemplates31BrandName>Microsoft .NET Core 3.1 Templates $(Version)</BundledTemplates31BrandName>
|
<BundledTemplates31BrandName>Microsoft .NET Core 3.1 Templates $(Version)</BundledTemplates31BrandName>
|
||||||
<BundledTemplates30BrandName>Microsoft .NET Core 3.0 Templates $(Version)</BundledTemplates30BrandName>
|
<BundledTemplates30BrandName>Microsoft .NET Core 3.0 Templates $(Version)</BundledTemplates30BrandName>
|
||||||
<BundledTemplates22BrandName>Microsoft .NET Core 2.2 Templates $(Version)</BundledTemplates22BrandName>
|
|
||||||
<BundledTemplates21BrandName>Microsoft .NET Core 2.1 Templates $(Version)</BundledTemplates21BrandName>
|
<BundledTemplates21BrandName>Microsoft .NET Core 2.1 Templates $(Version)</BundledTemplates21BrandName>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Target>
|
</Target>
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
Properties="ArtifactsDir=$(ArtifactsDir)tasks\"/>
|
Properties="ArtifactsDir=$(ArtifactsDir)tasks\"/>
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
|
<UsingTask TaskName="CalculateTemplateVersions" AssemblyFile="$(CoreSdkTaskDll)" />
|
||||||
<UsingTask TaskName="GetCurrentRuntimeInformation" AssemblyFile="$(CoreSdkTaskDll)" />
|
<UsingTask TaskName="GetCurrentRuntimeInformation" AssemblyFile="$(CoreSdkTaskDll)" />
|
||||||
<UsingTask TaskName="DownloadFile" AssemblyFile="$(CoreSdkTaskDll)" />
|
<UsingTask TaskName="DownloadFile" AssemblyFile="$(CoreSdkTaskDll)" />
|
||||||
<UsingTask TaskName="ExtractArchiveToDirectory" AssemblyFile="$(CoreSdkTaskDll)" />
|
<UsingTask TaskName="ExtractArchiveToDirectory" AssemblyFile="$(CoreSdkTaskDll)" />
|
||||||
|
|
|
@ -1,60 +1,39 @@
|
||||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<Target Name="CalculateTemplatesVersions" DependsOnTargets="SetupWixProperties">
|
<Target Name="CalculateTemplatesVersions" DependsOnTargets="SetupWixProperties">
|
||||||
<PropertyGroup>
|
|
||||||
<AspNetCore31VersionPreReleaseSeparator>$(AspNetCorePackageVersionFor31Templates.IndexOf('-'))</AspNetCore31VersionPreReleaseSeparator>
|
|
||||||
<AspNetCore31VersionMajorMinorPatchVersion>$(AspNetCorePackageVersionFor31Templates)</AspNetCore31VersionMajorMinorPatchVersion>
|
|
||||||
<AspNetCore31VersionMajorMinorPatchVersion Condition=" '$(AspNetCore31VersionPreReleaseSeparator)' != -1 ">$(AspNetCorePackageVersionFor31Templates.Substring(0, $(AspNetCore31VersionPreReleaseSeparator)))</AspNetCore31VersionMajorMinorPatchVersion>
|
|
||||||
<BundledTemplates31InstallPath>$(AspNetCore31VersionMajorMinorPatchVersion)</BundledTemplates31InstallPath>
|
|
||||||
<BundledTemplates31InstallPath Condition=" '$(AspNetCore31VersionPreReleaseSeparator)' != -1 ">$(BundledTemplates31InstallPath)-$(VersionSuffix)</BundledTemplates31InstallPath>
|
|
||||||
<Templates31VersionPatchSeparatorIndex>$([MSBuild]::Add($(AspNetCore31VersionMajorMinorPatchVersion.IndexOf('.')), 1))</Templates31VersionPatchSeparatorIndex>
|
|
||||||
<Templates31VersionPatchSeparatorIndex>$(AspNetCore31VersionMajorMinorPatchVersion.IndexOf('.', $(Templates31VersionPatchSeparatorIndex)))</Templates31VersionPatchSeparatorIndex>
|
|
||||||
<BundledTemplates31MajorMinorVersion>$(AspNetCore31VersionMajorMinorPatchVersion.Substring(0, $(Templates31VersionPatchSeparatorIndex)))</BundledTemplates31MajorMinorVersion>
|
|
||||||
|
|
||||||
<AspNetCore30VersionPreReleaseSeparator>$(AspNetCorePackageVersionFor30Templates.IndexOf('-'))</AspNetCore30VersionPreReleaseSeparator>
|
<CalculateTemplateVersions AspNetCorePackageVersionTemplate="$(AspNetCorePackageVersionFor31Templates)"
|
||||||
<AspNetCore30VersionMajorMinorPatchVersion>$(AspNetCorePackageVersionFor30Templates)</AspNetCore30VersionMajorMinorPatchVersion>
|
VersionSuffix="$(VersionSuffix)">
|
||||||
<AspNetCore30VersionMajorMinorPatchVersion Condition=" '$(AspNetCore30VersionPreReleaseSeparator)' != -1 ">$(AspNetCorePackageVersionFor30Templates.Substring(0, $(AspNetCore30VersionPreReleaseSeparator)))</AspNetCore30VersionMajorMinorPatchVersion>
|
<Output TaskParameter="BundledTemplateInstallPath" PropertyName="BundledTemplates31InstallPath" />
|
||||||
<BundledTemplates30InstallPath>$(AspNetCore30VersionMajorMinorPatchVersion)</BundledTemplates30InstallPath>
|
<Output TaskParameter="BundledTemplateMajorMinorVersion" PropertyName="BundledTemplates31MajorMinorVersion" />
|
||||||
<BundledTemplates30InstallPath Condition=" '$(AspNetCore30VersionPreReleaseSeparator)' != -1 ">$(BundledTemplates30InstallPath)-$(VersionSuffix)</BundledTemplates30InstallPath>
|
<Output TaskParameter="BundledTemplateMajorMinorPatchVersion" PropertyName="BundledTemplates31MajorMinorPatchVersion" />
|
||||||
<Templates30VersionPatchSeparatorIndex>$([MSBuild]::Add($(AspNetCore30VersionMajorMinorPatchVersion.IndexOf('.')), 1))</Templates30VersionPatchSeparatorIndex>
|
</CalculateTemplateVersions>
|
||||||
<Templates30VersionPatchSeparatorIndex>$(AspNetCore30VersionMajorMinorPatchVersion.IndexOf('.', $(Templates30VersionPatchSeparatorIndex)))</Templates30VersionPatchSeparatorIndex>
|
|
||||||
<BundledTemplates30MajorMinorVersion>$(AspNetCore30VersionMajorMinorPatchVersion.Substring(0, $(Templates30VersionPatchSeparatorIndex)))</BundledTemplates30MajorMinorVersion>
|
|
||||||
|
|
||||||
<AspNetCore22VersionPreReleaseSeparator>$(AspNetCorePackageVersionFor22Templates.IndexOf('-'))</AspNetCore22VersionPreReleaseSeparator>
|
<CalculateTemplateVersions AspNetCorePackageVersionTemplate="$(AspNetCorePackageVersionFor30Templates)"
|
||||||
<AspNetCore22VersionMajorMinorPatchVersion>$(AspNetCorePackageVersionFor22Templates)</AspNetCore22VersionMajorMinorPatchVersion>
|
VersionSuffix="$(VersionSuffix)">
|
||||||
<AspNetCore22VersionMajorMinorPatchVersion Condition=" '$(AspNetCore22VersionPreReleaseSeparator)' != -1 ">$(AspNetCorePackageVersionFor22Templates.Substring(0, $(AspNetCore22VersionPreReleaseSeparator)))</AspNetCore22VersionMajorMinorPatchVersion>
|
<Output TaskParameter="BundledTemplateInstallPath" PropertyName="BundledTemplates30InstallPath" />
|
||||||
<BundledTemplates22InstallPath>$(AspNetCore22VersionMajorMinorPatchVersion)</BundledTemplates22InstallPath>
|
<Output TaskParameter="BundledTemplateMajorMinorVersion" PropertyName="BundledTemplates30MajorMinorVersion" />
|
||||||
<BundledTemplates22InstallPath Condition=" '$(AspNetCore22VersionPreReleaseSeparator)' != -1 ">$(BundledTemplates22InstallPath)-$(VersionSuffix)</BundledTemplates22InstallPath>
|
<Output TaskParameter="BundledTemplateMajorMinorPatchVersion" PropertyName="BundledTemplates30MajorMinorPatchVersion" />
|
||||||
<Templates22VersionPatchSeparatorIndex>$([MSBuild]::Add($(AspNetCore22VersionMajorMinorPatchVersion.IndexOf('.')), 1))</Templates22VersionPatchSeparatorIndex>
|
</CalculateTemplateVersions>
|
||||||
<Templates22VersionPatchSeparatorIndex>$(AspNetCore22VersionMajorMinorPatchVersion.IndexOf('.', $(Templates22VersionPatchSeparatorIndex)))</Templates22VersionPatchSeparatorIndex>
|
|
||||||
<BundledTemplates22MajorMinorVersion>$(AspNetCore22VersionMajorMinorPatchVersion.Substring(0, $(Templates22VersionPatchSeparatorIndex)))</BundledTemplates22MajorMinorVersion>
|
|
||||||
|
|
||||||
<AspNetCore21VersionPreReleaseSeparator>$(AspNetCorePackageVersionFor21Templates.IndexOf('-'))</AspNetCore21VersionPreReleaseSeparator>
|
<CalculateTemplateVersions AspNetCorePackageVersionTemplate="$(AspNetCorePackageVersionFor21Templates)"
|
||||||
<AspNetCore21VersionMajorMinorPatchVersion>$(AspNetCorePackageVersionFor21Templates)</AspNetCore21VersionMajorMinorPatchVersion>
|
VersionSuffix="$(VersionSuffix)">
|
||||||
<AspNetCore21VersionMajorMinorPatchVersion Condition=" '$(AspNetCore21VersionPreReleaseSeparator)' != -1 ">$(AspNetCorePackageVersionFor21Templates.Substring(0, $(AspNetCore21VersionPreReleaseSeparator)))</AspNetCore21VersionMajorMinorPatchVersion>
|
<Output TaskParameter="BundledTemplateInstallPath" PropertyName="BundledTemplates21InstallPath" />
|
||||||
<BundledTemplates21InstallPath>$(AspNetCore21VersionMajorMinorPatchVersion)</BundledTemplates21InstallPath>
|
<Output TaskParameter="BundledTemplateMajorMinorVersion" PropertyName="BundledTemplates21MajorMinorVersion" />
|
||||||
<BundledTemplates21InstallPath Condition=" '$(AspNetCore21VersionPreReleaseSeparator)' != -1 ">$(BundledTemplates21InstallPath)-$(VersionSuffix)</BundledTemplates21InstallPath>
|
<Output TaskParameter="BundledTemplateMajorMinorPatchVersion" PropertyName="BundledTemplates21MajorMinorPatchVersion" />
|
||||||
<Templates21VersionPatchSeparatorIndex>$([MSBuild]::Add($(AspNetCore21VersionMajorMinorPatchVersion.IndexOf('.')), 1))</Templates21VersionPatchSeparatorIndex>
|
</CalculateTemplateVersions>
|
||||||
<Templates21VersionPatchSeparatorIndex>$(AspNetCore21VersionMajorMinorPatchVersion.IndexOf('.', $(Templates21VersionPatchSeparatorIndex)))</Templates21VersionPatchSeparatorIndex>
|
|
||||||
<BundledTemplates21MajorMinorVersion>$(AspNetCore21VersionMajorMinorPatchVersion.Substring(0, $(Templates21VersionPatchSeparatorIndex)))</BundledTemplates21MajorMinorVersion>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<GenerateMsiVersionFromFullVersion VersionRevision="$(CombinedBuildNumberAndRevision)"
|
<GenerateMsiVersionFromFullVersion VersionRevision="$(CombinedBuildNumberAndRevision)"
|
||||||
VersionMajorMinorPatch="$(AspNetCore31VersionMajorMinorPatchVersion)">
|
VersionMajorMinorPatch="$(BundledTemplates31MajorMinorPatchVersion)">
|
||||||
<Output TaskParameter="MsiVersion" PropertyName="BundledTemplates31MSIVersion" />
|
<Output TaskParameter="MsiVersion" PropertyName="BundledTemplates31MSIVersion" />
|
||||||
</GenerateMsiVersionFromFullVersion>
|
</GenerateMsiVersionFromFullVersion>
|
||||||
|
|
||||||
<GenerateMsiVersionFromFullVersion VersionRevision="$(CombinedBuildNumberAndRevision)"
|
<GenerateMsiVersionFromFullVersion VersionRevision="$(CombinedBuildNumberAndRevision)"
|
||||||
VersionMajorMinorPatch="$(AspNetCore30VersionMajorMinorPatchVersion)">
|
VersionMajorMinorPatch="$(BundledTemplates30MajorMinorPatchVersion)">
|
||||||
<Output TaskParameter="MsiVersion" PropertyName="BundledTemplates30MSIVersion" />
|
<Output TaskParameter="MsiVersion" PropertyName="BundledTemplates30MSIVersion" />
|
||||||
</GenerateMsiVersionFromFullVersion>
|
</GenerateMsiVersionFromFullVersion>
|
||||||
|
|
||||||
<GenerateMsiVersionFromFullVersion VersionRevision="$(CombinedBuildNumberAndRevision)"
|
<GenerateMsiVersionFromFullVersion VersionRevision="$(CombinedBuildNumberAndRevision)"
|
||||||
VersionMajorMinorPatch="$(AspNetCore22VersionMajorMinorPatchVersion)">
|
VersionMajorMinorPatch="$(BundledTemplates21MajorMinorPatchVersion)">
|
||||||
<Output TaskParameter="MsiVersion" PropertyName="BundledTemplates22MSIVersion" />
|
|
||||||
</GenerateMsiVersionFromFullVersion>
|
|
||||||
|
|
||||||
<GenerateMsiVersionFromFullVersion VersionRevision="$(CombinedBuildNumberAndRevision)"
|
|
||||||
VersionMajorMinorPatch="$(AspNetCore21VersionMajorMinorPatchVersion)">
|
|
||||||
<Output TaskParameter="MsiVersion" PropertyName="BundledTemplates21MSIVersion" />
|
<Output TaskParameter="MsiVersion" PropertyName="BundledTemplates21MSIVersion" />
|
||||||
</GenerateMsiVersionFromFullVersion>
|
</GenerateMsiVersionFromFullVersion>
|
||||||
</Target>
|
</Target>
|
||||||
|
@ -81,15 +60,6 @@
|
||||||
<Bundled30Templates Include="Microsoft.DotNet.Web.Spa.ProjectTemplates.3.0" PackageVersion="$(AspNetCorePackageVersionFor30Templates)" />
|
<Bundled30Templates Include="Microsoft.DotNet.Web.Spa.ProjectTemplates.3.0" PackageVersion="$(AspNetCorePackageVersionFor30Templates)" />
|
||||||
<Bundled30Templates Include="NUnit3.DotNetNew.Template" PackageVersion="$(NUnit3Templates30PackageVersion)" />
|
<Bundled30Templates Include="NUnit3.DotNetNew.Template" PackageVersion="$(NUnit3Templates30PackageVersion)" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<Bundled22Templates Include="Microsoft.DotNet.Common.ItemTemplates" PackageVersion="$(MicrosoftDotNetCommonItemTemplates22PackageVersion)" />
|
|
||||||
<Bundled22Templates Include="Microsoft.DotNet.Common.ProjectTemplates.2.2" PackageVersion="$(MicrosoftDotNetCommonProjectTemplates22PackageVersion)" />
|
|
||||||
<Bundled22Templates Include="Microsoft.DotNet.Test.ProjectTemplates.2.2" PackageVersion="$(MicrosoftDotNetTestProjectTemplates22PackageVersion)" />
|
|
||||||
<Bundled22Templates Include="Microsoft.DotNet.Web.ItemTemplates" PackageVersion="$(AspNetCorePackageVersionFor22Templates)" />
|
|
||||||
<Bundled22Templates Include="Microsoft.DotNet.Web.ProjectTemplates.2.2" PackageVersion="$(AspNetCorePackageVersionFor22Templates)" />
|
|
||||||
<Bundled22Templates Include="Microsoft.DotNet.Web.Spa.ProjectTemplates.2.2" PackageVersion="$(AspNetCorePackageVersionFor22Templates)" />
|
|
||||||
<Bundled22Templates Include="NUnit3.DotNetNew.Template" PackageVersion="$(NUnit3Templates22PackageVersion)" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Bundled21Templates Include="Microsoft.DotNet.Common.ItemTemplates" PackageVersion="$(MicrosoftDotNetCommonItemTemplates21PackageVersion)" />
|
<Bundled21Templates Include="Microsoft.DotNet.Common.ItemTemplates" PackageVersion="$(MicrosoftDotNetCommonItemTemplates21PackageVersion)" />
|
||||||
<Bundled21Templates Include="Microsoft.DotNet.Common.ProjectTemplates.2.1" PackageVersion="$(MicrosoftDotNetCommonProjectTemplates21PackageVersion)" />
|
<Bundled21Templates Include="Microsoft.DotNet.Common.ProjectTemplates.2.1" PackageVersion="$(MicrosoftDotNetCommonProjectTemplates21PackageVersion)" />
|
||||||
|
@ -114,13 +84,6 @@
|
||||||
<Version>[%(PackageVersion)]</Version>
|
<Version>[%(PackageVersion)]</Version>
|
||||||
</Bundled30Templates>
|
</Bundled30Templates>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<Bundled22Templates Update="@(Bundled22Templates)">
|
|
||||||
<NupkgPathRelativeToPackageRoot>%(Identity)/%(PackageVersion)/%(Identity).%(PackageVersion).nupkg</NupkgPathRelativeToPackageRoot>
|
|
||||||
<RestoredNupkgPath>$(NuGetPackageRoot)$([MSBuild]::ValueOrDefault('%(NupkgPathRelativeToPackageRoot)', '').ToLower())</RestoredNupkgPath>
|
|
||||||
<Version>[%(PackageVersion)]</Version>
|
|
||||||
</Bundled22Templates>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Bundled21Templates Update="@(Bundled21Templates)">
|
<Bundled21Templates Update="@(Bundled21Templates)">
|
||||||
<NupkgPathRelativeToPackageRoot>%(Identity)/%(PackageVersion)/%(Identity).%(PackageVersion).nupkg</NupkgPathRelativeToPackageRoot>
|
<NupkgPathRelativeToPackageRoot>%(Identity)/%(PackageVersion)/%(Identity).%(PackageVersion).nupkg</NupkgPathRelativeToPackageRoot>
|
||||||
|
@ -133,32 +96,27 @@
|
||||||
<!-- PackageDownload items must not have duplicate itemspecs, handle packages with multiple versions specially below -->
|
<!-- PackageDownload items must not have duplicate itemspecs, handle packages with multiple versions specially below -->
|
||||||
|
|
||||||
<PackageDownload Include="@(Bundled21Templates)" Exclude="@(PackageDownload)" />
|
<PackageDownload Include="@(Bundled21Templates)" Exclude="@(PackageDownload)" />
|
||||||
<PackageDownload Include="@(Bundled22Templates)" Exclude="@(PackageDownload)" />
|
|
||||||
<PackageDownload Include="@(Bundled30Templates)" Exclude="@(PackageDownload)" />
|
<PackageDownload Include="@(Bundled30Templates)" Exclude="@(PackageDownload)" />
|
||||||
<PackageDownload Include="@(Bundled31Templates)" Exclude="@(PackageDownload)" />
|
<PackageDownload Include="@(Bundled31Templates)" Exclude="@(PackageDownload)" />
|
||||||
|
|
||||||
<PackageDownload Update="Microsoft.DotNet.Common.ItemTemplates"
|
<PackageDownload Update="Microsoft.DotNet.Common.ItemTemplates"
|
||||||
Version="[$(MicrosoftDotNetCommonItemTemplates21PackageVersion)];
|
Version="[$(MicrosoftDotNetCommonItemTemplates21PackageVersion)];
|
||||||
[$(MicrosoftDotNetCommonItemTemplates22PackageVersion)];
|
|
||||||
[$(MicrosoftDotNetCommonItemTemplates30PackageVersion)];
|
[$(MicrosoftDotNetCommonItemTemplates30PackageVersion)];
|
||||||
[$(MicrosoftDotNetCommonItemTemplates31PackageVersion)];
|
[$(MicrosoftDotNetCommonItemTemplates31PackageVersion)];
|
||||||
" />
|
" />
|
||||||
|
|
||||||
<PackageDownload Update="Microsoft.DotNet.Web.Spa.ProjectTemplates"
|
<PackageDownload Update="Microsoft.DotNet.Web.Spa.ProjectTemplates"
|
||||||
Version="[$(AspNetCorePackageVersionFor21Templates)];
|
Version="[$(AspNetCorePackageVersionFor21Templates)];
|
||||||
[$(AspNetCorePackageVersionFor22Templates)];
|
|
||||||
" />
|
" />
|
||||||
|
|
||||||
<PackageDownload Update="Microsoft.DotNet.Web.ItemTemplates"
|
<PackageDownload Update="Microsoft.DotNet.Web.ItemTemplates"
|
||||||
Version="[$(AspNetCorePackageVersionFor21Templates)];
|
Version="[$(AspNetCorePackageVersionFor21Templates)];
|
||||||
[$(AspNetCorePackageVersionFor22Templates)];
|
|
||||||
[$(AspNetCorePackageVersionFor30Templates)];
|
[$(AspNetCorePackageVersionFor30Templates)];
|
||||||
[$(AspNetCorePackageVersionFor31Templates)];
|
[$(AspNetCorePackageVersionFor31Templates)];
|
||||||
" />
|
" />
|
||||||
|
|
||||||
<PackageDownload Update="NUnit3.DotNetNew.Template"
|
<PackageDownload Update="NUnit3.DotNetNew.Template"
|
||||||
Version="[$(NUnit3Templates21PackageVersion)];
|
Version="[$(NUnit3Templates21PackageVersion)];
|
||||||
[$(NUnit3Templates22PackageVersion)];
|
|
||||||
[$(NUnit3Templates30PackageVersion)];
|
[$(NUnit3Templates30PackageVersion)];
|
||||||
[$(NUnit3Templates31PackageVersion)];
|
[$(NUnit3Templates31PackageVersion)];
|
||||||
" />
|
" />
|
||||||
|
@ -175,7 +133,7 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="LayoutTemplates"
|
<Target Name="LayoutTemplates"
|
||||||
DependsOnTargets="LayoutTemplatesForSDK;LayoutTemplatesFor31MSI;LayoutTemplatesFor30MSI;LayoutTemplatesFor22MSI;LayoutTemplatesFor21MSI" />
|
DependsOnTargets="LayoutTemplatesForSDK;LayoutTemplatesFor31MSI;LayoutTemplatesFor30MSI;LayoutTemplatesFor21MSI" />
|
||||||
|
|
||||||
<Target Name="LayoutTemplatesForSDK"
|
<Target Name="LayoutTemplatesForSDK"
|
||||||
DependsOnTargets="SetupBundledComponents;CalculateTemplatesVersions">
|
DependsOnTargets="SetupBundledComponents;CalculateTemplatesVersions">
|
||||||
|
@ -201,13 +159,6 @@
|
||||||
DestinationFolder="$(Templates30LayoutPath)templates/$(BundledTemplates30InstallPath)"/>
|
DestinationFolder="$(Templates30LayoutPath)templates/$(BundledTemplates30InstallPath)"/>
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<Target Name="LayoutTemplatesFor22MSI"
|
|
||||||
DependsOnTargets="SetupBundledComponents;CalculateTemplatesVersions"
|
|
||||||
Condition="$(ProductMonikerRid.StartsWith('win')) And !$(Architecture.StartsWith('arm'))">
|
|
||||||
<Copy SourceFiles="%(Bundled22Templates.RestoredNupkgPath)"
|
|
||||||
DestinationFolder="$(Templates22LayoutPath)templates/$(BundledTemplates22InstallPath)"/>
|
|
||||||
</Target>
|
|
||||||
|
|
||||||
<Target Name="LayoutTemplatesFor21MSI"
|
<Target Name="LayoutTemplatesFor21MSI"
|
||||||
DependsOnTargets="SetupBundledComponents;CalculateTemplatesVersions"
|
DependsOnTargets="SetupBundledComponents;CalculateTemplatesVersions"
|
||||||
Condition="$(ProductMonikerRid.StartsWith('win')) And !$(Architecture.StartsWith('arm'))">
|
Condition="$(ProductMonikerRid.StartsWith('win')) And !$(Architecture.StartsWith('arm'))">
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
<SdkInternalLayoutPath>$(BaseOutputPath)$(Configuration)\dotnet-internal\</SdkInternalLayoutPath>
|
<SdkInternalLayoutPath>$(BaseOutputPath)$(Configuration)\dotnet-internal\</SdkInternalLayoutPath>
|
||||||
<Templates31LayoutPath>$(BaseOutputPath)$(Configuration)\templates-3.1\</Templates31LayoutPath>
|
<Templates31LayoutPath>$(BaseOutputPath)$(Configuration)\templates-3.1\</Templates31LayoutPath>
|
||||||
<Templates30LayoutPath>$(BaseOutputPath)$(Configuration)\templates-3.0\</Templates30LayoutPath>
|
<Templates30LayoutPath>$(BaseOutputPath)$(Configuration)\templates-3.0\</Templates30LayoutPath>
|
||||||
<Templates22LayoutPath>$(BaseOutputPath)$(Configuration)\templates-2.2\</Templates22LayoutPath>
|
|
||||||
<Templates21LayoutPath>$(BaseOutputPath)$(Configuration)\templates-2.1\</Templates21LayoutPath>
|
<Templates21LayoutPath>$(BaseOutputPath)$(Configuration)\templates-2.1\</Templates21LayoutPath>
|
||||||
<DownloadsFolder>$(IntermediateOutputPath)downloads\</DownloadsFolder>
|
<DownloadsFolder>$(IntermediateOutputPath)downloads\</DownloadsFolder>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
|
@ -41,7 +41,6 @@
|
||||||
<SdkDependencyKeyName>Dotnet_CLI</SdkDependencyKeyName>
|
<SdkDependencyKeyName>Dotnet_CLI</SdkDependencyKeyName>
|
||||||
<Templates31MSIInstallerFile>$(ArtifactsShippingPackagesDir)dotnet-31templates-$(FullNugetVersion)-$(ProductMonikerRid)$(InstallerExtension)</Templates31MSIInstallerFile>
|
<Templates31MSIInstallerFile>$(ArtifactsShippingPackagesDir)dotnet-31templates-$(FullNugetVersion)-$(ProductMonikerRid)$(InstallerExtension)</Templates31MSIInstallerFile>
|
||||||
<Templates30MSIInstallerFile>$(ArtifactsShippingPackagesDir)dotnet-30templates-$(FullNugetVersion)-$(ProductMonikerRid)$(InstallerExtension)</Templates30MSIInstallerFile>
|
<Templates30MSIInstallerFile>$(ArtifactsShippingPackagesDir)dotnet-30templates-$(FullNugetVersion)-$(ProductMonikerRid)$(InstallerExtension)</Templates30MSIInstallerFile>
|
||||||
<Templates22MSIInstallerFile>$(ArtifactsShippingPackagesDir)dotnet-22templates-$(FullNugetVersion)-$(ProductMonikerRid)$(InstallerExtension)</Templates22MSIInstallerFile>
|
|
||||||
<Templates21MSIInstallerFile>$(ArtifactsShippingPackagesDir)dotnet-21templates-$(FullNugetVersion)-$(ProductMonikerRid)$(InstallerExtension)</Templates21MSIInstallerFile>
|
<Templates21MSIInstallerFile>$(ArtifactsShippingPackagesDir)dotnet-21templates-$(FullNugetVersion)-$(ProductMonikerRid)$(InstallerExtension)</Templates21MSIInstallerFile>
|
||||||
<SdkPlaceholderMSIInstallerFile>$(ArtifactsShippingPackagesDir)dotnet-sdkplaceholder-$(FullNugetVersion)-$(ProductMonikerRid)$(InstallerExtension)</SdkPlaceholderMSIInstallerFile>
|
<SdkPlaceholderMSIInstallerFile>$(ArtifactsShippingPackagesDir)dotnet-sdkplaceholder-$(FullNugetVersion)-$(ProductMonikerRid)$(InstallerExtension)</SdkPlaceholderMSIInstallerFile>
|
||||||
<SdkPlaceholderDependencyKeyName>NetCore_SdkPlaceholder</SdkPlaceholderDependencyKeyName>
|
<SdkPlaceholderDependencyKeyName>NetCore_SdkPlaceholder</SdkPlaceholderDependencyKeyName>
|
||||||
|
@ -83,7 +82,7 @@
|
||||||
DependsOnTargets="GenerateLayout;SetupWixProperties">
|
DependsOnTargets="GenerateLayout;SetupWixProperties">
|
||||||
<!-- Consumed By Publish -->
|
<!-- Consumed By Publish -->
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<GeneratedInstallers Include="$(SdkMSIInstallerFile);$(Templates31MSIInstallerFile);$(Templates30MSIInstallerFile);$(Templates22MSIInstallerFile);$(Templates21MSIInstallerFile);$(CombinedFrameworkSdkHostMSIInstallerFile);$(SdkPlaceholderMSIInstallerFile)" />
|
<GeneratedInstallers Include="$(SdkMSIInstallerFile);$(Templates31MSIInstallerFile);$(Templates30MSIInstallerFile);$(Templates21MSIInstallerFile);$(CombinedFrameworkSdkHostMSIInstallerFile);$(SdkPlaceholderMSIInstallerFile)" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<GenerateMsiVersion VersionRevision="$(CombinedBuildNumberAndRevision)"
|
<GenerateMsiVersion VersionRevision="$(CombinedBuildNumberAndRevision)"
|
||||||
|
@ -108,11 +107,6 @@
|
||||||
PropertyName="Templates30InstallerUpgradeCode" />
|
PropertyName="Templates30InstallerUpgradeCode" />
|
||||||
</GenerateGuidFromName>
|
</GenerateGuidFromName>
|
||||||
|
|
||||||
<GenerateGuidFromName Name="$(Templates22MSIInstallerFile)">
|
|
||||||
<Output TaskParameter="OutputGuid"
|
|
||||||
PropertyName="Templates22InstallerUpgradeCode" />
|
|
||||||
</GenerateGuidFromName>
|
|
||||||
|
|
||||||
<GenerateGuidFromName Name="$(Templates21MSIInstallerFile)">
|
<GenerateGuidFromName Name="$(Templates21MSIInstallerFile)">
|
||||||
<Output TaskParameter="OutputGuid"
|
<Output TaskParameter="OutputGuid"
|
||||||
PropertyName="Templates21InstallerUpgradeCode" />
|
PropertyName="Templates21InstallerUpgradeCode" />
|
||||||
|
@ -237,14 +231,6 @@
|
||||||
<UpgradeCode>$(Templates30InstallerUpgradeCode)</UpgradeCode>
|
<UpgradeCode>$(Templates30InstallerUpgradeCode)</UpgradeCode>
|
||||||
<DependencyKeyName>NetCore_Templates_3.0</DependencyKeyName>
|
<DependencyKeyName>NetCore_Templates_3.0</DependencyKeyName>
|
||||||
</TemplatesMsiComponent>
|
</TemplatesMsiComponent>
|
||||||
<TemplatesMsiComponent Include="NetCore22TemplatesMsi">
|
|
||||||
<LayoutPath>$(Templates22LayoutPath.TrimEnd('\'))</LayoutPath>
|
|
||||||
<MSIInstallerFile>$(Templates22MSIInstallerFile)</MSIInstallerFile>
|
|
||||||
<BrandName>$(BundledTemplates22BrandName)</BrandName>
|
|
||||||
<MsiVersion>$(BundledTemplates22MsiVersion)</MsiVersion>
|
|
||||||
<UpgradeCode>$(Templates22InstallerUpgradeCode)</UpgradeCode>
|
|
||||||
<DependencyKeyName>NetCore_Templates_2.2</DependencyKeyName>
|
|
||||||
</TemplatesMsiComponent>
|
|
||||||
<TemplatesMsiComponent Include="NetCore21TemplatesMsi">
|
<TemplatesMsiComponent Include="NetCore21TemplatesMsi">
|
||||||
<LayoutPath>$(Templates21LayoutPath.TrimEnd('\'))</LayoutPath>
|
<LayoutPath>$(Templates21LayoutPath.TrimEnd('\'))</LayoutPath>
|
||||||
<MSIInstallerFile>$(Templates21MSIInstallerFile)</MSIInstallerFile>
|
<MSIInstallerFile>$(Templates21MSIInstallerFile)</MSIInstallerFile>
|
||||||
|
@ -368,11 +354,6 @@
|
||||||
<NupkgFile>$(ArtifactsNonShippingPackagesDir)VS.Redist.Common.NetCore.Templates.$(BundledTemplates30MajorMinorVersion).$(FullNugetVersion).nupkg</NupkgFile>
|
<NupkgFile>$(ArtifactsNonShippingPackagesDir)VS.Redist.Common.NetCore.Templates.$(BundledTemplates30MajorMinorVersion).$(FullNugetVersion).nupkg</NupkgFile>
|
||||||
<MajorMinorVersion>$(BundledTemplates30MajorMinorVersion)</MajorMinorVersion>
|
<MajorMinorVersion>$(BundledTemplates30MajorMinorVersion)</MajorMinorVersion>
|
||||||
</TemplatesNupkgComponent>
|
</TemplatesNupkgComponent>
|
||||||
<TemplatesNupkgComponent Include="NetCore22TemplatesNupkg">
|
|
||||||
<MSIInstallerFile>$(Templates22MSIInstallerFile)</MSIInstallerFile>
|
|
||||||
<NupkgFile>$(ArtifactsNonShippingPackagesDir)VS.Redist.Common.NetCore.Templates.$(BundledTemplates22MajorMinorVersion).$(FullNugetVersion).nupkg</NupkgFile>
|
|
||||||
<MajorMinorVersion>$(BundledTemplates22MajorMinorVersion)</MajorMinorVersion>
|
|
||||||
</TemplatesNupkgComponent>
|
|
||||||
<TemplatesNupkgComponent Include="NetCore21TemplatesNupkg">
|
<TemplatesNupkgComponent Include="NetCore21TemplatesNupkg">
|
||||||
<MSIInstallerFile>$(Templates21MSIInstallerFile)</MSIInstallerFile>
|
<MSIInstallerFile>$(Templates21MSIInstallerFile)</MSIInstallerFile>
|
||||||
<NupkgFile>$(ArtifactsNonShippingPackagesDir)VS.Redist.Common.NetCore.Templates.$(BundledTemplates21MajorMinorVersion).$(FullNugetVersion).nupkg</NupkgFile>
|
<NupkgFile>$(ArtifactsNonShippingPackagesDir)VS.Redist.Common.NetCore.Templates.$(BundledTemplates21MajorMinorVersion).$(FullNugetVersion).nupkg</NupkgFile>
|
||||||
|
|
|
@ -177,7 +177,6 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<TemplatesMsiFilesToSign Include="$(Templates31MSIInstallerFile)" />
|
<TemplatesMsiFilesToSign Include="$(Templates31MSIInstallerFile)" />
|
||||||
<TemplatesMsiFilesToSign Include="$(Templates30MSIInstallerFile)" />
|
<TemplatesMsiFilesToSign Include="$(Templates30MSIInstallerFile)" />
|
||||||
<TemplatesMsiFilesToSign Include="$(Templates22MSIInstallerFile)" />
|
|
||||||
<TemplatesMsiFilesToSign Include="$(Templates21MSIInstallerFile)" />
|
<TemplatesMsiFilesToSign Include="$(Templates21MSIInstallerFile)" />
|
||||||
|
|
||||||
<TemplatesMsiFileSignInfo Include="@(TemplatesMsiFilesToSign->'%(Filename)%(Extension)')">
|
<TemplatesMsiFileSignInfo Include="@(TemplatesMsiFilesToSign->'%(Filename)%(Extension)')">
|
||||||
|
|
|
@ -31,7 +31,7 @@ function RunHeat
|
||||||
# use XSLT tranform to match the file path contains "AppHostTemplate\apphost.exe" and give it the same ID all the time.
|
# use XSLT tranform to match the file path contains "AppHostTemplate\apphost.exe" and give it the same ID all the time.
|
||||||
|
|
||||||
$heatOutput = .\heat.exe dir `"$inputDir`" -template fragment `
|
$heatOutput = .\heat.exe dir `"$inputDir`" -template fragment `
|
||||||
-sreg -gg `
|
-sreg -ag `
|
||||||
-var var.DotnetSrc `
|
-var var.DotnetSrc `
|
||||||
-cg InstallFiles `
|
-cg InstallFiles `
|
||||||
-srd `
|
-srd `
|
||||||
|
|
|
@ -25,7 +25,7 @@ function RunHeat
|
||||||
Write-Information "Running heat.."
|
Write-Information "Running heat.."
|
||||||
|
|
||||||
$heatOutput = .\heat.exe dir `"$inputDir`" -template fragment `
|
$heatOutput = .\heat.exe dir `"$inputDir`" -template fragment `
|
||||||
-sreg -gg `
|
-sreg -ag `
|
||||||
-var var.DotnetSrc `
|
-var var.DotnetSrc `
|
||||||
-cg InstallFiles `
|
-cg InstallFiles `
|
||||||
-srd `
|
-srd `
|
||||||
|
|
49
test/core-sdk-tasks.Tests/CalculateTemplateVerionsTests.cs
Normal file
49
test/core-sdk-tasks.Tests/CalculateTemplateVerionsTests.cs
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
using FluentAssertions;
|
||||||
|
using Xunit;
|
||||||
|
using Microsoft.DotNet.Cli.Build;
|
||||||
|
|
||||||
|
namespace EndToEnd
|
||||||
|
{
|
||||||
|
public class CalculateTemplateVersionsTests
|
||||||
|
{
|
||||||
|
[Fact]
|
||||||
|
public void WhenAspNetCoreTemplateMajorVersionLowerthan3ItCanCalculateTemplateVersionsInStableBuilds()
|
||||||
|
{
|
||||||
|
var result = CalculateTemplateVersions.Calculate("3.1.0", "dev");
|
||||||
|
|
||||||
|
result.Should()
|
||||||
|
.Be(("3.1.1", "3.1", "3.1.1"),
|
||||||
|
"the patch is 1 higher than aspnetTemplateVersion " +
|
||||||
|
"due to https://github.com/dotnet/core-sdk/issues/6243");
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void WhenAspNetCoreTemplateMajorVersionLowerthan3ItCanCalculateTemplateVersionsInNonStableBuilds()
|
||||||
|
{
|
||||||
|
var result = CalculateTemplateVersions.Calculate("3.0.0-alpha.1.20071.6", "dev");
|
||||||
|
|
||||||
|
result.Should()
|
||||||
|
.Be(("3.0.1-dev", "3.0", "3.0.1"));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void WhenAspNetCoreTemplateMajorVersionHigherthan3ItCanCalculateTemplateVersionsInStableBuilds()
|
||||||
|
{
|
||||||
|
var result = CalculateTemplateVersions.Calculate("5.1.0", "dev");
|
||||||
|
|
||||||
|
result.Should()
|
||||||
|
.Be(("5.1.0", "5.1", "5.1.0"),
|
||||||
|
"the patch align with AspNetCoreTemplateMajorVersion again, " +
|
||||||
|
"since there is no non-deterministic existing ComponentId under Major version 5.");
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void WhenAspNetCoreTemplateMajorVersionHigherthan3ItCanCalculateTemplateVersionsInNonStableBuilds()
|
||||||
|
{
|
||||||
|
var result = CalculateTemplateVersions.Calculate("5.0.0-alpha.1.20071.6", "dev");
|
||||||
|
|
||||||
|
result.Should()
|
||||||
|
.Be(("5.0.0-dev", "5.0", "5.0.0"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
14
test/core-sdk-tasks.Tests/core-sdk-tasks.Tests.csproj
Normal file
14
test/core-sdk-tasks.Tests/core-sdk-tasks.Tests.csproj
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFrameworks>$(CoreSdkTargetFramework);net472</TargetFrameworks>
|
||||||
|
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">$(CoreSdkTargetFramework)</TargetFrameworks>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="FluentAssertions" Version="4.18.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\..\src\core-sdk-tasks\core-sdk-tasks.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
Loading…
Add table
Reference in a new issue