Skip to content

Commit b9afc54

Browse files
authored
Minor clean-up in redist-installer (#46896)
1 parent fb527ca commit b9afc54

19 files changed

+128
-169
lines changed

Directory.Build.props

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,40 @@
2222
<Import Project="Sdk.props" Sdk="Microsoft.DotNet.Arcade.Sdk" />
2323
<Import Project="$(RepositoryEngineeringDir)Analyzers.props" />
2424

25-
<PropertyGroup Condition="'$(PgoInstrument)' == 'true'">
26-
<SkipBuildingInstallers>true</SkipBuildingInstallers>
27-
<PgoTerm>-pgo</PgoTerm>
25+
<PropertyGroup>
26+
<!-- Use current machine distro RID if set. Otherwise, fall back to RuntimeInformation.RuntimeIdentifier -->
27+
<HostRid Condition="'$(HostRid)' == '' and '$(MSBuildRuntimeType)' == 'core'">$(__DistroRid)</HostRid>
28+
<HostRid Condition="'$(HostRid)' == '' and '$(MSBuildRuntimeType)' == 'core'">$([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier)</HostRid>
29+
<HostRid Condition="'$(HostRid)' == '' and '$(MSBuildRuntimeType)' != 'core'">win-$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString().ToLowerInvariant)</HostRid>
30+
31+
<IsLinux Condition="$([MSBuild]::IsOSPlatform('LINUX'))">true</IsLinux>
32+
<HostOSName Condition="'$(HostOSName)' == '' AND $([MSBuild]::IsOSPlatform('WINDOWS'))">win</HostOSName>
33+
<HostOSName Condition="'$(HostOSName)' == '' AND $([MSBuild]::IsOSPlatform('OSX'))">osx</HostOSName>
34+
<HostOSName Condition="'$(HostOSName)' == '' AND $([MSBuild]::IsOSPlatform('FREEBSD'))">freebsd</HostOSName>
35+
<HostOSName Condition="'$(HostOSName)' == '' AND $([MSBuild]::IsOSPlatform('ILLUMOS'))">illumos</HostOSName>
36+
<HostOSName Condition="'$(HostOSName)' == '' AND '$(IsLinux)' == 'true'">linux</HostOSName>
37+
38+
<IsDebianBaseDistro Condition="$(HostRid.StartsWith('ubuntu')) OR $(HostRid.StartsWith('debian'))">true</IsDebianBaseDistro>
39+
<IsRPMBasedDistro Condition="$(HostRid.StartsWith('rhel'))">true</IsRPMBasedDistro>
40+
<IsRPMBasedDistro Condition="$(HostRid.StartsWith('centos'))">true</IsRPMBasedDistro>
41+
</PropertyGroup>
42+
43+
<PropertyGroup>
44+
<ArchiveExtension>.tar.gz</ArchiveExtension>
45+
<ArchiveExtension Condition="$([MSBuild]::IsOSPlatform('WINDOWS'))">.zip</ArchiveExtension>
46+
47+
<InstallerExtension Condition="$([MSBuild]::IsOSPlatform('WINDOWS'))">.msi</InstallerExtension>
48+
<InstallerExtension Condition="$([MSBuild]::IsOSPlatform('OSX'))">.pkg</InstallerExtension>
49+
<InstallerExtension Condition="'$(IsDebianBaseDistro)' == 'true'">.deb</InstallerExtension>
50+
<InstallerExtension Condition="'$(IsRPMBasedDistro)' == 'true'">.rpm</InstallerExtension>
51+
52+
<BundleExtension Condition="$([MSBuild]::IsOSPlatform('WINDOWS'))">.exe</BundleExtension>
53+
<BundleExtension Condition="$([MSBuild]::IsOSPlatform('OSX'))">$(InstallerExtension)</BundleExtension>
54+
<BundleExtension Condition="'$(IsDebianBaseDistro)' == 'true'">$(InstallerExtension)</BundleExtension>
55+
<BundleExtension Condition="'$(IsRPMBasedDistro)' == 'true'">$(InstallerExtension)</BundleExtension>
56+
57+
<ExeExtension>.exe</ExeExtension>
58+
<ExeExtension Condition="!$([MSBuild]::IsOSPlatform('WINDOWS'))"></ExeExtension>
2859
</PropertyGroup>
2960

3061
<PropertyGroup>

eng/Versions.props

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -294,15 +294,6 @@
294294
<XunitCombinatorialVersion>1.3.2</XunitCombinatorialVersion>
295295
<MicrosoftDotNetInstallerWindowsSecurityTestDataPackageVersion>8.0.0-beta.23607.1</MicrosoftDotNetInstallerWindowsSecurityTestDataPackageVersion>
296296
</PropertyGroup>
297-
<PropertyGroup>
298-
<ExeExtension>.exe</ExeExtension>
299-
<ExeExtension Condition=" '$(OS)' != 'Windows_NT' ">
300-
</ExeExtension>
301-
<_DotNetHiveRoot>$(DOTNET_INSTALL_DIR)</_DotNetHiveRoot>
302-
<_DotNetHiveRoot Condition="'$(_DotNetHiveRoot)' == ''">$(RepoRoot).dotnet/</_DotNetHiveRoot>
303-
<_DotNetHiveRoot Condition="!HasTrailingSlash('$(_DotNetHiveRoot)')">$(_DotNetHiveRoot)/</_DotNetHiveRoot>
304-
<DotNetExe>$(_DotNetHiveRoot)dotnet$(ExeExtension)</DotNetExe>
305-
</PropertyGroup>
306297
<PropertyGroup Label="Workload manifest package versions">
307298
<AspireFeatureBand>8.0.100</AspireFeatureBand>
308299
<MicrosoftNETSdkAspireManifest80100PackageVersion>8.2.2</MicrosoftNETSdkAspireManifest80100PackageVersion>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<Project>
2+
3+
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
4+
5+
<PropertyGroup>
6+
<SdkBrandName>Microsoft .NET SDK $(Version)</SdkBrandName>
7+
<ToolsetBrandName>Microsoft .NET Toolset $(Version)</ToolsetBrandName>
8+
<SharedFrameworkBrandName>Microsoft .NET Runtime $(MicrosoftNETCoreAppRuntimePackageVersion)</SharedFrameworkBrandName>
9+
<NetCoreAppTargetingPackBrandName>Microsoft .NET Targeting Pack $(MicrosoftNETCoreAppRefPackageVersion)</NetCoreAppTargetingPackBrandName>
10+
<NetStandardTargetingPackBrandName>Microsoft .NET Standard 2.1 Targeting Pack $(NETStandardLibraryRefPackageVersion)</NetStandardTargetingPackBrandName>
11+
<NetCoreAppHostPackBrandName>Microsoft .NET AppHost Pack $(MicrosoftNETCoreAppHostHostPackageVersion)</NetCoreAppHostPackBrandName>
12+
<SharedHostBrandName>Microsoft .NET Host $(SharedHostVersion)</SharedHostBrandName>
13+
<HostFxrBrandName>Microsoft .NET Host FX Resolver $(HostFxrVersion)</HostFxrBrandName>
14+
<SharedFrameworkName>Microsoft.NETCore.App</SharedFrameworkName>
15+
<SharedFrameworkNugetName>$(SharedFrameworkName)</SharedFrameworkNugetName>
16+
</PropertyGroup>
17+
18+
<PropertyGroup>
19+
<OSName Condition="'$(OSName)' == '' AND $(Rid) != ''">$(Rid.Substring(0, $(Rid.LastIndexOf('-'))))</OSName>
20+
<OSName Condition="'$(OSName)' == ''">$(HostOSName)</OSName>
21+
<PortableOSName Condition=" '$(PortableOSName)' == '' ">$(OSName)</PortableOSName>
22+
23+
<Rid>$(OSName)-$(Architecture)</Rid>
24+
<PortableRid>$(PortableOSName)-$(Architecture)</PortableRid>
25+
<ProductMonikerRid Condition="'$(ProductMonikerRid)' == ''">$(Rid)</ProductMonikerRid>
26+
27+
<PortableProductMonikerRid Condition="'$(PortableProductMonikerRid)' == ''">$(PortableRid)</PortableProductMonikerRid>
28+
29+
<PgoTerm>-pgo</PgoTerm>
30+
<ArtifactNameSdk>dotnet-sdk-internal$(PgoTerm)</ArtifactNameSdk>
31+
32+
<ArtifactNameWithVersionSdk>$(ArtifactNameSdk)-$(Version)-$(ProductMonikerRid)</ArtifactNameWithVersionSdk>
33+
<ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk>dotnet-sdk$(PgoTerm)-$(Version)-$(ProductMonikerRid)</ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk>
34+
<!-- Warning: changing the value "ProductBandCombinedHostHostFxrFrameworkSdkName" can only occur on a product-band boundary [CliProductBandVersion],
35+
Changing "ProductBandCombinedHostHostFxrFrameworkSdkName" mid-product-band will break the upgradability of the SDK bundle installer. -->
36+
<ProductBandCombinedHostHostFxrFrameworkSdkName>Dotnet SDK Bundle Installer $(CliProductBandVersion) $(ProductMonikerRid)</ProductBandCombinedHostHostFxrFrameworkSdkName>
37+
</PropertyGroup>
38+
39+
<PropertyGroup>
40+
<SkipBuildingInstallers Condition="'$(PgoInstrument)' == 'true'">true</SkipBuildingInstallers>
41+
<SkipBuildingInstallers Condition="'$(SkipBuildingInstallers)' == '' AND
42+
(
43+
$(Rid.StartsWith('freebsd')) OR
44+
$(Rid.StartsWith('illumos')) OR
45+
$(Rid.StartsWith('linux-musl'))
46+
)">true</SkipBuildingInstallers>
47+
<SkipBuildingInstallers Condition="'$(SkipBuildingInstallers)' == ''">false</SkipBuildingInstallers>
48+
49+
<UsePortableLinuxSharedFramework Condition="'$(UsePortableLinuxSharedFramework)' == '' AND '$(IsLinux)' == 'True' AND !$(Rid.StartsWith('linux-musl'))">true</UsePortableLinuxSharedFramework>
50+
<HighEntropyVA>true</HighEntropyVA>
51+
</PropertyGroup>
52+
53+
</Project>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<Project>
2+
3+
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.targets', '$(MSBuildThisFileDirectory)../'))" />
4+
5+
<Import Project="$(RepoRoot)src\Tasks\sdk-tasks\sdk-tasks.InTree.targets" />
6+
<Import Project="targets\BundledTemplates.targets" />
7+
<Import Project="targets\BundledManifests.targets" />
8+
<Import Project="targets\BundledDotnetTools.targets" />
9+
<Import Project="targets\GenerateBundledVersions.targets" />
10+
<Import Project="targets\Crossgen.targets" />
11+
<Import Project="targets\GenerateLayout.targets" />
12+
<Import Project="targets\GenerateArchives.targets" Condition="'$(PackInstaller)' != 'false'"/>
13+
<Import Project="targets\GenerateMSIs.targets" />
14+
<Import Project="targets\GeneratePKG.targets" Condition="'$(PackInstaller)' != 'false'"/>
15+
<Import Project="targets\GenerateInstallers.targets" Condition="'$(PackInstaller)' != 'false'"/>
16+
<Import Project="targets\Badge.targets" />
17+
18+
</Project>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<Project>
2+
3+
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props, $(MSBuildThisFileDirectory)..\..))" />
4+
5+
</Project>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22

