Adding 2.1 and 2.2 Templates MSIs, part 1

This commit is contained in:
jbeisner 2019-07-17 23:18:41 +00:00
parent ce0a6f425c
commit 49ad1e8dd5
4 changed files with 117 additions and 34 deletions

View file

@ -36,11 +36,7 @@
<MicrosoftDotNetMSBuildSdkResolverPackageVersion>3.0.100-preview8.19367.2</MicrosoftDotNetMSBuildSdkResolverPackageVersion>
</PropertyGroup>
<PropertyGroup>
<MicrosoftDotNetCommonItemTemplatesPackageVersion>2.0.0-preview8.19365.2</MicrosoftDotNetCommonItemTemplatesPackageVersion>
<MicrosoftDotNetCommonProjectTemplates30PackageVersion>$(MicrosoftDotNetCommonItemTemplatesPackageVersion)</MicrosoftDotNetCommonProjectTemplates30PackageVersion>
<MicrosoftDotNetTestProjectTemplates30PackageVersion>1.0.2-beta4.19155.2</MicrosoftDotNetTestProjectTemplates30PackageVersion>
<MicroBuildCorePackageVersion>0.2.0</MicroBuildCorePackageVersion>
<NUnit3TemplatesVersion>1.6.1</NUnit3TemplatesVersion>
</PropertyGroup>
<PropertyGroup>
<!-- Dependencies from https://github.com/dotnet/sdk (to run tests) -->
@ -63,6 +59,26 @@
<MicrosoftWindowsDesktopAppPackageVersion>3.0.0-preview8-27917-01</MicrosoftWindowsDesktopAppPackageVersion>
<MicrosoftWindowsDesktopPackageVersion>$(MicrosoftWindowsDesktopAppPackageVersion)</MicrosoftWindowsDesktopPackageVersion>
</PropertyGroup>
<PropertyGroup>
<!-- 3.0 Template versions -->
<NUnit3Templates30PackageVersion>1.6.1</NUnit3Templates30PackageVersion>
<MicrosoftDotNetCommonItemTemplatesPackageVersion>2.0.0-preview8.19365.2</MicrosoftDotNetCommonItemTemplatesPackageVersion>
<MicrosoftDotNetCommonProjectTemplates30PackageVersion>$(MicrosoftDotNetCommonItemTemplatesPackageVersion)</MicrosoftDotNetCommonProjectTemplates30PackageVersion>
<MicrosoftDotNetTestProjectTemplates30PackageVersion>1.0.2-beta4.19155.2</MicrosoftDotNetTestProjectTemplates30PackageVersion>
<AspNetCorePackageVersionFor30Templates>$(AspNetCoreVersion)</AspNetCorePackageVersionFor30Templates>
<!-- 2.2 Template versions -->
<NUnit3Templates22PackageVersion>1.6.0</NUnit3Templates22PackageVersion>
<MicrosoftDotNetCommonItemTemplates22PackageVersion>1.0.2-beta4</MicrosoftDotNetCommonItemTemplates22PackageVersion>
<MicrosoftDotNetCommonProjectTemplates22PackageVersion>$(MicrosoftDotNetCommonItemTemplates22PackageVersion)</MicrosoftDotNetCommonProjectTemplates22PackageVersion>
<MicrosoftDotNetTestProjectTemplates22PackageVersion>1.0.2-beta4.19155.2</MicrosoftDotNetTestProjectTemplates22PackageVersion>
<AspNetCorePackageVersionFor22Templates>2.2.6</AspNetCorePackageVersionFor22Templates>
<!-- 2.1 Template versions -->
<NUnit3Templates21PackageVersion>1.5.3</NUnit3Templates21PackageVersion>
<MicrosoftDotNetCommonItemTemplates21PackageVersion>1.0.2-beta3</MicrosoftDotNetCommonItemTemplates21PackageVersion>
<MicrosoftDotNetCommonProjectTemplates21PackageVersion>$(MicrosoftDotNetCommonItemTemplates21PackageVersion)</MicrosoftDotNetCommonProjectTemplates21PackageVersion>
<MicrosoftDotNetTestProjectTemplates21PackageVersion>1.0.2-beta4-20181009-2100240</MicrosoftDotNetTestProjectTemplates21PackageVersion>
<AspNetCorePackageVersionFor21Templates>2.1.12</AspNetCorePackageVersionFor21Templates>
</PropertyGroup>
<!-- infrastructure and test only dependencies -->
<PropertyGroup>
<BuildTasksFeedToolVersion>2.2.0-beta.19072.10</BuildTasksFeedToolVersion>

