Skip to content

Commit e6af9d5

Browse files
authored
Extract templates nupkg generation from GenerateMSIs.targets (#47657)
1 parent bdd17aa commit e6af9d5

File tree

7 files changed

+38
-119
lines changed

7 files changed

+38
-119
lines changed

sdk.sln

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-format", "src\BuiltI
482482
EndProject
483483
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-format.UnitTests", "test\dotnet-format.Tests\tests\dotnet-format.UnitTests.csproj", "{D7495CE7-64E5-4715-9304-799A41EC1D71}"
484484
EndProject
485-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "finalizer-build", "src\Layout\finalizer\finalizer.csproj", "{32DA04FF-A951-43EA-B2FA-86A825009A97}"
485+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "finalizer", "src\Layout\finalizer\finalizer.csproj", "{32DA04FF-A951-43EA-B2FA-86A825009A97}"
486486
EndProject
487487
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "redist-installer", "src\Layout\redist-installer\redist-installer.proj", "{FAADC193-BA41-449D-97CE-0EF82836046A}"
488488
EndProject
@@ -528,6 +528,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VS.Redist.Common.NetCore.To
528528
EndProject
529529
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VS.Redist.Common.Net.Core.SDK.RuntimeAnalyzers", "src\Layout\VS.Redist.Common.Net.Core.SDK.RuntimeAnalyzers\VS.Redist.Common.Net.Core.SDK.RuntimeAnalyzers.proj", "{C5C4F9CA-25B8-2B20-826D-EA93F667C316}"
530530
EndProject
531+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VS.Redist.Common.NetCore.Templates", "src\Layout\VS.Redist.Common.NetCore.Templates\VS.Redist.Common.NetCore.Templates.proj", "{6A7E16BE-FF2F-7927-AAF7-366CC0C42AE4}"
532+
EndProject
531533
Global
532534
GlobalSection(SolutionConfigurationPlatforms) = preSolution
533535
Debug|Any CPU = Debug|Any CPU
@@ -1014,6 +1016,10 @@ Global
10141016
{C5C4F9CA-25B8-2B20-826D-EA93F667C316}.Debug|Any CPU.Build.0 = Debug|Any CPU
10151017
{C5C4F9CA-25B8-2B20-826D-EA93F667C316}.Release|Any CPU.ActiveCfg = Release|Any CPU
10161018
{C5C4F9CA-25B8-2B20-826D-EA93F667C316}.Release|Any CPU.Build.0 = Release|Any CPU
1019+
{6A7E16BE-FF2F-7927-AAF7-366CC0C42AE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1020+
{6A7E16BE-FF2F-7927-AAF7-366CC0C42AE4}.Debug|Any CPU.Build.0 = Debug|Any CPU
1021+
{6A7E16BE-FF2F-7927-AAF7-366CC0C42AE4}.Release|Any CPU.ActiveCfg = Release|Any CPU
1022+
{6A7E16BE-FF2F-7927-AAF7-366CC0C42AE4}.Release|Any CPU.Build.0 = Release|Any CPU
10171023
EndGlobalSection
10181024
GlobalSection(SolutionProperties) = preSolution
10191025
HideSolutionNode = FALSE
@@ -1200,6 +1206,7 @@ Global
12001206
{20CA4572-8865-38BF-31C9-E58855D0CD40} = {71C279BD-E850-4A8D-9775-11CA26B8E5BA}
12011207
{93A4A3DA-9D0F-FAEA-5AD7-A34650D326D0} = {71C279BD-E850-4A8D-9775-11CA26B8E5BA}
12021208
{C5C4F9CA-25B8-2B20-826D-EA93F667C316} = {71C279BD-E850-4A8D-9775-11CA26B8E5BA}
1209+
{6A7E16BE-FF2F-7927-AAF7-366CC0C42AE4} = {71C279BD-E850-4A8D-9775-11CA26B8E5BA}
12031210
EndGlobalSection
12041211
GlobalSection(ExtensibilityGlobals) = postSolution
12051212
SolutionGuid = {FB8F26CE-4DE6-433F-B32A-79183020BBD6}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<Project Sdk="Microsoft.Build.NoTargets">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net472</TargetFramework>
5+
<IsPackable Condition="'$(OS)' == 'Windows_NT' and '$(SkipBuildingInstallers)' != 'true'">true</IsPackable>
6+
<BeforePack>$(BeforePack);GenerateLayout</BeforePack>
7+
<PackageId>VS.Redist.Common.NetCore.Templates.$(Architecture).$(MajorMinorVersion)</PackageId>
8+
<PackageDescription>.NET $(MajorMinorVersion) Templates ($(Architecture)) Windows Installer MSI as a .nupkg for internal Visual Studio build consumption</PackageDescription>
9+
<NoWarn>$(NoWarn);NU5100;NU5109;NU5123</NoWarn>
10+
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
11+
<IsShippingPackage>false</IsShippingPackage>
12+
</PropertyGroup>
13+
14+
<ItemGroup>
15+
<ProjectReference Include="..\redist-installer\redist-installer.proj" />
16+
</ItemGroup>
17+
18+
<Target Name="GenerateLayout" Condition="'$(IsPackable)' == 'true'" DependsOnTargets="ResolveProjectReferences">
19+
<ItemGroup>
20+
<Content Include="$(ArtifactsNonShippingPackagesDir)dotnet-$(VersionMajor)$(VersionMinor)templates-$(FullNugetVersion)-$(ProductMonikerRid)$(InstallerExtension)" PackagePath="/" />
21+
</ItemGroup>
22+
</Target>
23+
24+
</Project>

src/Layout/redist-installer/packaging/windows/Init.cmd

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/Layout/redist-installer/packaging/windows/VS.Redist.Common.NetCore.Templates.nuspec

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/Layout/redist-installer/packaging/windows/generatenupkg.ps1

Lines changed: 0 additions & 44 deletions
This file was deleted.

src/Layout/redist-installer/targets/BundledTemplates.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</ItemGroup>
99

1010
<ItemGroup>
11-
<CurrentVersionBundledTemplates Include="@(Bundled100Templates)" TemplateFrameworkVersion="10.0" />
11+
<CurrentVersionBundledTemplates Include="@(Bundled100Templates)" TemplateFrameworkVersion="$(MajorMinorVersion)" />
1212
<BundledTemplates Include="@(CurrentVersionBundledTemplates)" />
1313
<BundledTemplates Update="@(BundledTemplates)">
1414
<NupkgPathRelativeToPackageRoot>%(Identity)/%(PackageVersion)/%(Identity).%(PackageVersion).nupkg</NupkgPathRelativeToPackageRoot>

src/Layout/redist-installer/targets/GenerateMSIs.targets

Lines changed: 5 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
<Project>
22

33
<PropertyGroup>
4-
<GenerateMsisDependsOn>
5-
DownloadBundledComponents;
6-
MsiTargetsSetupInputOutputs;
7-
AcquireWix;
4+
<GenerateMsisDependsOn Condition="'$(GenerateSdkBundleOnly)' != 'true'">
85
GenerateSdkMsi;
9-
GenerateSdkBundle;
10-
GenerateSdkPlaceholderMsi;
11-
GenerateTemplatesNupkgs
6+
GenerateTemplatesMsis;
7+
GenerateSdkPlaceholderMsi
128
</GenerateMsisDependsOn>
13-
<GenerateMsisDependsOn Condition="'$(GenerateSdkBundleOnly)' == 'true'">GenerateSdkBundle</GenerateMsisDependsOn>
9+
<GenerateMsisDependsOn>$(GenerateMsisDependsOn);GenerateSdkBundle</GenerateMsisDependsOn>
1410

1511
<GenerateSdkBundleDependsOn>
1612
DownloadBundledComponents;
@@ -30,16 +26,13 @@
3026
<WixDownloadSentinel>$(WixRoot)/WixDownload.$(MicrosoftSignedWixVersion).sentinel</WixDownloadSentinel>
3127
</PropertyGroup>
3228

33-
<!-- Generate MSI/Bundle Properties -->
29+
<!-- Generate MSI/Bundle Properties -->
3430
<PropertyGroup>
35-
<CombinedFrameworkSdkHostBundleEngineName>$(ArtifactsTmpDir)/$(ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)-engine.exe</CombinedFrameworkSdkHostBundleEngineName>
36-
3731
<SdkPkgSourcesRootDirectory>$(MSBuildThisFileDirectory)../packaging/windows</SdkPkgSourcesRootDirectory>
3832
<SdkGenerateMsiPowershellScript>$(SdkPkgSourcesRootDirectory)/generatemsi.ps1</SdkGenerateMsiPowershellScript>
3933
<SdkPlaceholderGenerateMsiPowershellScript>$(SdkPkgSourcesRootDirectory)/generatesdkplaceholdermsi.ps1</SdkPlaceholderGenerateMsiPowershellScript>
4034
<SdkStableFileIdForApphostTransform>$(SdkPkgSourcesRootDirectory)/stablefileidforapphosttransform.xslt</SdkStableFileIdForApphostTransform>
4135
<SdkGenerateBundlePowershellScript>$(SdkPkgSourcesRootDirectory)/generatebundle.ps1</SdkGenerateBundlePowershellScript>
42-
<GenerateNupkgPowershellScript>$(SdkPkgSourcesRootDirectory)/generatenupkg.ps1</GenerateNupkgPowershellScript>
4336

4437
<FinalizerExe>$(ArtifactsBinDir)finalizer\win-$(Architecture)\$(Configuration)\bin\finalizer.exe</FinalizerExe>
4538

@@ -353,35 +346,6 @@
353346
</CreateLightCommandPackageDrop>
354347
</Target>
355348

356-
<Target Name="GenerateTemplatesNupkgs"
357-
DependsOnTargets="MsiTargetsSetupInputOutputs;GenerateTemplatesMsis;SetupTemplatesNupkgs"
358-
Inputs="@(TemplatesNupkgComponent->'%(MSIInstallerFile)');
359-
$(TemplatesInstallerNuspecFile);
360-
$(GenerateNupkgPowershellScript)"
361-
Outputs="@(TemplatesNupkgComponent->'%(NupkgFile)')">
362-
<Exec Command="powershell -NoProfile -NoLogo $(GenerateNupkgPowershellScript) ^
363-
'$(ArtifactsDir)' ^
364-
'%(TemplatesNupkgComponent.MSIInstallerFile)' ^
365-
'$(FullNugetVersion)' ^
366-
'$(TemplatesInstallerNuspecFile)' ^
367-
'@(TemplatesNupkgComponent->'%(NupkgFile)')' ^
368-
'$(Architecture)' ^
369-
'@(TemplatesNupkgComponent->'%(MajorMinorVersion)')'" />
370-
</Target>
371-
372-
<Target Name="SetupTemplatesNupkgs" DependsOnTargets="CalculateTemplatesVersions">
373-
<PropertyGroup>
374-
<TemplatesInstallerNuspecFile>$(SdkPkgSourcesRootDirectory)/VS.Redist.Common.NetCore.Templates.nuspec</TemplatesInstallerNuspecFile>
375-
</PropertyGroup>
376-
377-
<ItemGroup>
378-
<TemplatesNupkgComponent Include="@(TemplatesComponents->'%(Identity)Nupkg')">
379-
<NupkgFile>$(ArtifactsNonShippingPackagesDir)VS.Redist.Common.NetCore.Templates.%(TemplatesMajorMinorVersion).$(FullNugetVersion).nupkg</NupkgFile>
380-
<MajorMinorVersion>%(TemplatesMajorMinorVersion)</MajorMinorVersion>
381-
</TemplatesNupkgComponent>
382-
</ItemGroup>
383-
</Target>
384-
385349
<Target Name="GenerateMsis"
386350
AfterTargets="Build"
387351
DependsOnTargets="$(GenerateMsisDependsOn)" />

0 commit comments

Comments
 (0)