3-
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets, $(MSBuildThisFileDirectory)..))" />
3+
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets, $(MSBuildThisFileDirectory)..\..))" />
44

55
<ItemGroup>
66
<!-- Eliminate any package references injected, since we only want to download a single package. -->

src/Installer/redist-installer/redist-installer.csproj

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,4 @@
2626
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Installers" />
2727
</ItemGroup>
2828

29-
<Import Project="$(RepoRoot)src\Tasks\sdk-tasks\sdk-tasks.InTree.targets" />
30-
<Import Project="targets\GetRuntimeInformation.targets" />
31-
<Import Project="targets\SetBuildDefaults.targets" />
32-
<Import Project="targets\Branding.targets" />
33-
<Import Project="targets\BundledTemplates.targets" />
34-
<Import Project="targets\BundledManifests.targets" />
35-
<Import Project="targets\BundledDotnetTools.targets" />
36-
<Import Project="targets\GenerateBundledVersions.targets" />
37-
<Import Project="targets\Crossgen.targets" />
38-
<Import Project="targets\GenerateLayout.targets" />
39-
<Import Project="targets\FileExtensions.targets" />
40-
<Import Project="targets\GenerateArchives.targets" Condition="'$(PackInstaller)' != 'false'"/>
41-
<Import Project="targets\GenerateMSIs.targets" />
42-
<Import Project="targets\GeneratePKG.targets" Condition="'$(PackInstaller)' != 'false'"/>
43-
<Import Project="targets\GenerateInstallers.targets" Condition="'$(PackInstaller)' != 'false'"/>
44-
<Import Project="targets\Badge.targets" />
45-
4629
</Project>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
ReplacementStrings="$(Version)" />
1818
</Target>
1919