View file

@ -2,40 +2,89 @@
<Target Name="CalculateTemplatesVersion"
DependsOnTargets="SetSdkVersionInfo">
<PropertyGroup>
<MicrosoftNETCoreAppVersionPreReleaseSeparator>$(MicrosoftNETCoreAppPackageVersion.IndexOf('-'))</MicrosoftNETCoreAppVersionPreReleaseSeparator>
<MicrosoftNETCoreAppMajorMinorPatchVersion>$(MicrosoftNETCoreAppPackageVersion)</MicrosoftNETCoreAppMajorMinorPatchVersion>
<MicrosoftNETCoreAppMajorMinorPatchVersion Condition=" '$(MicrosoftNETCoreAppVersionPreReleaseSeparator)' != -1 ">$(MicrosoftNETCoreAppPackageVersion.Substring(0, $(MicrosoftNETCoreAppVersionPreReleaseSeparator)))</MicrosoftNETCoreAppMajorMinorPatchVersion>
<BundledTemplatesVersion>$(MicrosoftNETCoreAppMajorMinorPatchVersion)</BundledTemplatesVersion>
<BundledTemplatesVersion Condition=" '$(DropSuffix)' != 'true' And '$(VersionSuffix)' != '' ">$(BundledTemplatesVersion)-$(VersionSuffix)</BundledTemplatesVersion>
<AspNetCore30VersionPreReleaseSeparator>$(AspNetCorePackageVersionFor30Templates.IndexOf('-'))</AspNetCore30VersionPreReleaseSeparator>
<AspNetCore30VersionMajorMinorPatchVersion>$(AspNetCorePackageVersionFor30Templates)</AspNetCore30VersionMajorMinorPatchVersion>
<AspNetCore30VersionMajorMinorPatchVersion Condition=" '$(AspNetCore30VersionPreReleaseSeparator)' != -1 ">$(AspNetCorePackageVersionFor30Templates.Substring(0, $(AspNetCore30VersionPreReleaseSeparator)))</AspNetCore30VersionMajorMinorPatchVersion>
<BundledTemplates30Version>$(AspNetCore30VersionMajorMinorPatchVersion)</BundledTemplates30Version>
<BundledTemplates30MSIVersion>$(AspNetCore30VersionMajorMinorPatchVersion).$(GitCommitCount)</BundledTemplates30MSIVersion>
<BundledTemplates30Version Condition=" '$(DropSuffix)' != 'true' And '$(VersionSuffix)' != '' ">$(BundledTemplates30Version)-$(VersionSuffix)</BundledTemplates30Version>
<AspNetCore22VersionPreReleaseSeparator>$(AspNetCorePackageVersionFor22Templates.IndexOf('-'))</AspNetCore22VersionPreReleaseSeparator>
<AspNetCore22VersionMajorMinorPatchVersion>$(AspNetCorePackageVersionFor22Templates)</AspNetCore22VersionMajorMinorPatchVersion>
<AspNetCore22VersionMajorMinorPatchVersion Condition=" '$(AspNetCore22VersionPreReleaseSeparator)' != -1 ">$(AspNetCorePackageVersionFor22Templates.Substring(0, $(AspNetCore22VersionPreReleaseSeparator)))</AspNetCore22VersionMajorMinorPatchVersion>
<BundledTemplates22Version>$(AspNetCore22VersionMajorMinorPatchVersion)</BundledTemplates22Version>
<BundledTemplates22MSIVersion>$(AspNetCore22VersionMajorMinorPatchVersion).$(GitCommitCount)</BundledTemplates22MSIVersion>
<BundledTemplates22Version Condition=" '$(DropSuffix)' != 'true' And '$(VersionSuffix)' != '' ">$(BundledTemplates22Version)-$(VersionSuffix)</BundledTemplates22Version>
<AspNetCore21VersionPreReleaseSeparator>$(AspNetCorePackageVersionFor21Templates.IndexOf('-'))</AspNetCore21VersionPreReleaseSeparator>
<AspNetCore21VersionMajorMinorPatchVersion>$(AspNetCorePackageVersionFor21Templates)</AspNetCore21VersionMajorMinorPatchVersion>
<AspNetCore21VersionMajorMinorPatchVersion Condition=" '$(AspNetCore21VersionPreReleaseSeparator)' != -1 ">$(AspNetCorePackageVersionFor21Templates.Substring(0, $(AspNetCore21VersionPreReleaseSeparator)))</AspNetCore21VersionMajorMinorPatchVersion>
<BundledTemplates21Version>$(AspNetCore21VersionMajorMinorPatchVersion)</BundledTemplates21Version>
<BundledTemplates21MSIVersion>$(AspNetCore21VersionMajorMinorPatchVersion).$(GitCommitCount)</BundledTemplates21MSIVersion>
<BundledTemplates21Version Condition=" '$(DropSuffix)' != 'true' And '$(VersionSuffix)' != '' ">$(BundledTemplates21Version)-$(VersionSuffix)</BundledTemplates21Version>
</PropertyGroup>
</Target>
<ItemGroup>
<BundledTemplate Include="Microsoft.DotNet.Common.ItemTemplates" Version="$(MicrosoftDotNetCommonItemTemplatesPackageVersion)" />
<BundledTemplate Include="Microsoft.DotNet.Common.ProjectTemplates.3.0" Version="$(MicrosoftDotNetCommonProjectTemplates30PackageVersion)" />
<BundledTemplate Include="Microsoft.DotNet.Test.ProjectTemplates.3.0" Version="$(MicrosoftDotNetTestProjectTemplates30PackageVersion)" />
<BundledTemplate Include="Microsoft.Dotnet.Wpf.ProjectTemplates" Version="$(MicrosoftDotnetWpfProjectTemplatesPackageVersion)" />
<BundledTemplate Include="Microsoft.Dotnet.WinForms.ProjectTemplates" Version="$(MicrosoftDotnetWinFormsProjectTemplatesPackageVersion)" />
<BundledTemplate Include="Microsoft.DotNet.Web.ItemTemplates" Version="$(AspNetCoreVersion)" />
<BundledTemplate Include="Microsoft.DotNet.Web.ProjectTemplates.3.0" Version="$(AspNetCoreVersion)" />
<BundledTemplate Include="Microsoft.DotNet.Web.Spa.ProjectTemplates.3.0" Version="$(AspNetCoreVersion)" />
<BundledTemplate Include="NUnit3.DotNetNew.Template" Version="$(NUnit3TemplatesVersion)" />
<Bundled30Templates Include="Microsoft.DotNet.Common.ItemTemplates" Version="$(MicrosoftDotNetCommonItemTemplatesPackageVersion)" />
<Bundled30Templates Include="Microsoft.DotNet.Common.ProjectTemplates.3.0" Version="$(MicrosoftDotNetCommonProjectTemplates30PackageVersion)" />
<Bundled30Templates Include="Microsoft.DotNet.Test.ProjectTemplates.3.0" Version="$(MicrosoftDotNetTestProjectTemplates30PackageVersion)" />
<Bundled30Templates Include="Microsoft.Dotnet.Wpf.ProjectTemplates" Version="$(MicrosoftDotnetWpfProjectTemplatesPackageVersion)" />
<Bundled30Templates Include="Microsoft.Dotnet.WinForms.ProjectTemplates" Version="$(MicrosoftDotnetWinFormsProjectTemplatesPackageVersion)" />
<Bundled30Templates Include="Microsoft.DotNet.Web.ItemTemplates" Version="$(AspNetCoreVersion)" />
<Bundled30Templates Include="Microsoft.DotNet.Web.ProjectTemplates.3.0" Version="$(AspNetCoreVersion)" />
<Bundled30Templates Include="Microsoft.DotNet.Web.Spa.ProjectTemplates.3.0" Version="$(AspNetCoreVersion)" />
<Bundled30Templates Include="NUnit3.DotNetNew.Template" Version="$(NUnit3TemplatesVersion)" />
</ItemGroup>
<ItemGroup>
<Bundled22Templates Include="Microsoft.DotNet.Common.ItemTemplates" Version="$(MicrosoftDotNetCommonItemTemplatesPackageVersion)" />
<Bundled22Templates Include="Microsoft.DotNet.Common.ProjectTemplates.2.2" Version="$(MicrosoftDotNetCommonProjectTemplates22PackageVersion)" />
<Bundled22Templates Include="Microsoft.DotNet.Test.ProjectTemplates.2.2" Version="$(MicrosoftDotNetTestProjectTemplates22PackageVersion)" />
<Bundled22Templates Include="Microsoft.DotNet.Web.ItemTemplates" Version="$(AspNetCoreVersion)" />
<Bundled22Templates Include="Microsoft.DotNet.Web.ProjectTemplates.2.2" Version="$(AspNetCoreVersion)" />
<Bundled22Templates Include="Microsoft.DotNet.Web.Spa.ProjectTemplates" Version="$(AspNetCoreVersion)" />
<Bundled22Templates Include="NUnit3.DotNetNew.Template" Version="$(NUnit3TemplatesVersion)" />
</ItemGroup>
<ItemGroup>
<Bundled21Templates Include="Microsoft.DotNet.Common.ItemTemplates" Version="$(MicrosoftDotNetCommonItemTemplatesPackageVersion)" />
<Bundled21Templates Include="Microsoft.DotNet.Common.ProjectTemplates.2.1" Version="$(MicrosoftDotNetCommonProjectTemplates20PackageVersion)" />
<Bundled21Templates Include="Microsoft.DotNet.Test.ProjectTemplates.2.1" Version="$(MicrosoftDotNetTestProjectTemplates20PackageVersion)" />
<Bundled21Templates Include="Microsoft.DotNet.Web.ItemTemplates" Version="$(AspNetCoreVersion)" />
<Bundled21Templates Include="Microsoft.DotNet.Web.ProjectTemplates.2.1" Version="$(AspNetCoreVersion)" />
<Bundled21Templates Include="Microsoft.DotNet.Web.Spa.ProjectTemplates" Version="$(AspNetCoreVersion)" />
<Bundled21Templates Include="NUnit3.DotNetNew.Template" Version="$(NUnit3TemplatesVersion)" />
</ItemGroup>
<!-- Restore bundled templates via PackageReference -->
<ItemGroup>
<PackageReference Include="@(BundledTemplate)" />
<PackageReference Include="@(Bundled30Templates)" />
<PackageReference Include="@(Bundled22Templates)" />
<PackageReference Include="@(Bundled21Templates)" />
</ItemGroup>
<ItemGroup>
<BundledTemplate Update="@(BundledTemplate)">
<Bundled30Templates Update="@(Bundled30Templates)">
<NupkgPathRelativeToPackageRoot>%(Identity)/%(Version)/%(Identity).%(Version).nupkg</NupkgPathRelativeToPackageRoot>
<RestoredNupkgPath>$(NuGetPackageRoot)$([MSBuild]::ValueOrDefault('%(NupkgPathRelativeToPackageRoot)', '').ToLower())</RestoredNupkgPath>
</BundledTemplate>
</Bundled30Templates>
</ItemGroup>
<ItemGroup>
<Bundled22Templates Update="@(Bundled22Templates)">
<NupkgPathRelativeToPackageRoot>%(Identity)/%(Version)/%(Identity).%(Version).nupkg</NupkgPathRelativeToPackageRoot>
<RestoredNupkgPath>$(NuGetPackageRoot)$([MSBuild]::ValueOrDefault('%(NupkgPathRelativeToPackageRoot)', '').ToLower())</RestoredNupkgPath>
</Bundled22Templates>
</ItemGroup>
<ItemGroup>
<Bundled21Templates Update="@(Bundled21Templates)">
<NupkgPathRelativeToPackageRoot>%(Identity)/%(Version)/%(Identity).%(Version).nupkg</NupkgPathRelativeToPackageRoot>
<RestoredNupkgPath>$(NuGetPackageRoot)$([MSBuild]::ValueOrDefault('%(NupkgPathRelativeToPackageRoot)', '').ToLower())</RestoredNupkgPath>
</Bundled21Templates>
</ItemGroup>
<Target Name="LayoutTemplates"
DependsOnTargets="SetupBundledComponents;CalculateTemplatesVersion">
<ItemGroup Condition="!$(ProductMonikerRid.StartsWith('win'))">
@ -43,13 +92,27 @@
<BundledTemplate Remove="Microsoft.Dotnet.WinForms.ProjectTemplates" />
</ItemGroup>
<Copy SourceFiles="%(BundledTemplate.RestoredNupkgPath)"
DestinationFolder="$(RedistLayoutPath)templates/$(BundledTemplatesVersion)"/>
DestinationFolder="$(RedistLayoutPath)templates/$(BundledTemplates30Version)"/>
</Target>
<Target Name="LayoutTemplatesForMSI"
<Target Name="LayoutTemplatesFor30MSI"
DependsOnTargets="SetupBundledComponents;CalculateTemplatesVersion"
Condition="$(ProductMonikerRid.StartsWith('win'))">
<Copy SourceFiles="%(BundledTemplate.RestoredNupkgPath)"
DestinationFolder="$(TemplatesLayoutPath)templates/$(BundledTemplatesVersion)"/>
<Copy SourceFiles="%(Bundled30Templates.RestoredNupkgPath)"
DestinationFolder="$(Templates30LayoutPath)templates/$(BundledTemplates30Version)"/>
</Target>
<Target Name="LayoutTemplatesFor22MSI"
DependsOnTargets="SetupBundledComponents;CalculateTemplatesVersion"
Condition="$(ProductMonikerRid.StartsWith('win'))">
<Copy SourceFiles="%(Bundled22Templates.RestoredNupkgPath)"
DestinationFolder="$(Templates22LayoutPath)templates/$(BundledTemplates22Version)"/>
</Target>
<Target Name="LayoutTemplatesFor21MSI"
DependsOnTargets="SetupBundledComponents;CalculateTemplatesVersion"
Condition="$(ProductMonikerRid.StartsWith('win'))">
<Copy SourceFiles="%(Bundled21Templates.RestoredNupkgPath)"
DestinationFolder="$(Templates21LayoutPath)templates/$(BundledTemplates21Version)"/>
</Target>
</Project>

