Skip to content

Commit 1402b07

Browse files
authored
Extract nuget packages from redist-installer infra (#47502)
1 parent 95521a8 commit 1402b07

11 files changed

+83
-93
lines changed

Directory.Build.props

+7
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@
3838
<IsDebianBaseDistro Condition="$(HostRid.StartsWith('ubuntu')) OR $(HostRid.StartsWith('debian'))">true</IsDebianBaseDistro>
3939
<IsRPMBasedDistro Condition="$(HostRid.StartsWith('rhel'))">true</IsRPMBasedDistro>
4040
<IsRPMBasedDistro Condition="$(HostRid.StartsWith('centos'))">true</IsRPMBasedDistro>
41+
42+
<OSName Condition="'$(OSName)' == '' AND $(Rid) != ''">$(Rid.Substring(0, $(Rid.LastIndexOf('-'))))</OSName>
43+
<OSName Condition="'$(OSName)' == ''">$(HostOSName)</OSName>
44+
<Rid>$(OSName)-$(Architecture)</Rid>
45+
<ProductMonikerRid Condition="'$(ProductMonikerRid)' == ''">$(Rid)</ProductMonikerRid>
46+
47+
<PgoTerm Condition="'$(PgoInstrument)' == 'true'">-pgo</PgoTerm>
4148
</PropertyGroup>
4249

4350
<PropertyGroup>

sdk.sln

+14
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Net.Sdk.AnalyzerR
525525
EndProject
526526
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Net.Sdk.AnalyzerRedirecting.Tests", "test\Microsoft.Net.Sdk.AnalyzerRedirecting.Tests\Microsoft.Net.Sdk.AnalyzerRedirecting.Tests.csproj", "{234BE46E-4AD6-485C-B0D3-E704EF504312}"
527527
EndProject
528+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VS.Redist.Common.NetCore.SdkPlaceholder", "src\Layout\VS.Redist.Common.NetCore.SdkPlaceholder\VS.Redist.Common.NetCore.SdkPlaceholder.proj", "{20CA4572-8865-38BF-31C9-E58855D0CD40}"
529+
EndProject
530+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VS.Redist.Common.NetCore.Toolset", "src\Layout\VS.Redist.Common.NetCore.Toolset\VS.Redist.Common.NetCore.Toolset.proj", "{93A4A3DA-9D0F-FAEA-5AD7-A34650D326D0}"
531+
EndProject
528532
Global
529533
GlobalSection(SolutionConfigurationPlatforms) = preSolution
530534
Debug|Any CPU = Debug|Any CPU
@@ -999,6 +1003,14 @@ Global
9991003
{234BE46E-4AD6-485C-B0D3-E704EF504312}.Debug|Any CPU.Build.0 = Debug|Any CPU
10001004
{234BE46E-4AD6-485C-B0D3-E704EF504312}.Release|Any CPU.ActiveCfg = Release|Any CPU
10011005
{234BE46E-4AD6-485C-B0D3-E704EF504312}.Release|Any CPU.Build.0 = Release|Any CPU
1006+
{20CA4572-8865-38BF-31C9-E58855D0CD40}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1007+
{20CA4572-8865-38BF-31C9-E58855D0CD40}.Debug|Any CPU.Build.0 = Debug|Any CPU
1008+
{20CA4572-8865-38BF-31C9-E58855D0CD40}.Release|Any CPU.ActiveCfg = Release|Any CPU
1009+
{20CA4572-8865-38BF-31C9-E58855D0CD40}.Release|Any CPU.Build.0 = Release|Any CPU
1010+
{93A4A3DA-9D0F-FAEA-5AD7-A34650D326D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1011+
{93A4A3DA-9D0F-FAEA-5AD7-A34650D326D0}.Debug|Any CPU.Build.0 = Debug|Any CPU
1012+
{93A4A3DA-9D0F-FAEA-5AD7-A34650D326D0}.Release|Any CPU.ActiveCfg = Release|Any CPU
1013+
{93A4A3DA-9D0F-FAEA-5AD7-A34650D326D0}.Release|Any CPU.Build.0 = Release|Any CPU
10021014
EndGlobalSection
10031015
GlobalSection(SolutionProperties) = preSolution
10041016
HideSolutionNode = FALSE
@@ -1183,6 +1195,8 @@ Global
11831195
{0762B436-F4B0-4008-9097-BB5FF6BD84AF} = {71A9F549-0EB6-41F9-BC16-4A6C5007FC91}
11841196
{27BBE29B-CE6F-401F-B3CF-B07DC556FAD1} = {22AB674F-ED91-4FBC-BFEE-8A1E82F9F05E}
11851197
{234BE46E-4AD6-485C-B0D3-E704EF504312} = {580D1AE7-AA8F-4912-8B76-105594E00B3B}
1198+
{20CA4572-8865-38BF-31C9-E58855D0CD40} = {71C279BD-E850-4A8D-9775-11CA26B8E5BA}
1199+
{93A4A3DA-9D0F-FAEA-5AD7-A34650D326D0} = {71C279BD-E850-4A8D-9775-11CA26B8E5BA}
11861200
EndGlobalSection
11871201
GlobalSection(ExtensibilityGlobals) = postSolution
11881202
SolutionGuid = {FB8F26CE-4DE6-433F-B32A-79183020BBD6}

src/Installer/redist-installer/Directory.Build.props

-5
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,8 @@
33
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
44

55
<PropertyGroup>
6-
<OSName Condition="'$(OSName)' == '' AND $(Rid) != ''">$(Rid.Substring(0, $(Rid.LastIndexOf('-'))))</OSName>
7-
<OSName Condition="'$(OSName)' == ''">$(HostOSName)</OSName>
86
<PortableOSName Condition=" '$(PortableOSName)' == '' ">$(OSName)</PortableOSName>
9-
10-
<Rid>$(OSName)-$(Architecture)</Rid>
117
<PortableRid>$(PortableOSName)-$(Architecture)</PortableRid>
12-
<ProductMonikerRid Condition="'$(ProductMonikerRid)' == ''">$(Rid)</ProductMonikerRid>
138

149
<PortableProductMonikerRid Condition="'$(PortableProductMonikerRid)' == ''">$(PortableRid)</PortableProductMonikerRid>
1510
</PropertyGroup>

src/Installer/redist-installer/Directory.Build.targets

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525
<PropertyGroup>
2626
<!-- Any properties that depend on Version and are not in a Target must not be defined in Directory.Build.props as Version won't be available yet. -->
27-
<PgoTerm Condition="'$(PgoInstrument)' == 'true'">-pgo</PgoTerm>
2827
<ArtifactNameWithVersionSdk>dotnet-sdk-internal$(PgoTerm)-$(Version)-$(ProductMonikerRid)</ArtifactNameWithVersionSdk>
2928
<ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk>dotnet-sdk$(PgoTerm)-$(Version)-$(ProductMonikerRid)</ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk>
3029
</PropertyGroup>

src/Installer/redist-installer/packaging/windows/VS.Redist.Common.NetCore.SdkPlaceholder.nuspec

-17
This file was deleted.

src/Installer/redist-installer/packaging/windows/VS.Redist.Common.NetCore.Toolset.nuspec

-17
This file was deleted.

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

+1-40
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
GenerateSdkMsi;
99
GenerateSdkBundle;
1010
GenerateSdkPlaceholderMsi;
11-
GenerateToolsetNupkg;
1211
GenerateTemplatesNupkgs;
13-
GenerateSdkPlaceholderNupkg;
1412
GenerateRuntimeAnalyzersNupkg
1513
</GenerateMsisDependsOn>
1614
<GenerateMsisDependsOn Condition="'$(GenerateSdkBundleOnly)' == 'true'">GenerateSdkBundle</GenerateMsisDependsOn>
@@ -46,11 +44,6 @@
4644

4745
<FinalizerExe>$(ArtifactsBinDir)finalizer/$(Architecture)/$(Configuration)/bin/finalizer.exe</FinalizerExe>
4846

49-
<ToolsetInstallerNuspecFile>$(SdkPkgSourcesRootDirectory)/VS.Redist.Common.NetCore.Toolset.nuspec</ToolsetInstallerNuspecFile>
50-
<ToolsetInstallerNupkgFile>$(ArtifactsNonShippingPackagesDir)VS.Redist.Common.NetCore.Toolset.$(Architecture).$(FullNugetVersion).nupkg</ToolsetInstallerNupkgFile>
51-
<SdkPlaceholderInstallerNuspecFile>$(SdkPkgSourcesRootDirectory)/VS.Redist.Common.NetCore.SdkPlaceholder.nuspec</SdkPlaceholderInstallerNuspecFile>
52-
<SdkPlaceholderInstallerNupkgFile>$(ArtifactsNonShippingPackagesDir)VS.Redist.Common.NetCore.SdkPlaceholder.$(Architecture).$(FullNugetVersion).nupkg</SdkPlaceholderInstallerNupkgFile>
53-
5447
<RuntimeAnalyzersLayoutDirectory>$(ArtifactsBinDir)$(Configuration)\RuntimeAnalyzers</RuntimeAnalyzersLayoutDirectory>
5548
<SdkRuntimeAnalyzersNuspecFile>$(SdkPkgSourcesRootDirectory)/VS.Redist.Common.Net.Core.SDK.RuntimeAnalyzers.nuspec</SdkRuntimeAnalyzersNuspecFile>
5649
<SdkRuntimeAnalyzersNupkgFile>$(ArtifactsNonShippingPackagesDir)VS.Redist.Common.Net.Core.SDK.RuntimeAnalyzers.$(FullNugetVersion).nupkg</SdkRuntimeAnalyzersNupkgFile>
@@ -371,38 +364,6 @@
371364
</CreateLightCommandPackageDrop>
372365
</Target>
373366

374-
<Target Name="GenerateToolsetNupkg"
375-
DependsOnTargets="MsiTargetsSetupInputOutputs;GenerateSdkMsi"
376-
Inputs="$(SdkMSIInstallerFile);
377-
$(ToolsetInstallerNuspecFile);
378-
$(GenerateNupkgPowershellScript)"
379-
Outputs="$(ToolsetInstallerNupkgFile)">
380-
<Exec Command="powershell -NoProfile -NoLogo $(GenerateNupkgPowershellScript) ^
381-
'$(ArtifactsDir)' ^
382-
'$(SdkMSIInstallerFile)' ^
383-
'$(FullNugetVersion)' ^
384-
'$(ToolsetInstallerNuspecFile)' ^
385-
'$(ToolsetInstallerNupkgFile)' ^
386-
'$(Architecture)' ^
387-
'$(MajorMinorVersion)'" />
388-
</Target>
389-
390-
<Target Name="GenerateSdkPlaceholderNupkg"
391-
DependsOnTargets="MsiTargetsSetupInputOutputs;GenerateSdkPlaceholderMsi"
392-
Inputs="$(SdkPlaceholderMSIInstallerFile);
393-
$(SdkPlaceholderInstallerNuspecFile);
394-
$(GenerateNupkgPowershellScript)"
395-
Outputs="$(SdkPlaceholderInstallerNupkgFile)">
396-
<Exec Command="powershell -NoProfile -NoLogo $(GenerateNupkgPowershellScript) ^
397-
'$(ArtifactsDir)' ^
398-
'$(SdkPlaceholderMSIInstallerFile)' ^
399-
'$(FullNugetVersion)' ^
400-
'$(SdkPlaceholderInstallerNuspecFile)' ^
401-
'$(SdkPlaceholderInstallerNupkgFile)' ^
402-
'$(Architecture)' ^
403-
'$(MajorMinorVersion)'" />
404-
</Target>
405-
406367
<Target Name="GenerateTemplatesNupkgs"
407368
DependsOnTargets="MsiTargetsSetupInputOutputs;GenerateTemplatesMsis;SetupTemplatesNupkgs"
408369
Inputs="@(TemplatesNupkgComponent->'%(MSIInstallerFile)');
@@ -454,7 +415,7 @@
454415
</Target>
455416

456417
<Target Name="GenerateMsis"
457-
BeforeTargets="Pack"
418+
AfterTargets="Build"
458419
DependsOnTargets="$(GenerateMsisDependsOn)" />
459420

460421
</Project>

src/Installer/redist-installer/targets/GeneratePKG.targets

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@
227227
</Target>
228228

229229
<Target Name="GeneratePkgs"
230-
BeforeTargets="Pack"
230+
AfterTargets="Build"
231231
DependsOnTargets="GenerateSdkPkg;GenerateSdkProductArchive" />
232232

233233
</Project>

src/Layout/Directory.Build.props

-12
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<Project Sdk="Microsoft.Build.NoTargets">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net472</TargetFramework>
5+
<IsPackable Condition="'$(OS)' == 'Windows_NT' and '$(PgoInstrument)' != 'true' and '$(SkipBuildingInstallers)' != 'true'">true</IsPackable>
6+
<BeforePack>$(BeforePack);GenerateLayout</BeforePack>
7+
<PackageId>VS.Redist.Common.NetCore.SdkPlaceholder.$(Architecture).$(MajorMinorVersion)</PackageId>
8+
<PackageDescription>.NET $(MajorMinorVersion) SDK ARP Placeholder ($(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="$(RepoRoot)src\Installer\redist-installer\redist-installer.proj" />
16+
</ItemGroup>
17+
18+
<Target Name="GenerateLayout" Condition="'$(IsPackable)' == 'true'" DependsOnTargets="ResolveProjectReferences">
19+
<!-- TODO: Remove this hardcode when redist-installer got moved into src/Layout. -->
20+
<PropertyGroup>
21+
<SdkPlaceholderMSIInstallerFile>$(ArtifactsNonShippingPackagesDir)dotnet-sdkplaceholder-$(FullNugetVersion)-$(ProductMonikerRid)$(InstallerExtension)</SdkPlaceholderMSIInstallerFile>
22+
</PropertyGroup>
23+
24+
<ItemGroup>
25+
<Content Include="$(SdkPlaceholderMSIInstallerFile)" PackagePath="/" />
26+
</ItemGroup>
27+
</Target>
28+
29+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<Project Sdk="Microsoft.Build.NoTargets">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net472</TargetFramework>
5+
<IsPackable Condition="'$(OS)' == 'Windows_NT' and '$(PgoInstrument)' != 'true' and '$(SkipBuildingInstallers)' != 'true'">true</IsPackable>
6+
<BeforePack>$(BeforePack);GenerateLayout</BeforePack>
7+
<PackageId>VS.Redist.Common.NetCore.Toolset.$(Architecture).$(MajorMinorVersion)</PackageId>
8+
<PackageDescription>.NET $(MajorMinorVersion) SDK Toolset ($(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="$(RepoRoot)src\Installer\redist-installer\redist-installer.proj" />
16+
</ItemGroup>
17+
18+
<Target Name="GenerateLayout" Condition="'$(IsPackable)' == 'true'" DependsOnTargets="ResolveProjectReferences">
19+
<!-- TODO: Remove these hardcodes when redist-installer got moved into src/Layout. -->
20+
<PropertyGroup>
21+
<ArtifactNameWithVersionSdk>dotnet-sdk-internal$(PgoTerm)-$(Version)-$(ProductMonikerRid)</ArtifactNameWithVersionSdk>
22+
<SdkMSIInstallerFileName>$(ArtifactNameWithVersionSdk)$(InstallerExtension)</SdkMSIInstallerFileName>
23+
<SdkMSIInstallerFile>$(ArtifactsNonShippingPackagesDir)$(SdkMSIInstallerFileName)</SdkMSIInstallerFile>
24+
</PropertyGroup>
25+
26+
<ItemGroup>
27+
<Content Include="$(SdkMSIInstallerFile)" PackagePath="/" />
28+
</ItemGroup>
29+
</Target>
30+
31+
</Project>

0 commit comments

Comments
 (0)