20-
<Target Name="SetBadgeProps" DependsOnTargets="GetCurrentRuntimeInformation">
20+
<Target Name="SetBadgeProps">
2121
<PropertyGroup>
2222
<VersionBadgeMoniker>$(OSName)_$(Architecture)</VersionBadgeMoniker>
2323
<VersionBadgeMoniker Condition=" '$(Rid)' == 'linux-musl-x64' ">linux_musl_x64</VersionBadgeMoniker>

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

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

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22

33
<!-- Crossgen is currently not supported on the s390x, ppc64le architecture as using mono instead of CoreCLR. -->
44
<Target Name="CrossgenLayout"
5-
Condition="'$(DISABLE_CROSSGEN)' == '' AND '$(Architecture)' != 's390x' AND '$(Architecture)' != 'ppc64le'"
6-
DependsOnTargets="SetSdkBrandingInfo">
5+
Condition="'$(DISABLE_CROSSGEN)' == '' AND '$(Architecture)' != 's390x' AND '$(Architecture)' != 'ppc64le'">
76
<PropertyGroup>
8-
<RuntimeNETCoreAppPackageName>microsoft.netcore.app.runtime.$(SharedFrameworkRid)</RuntimeNETCoreAppPackageName>
97
<RuntimeNETCrossgenPackageName>microsoft.netcore.app.crossgen2.$(Crossgen2Rid)</RuntimeNETCrossgenPackageName>
108
<CrossgenPath>$(NuGetPackageRoot)$(RuntimeNETCrossgenPackageName)/$(MicrosoftNETCoreAppRuntimePackageVersion)/tools/crossgen2$(ExeExtension)</CrossgenPath>
119
<CreateCrossgenSymbols Condition="'$(CreateCrossgenSymbols)' == ''">true</CreateCrossgenSymbols>

0 commit comments

Comments
 (0)