View file

@ -2,7 +2,9 @@
<PropertyGroup>
<RedistLayoutPath>$(BaseOutputPath)$(Configuration)\dotnet\</RedistLayoutPath>
<SdkInternalLayoutPath>$(BaseOutputPath)$(Configuration)\dotnet-internal\</SdkInternalLayoutPath>
<TemplatesLayoutPath>$(BaseOutputPath)$(Configuration)\dotnet-templates\</TemplatesLayoutPath>
<Templates30LayoutPath>$(BaseOutputPath)$(Configuration)\templates-3.0\</Templates30LayoutPath>
<Templates22LayoutPath>$(BaseOutputPath)$(Configuration)\templates-2.2\</Templates22LayoutPath>
<Templates21LayoutPath>$(BaseOutputPath)$(Configuration)\templates-2.1\</Templates21LayoutPath>
<DownloadsFolder>$(IntermediateOutputPath)downloads\</DownloadsFolder>
</PropertyGroup>
@ -416,7 +418,9 @@
GenerateBundledVersions;
LayoutRuntimeGraph;
LayoutTemplates;
LayoutTemplatesForMSI;
LayoutTemplatesFor30MSI;
LayoutTemplatesFor22MSI;
LayoutTemplatesFor21MSI;
LayoutBundledTools;
RetargetTools;
CrossgenLayout;

View file

@ -130,18 +130,18 @@
<Target Name="GenerateTemplatesMsi"
DependsOnTargets="GenerateLayout;AcquireWix;MsiTargetsSetupInputOutputs;SetSdkBrandingInfo"
Condition=" '$(OS)' == 'Windows_NT' "
Inputs="$(TemplatesLayoutPath)**/*;
Inputs="$(Templates30LayoutPath)**/*;
$(TemplatesGenerateMsiPowershellScript)"
Outputs="$(TemplatesMSIInstallerFile)">
<Exec Command="powershell -NoProfile -NoLogo $(TemplatesGenerateMsiPowershellScript) ^
'$(TemplatesLayoutPath.TrimEnd('\'))' ^
'$(Templates30LayoutPath.TrimEnd('\'))' ^
'$(TemplatesMSIInstallerFile)' ^
'$(WixRoot)' ^
'$(SdkBrandName)' ^
'$(MsiVersion)' ^
'$(SDKBundleVersion)' ^
'$(NugetVersion)' ^
'$(BundledTemplates30MSIVersion)' ^
'$(BundledTemplates30MSIVersion)' ^
'$(BundledTemplates30Version)' ^
'$(TemplatesInstallerUpgradeCode)' ^
'$(Architecture)' ^
-InformationAction Continue" />