Skip to content

Commit 0abb510

Browse files
Enable repackaging of NETStandard 2.1 Targeting Pack (#102081)
* Initial changes * Enable building in 8.0.6 release * Build netstandard 2.1 installer for RPM only * Update target build to 8.0.7
1 parent fe21c03 commit 0abb510

File tree

4 files changed

+73
-0
lines changed

4 files changed

+73
-0
lines changed

eng/Subsets.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,7 @@
507507
<SharedFrameworkProjectToBuild Condition="'$(RuntimeFlavor)' != 'Mono' and '$(PgoInstrument)' != 'true'" Include="$(InstallerProjectRoot)pkg\sfx\Microsoft.NETCore.App\Microsoft.NETCore.App.Crossgen2.sfxproj" />
508508
<SharedFrameworkProjectToBuild Condition="'$(RuntimeFlavor)' == '$(PrimaryRuntimeFlavor)'" Include="$(InstallerProjectRoot)pkg\sfx\installers\dotnet-host.proj" />
509509
<SharedFrameworkProjectToBuild Condition="'$(RuntimeFlavor)' == '$(PrimaryRuntimeFlavor)'" Include="$(InstallerProjectRoot)pkg\sfx\installers\dotnet-hostfxr.proj" />
510+
<SharedFrameworkProjectToBuild Condition="'$(BuildNETStandard21TargetingPack)' == 'true' and '$(RuntimeFlavor)' == '$(PrimaryRuntimeFlavor)'" Include="$(InstallerProjectRoot)pkg\sfx\installers\netstandard2.1.proj" />
510511
<SharedFrameworkProjectToBuild Condition="'$(RuntimeFlavor)' == '$(PrimaryRuntimeFlavor)'" Include="$(InstallerProjectRoot)pkg\sfx\installers\dotnet-runtime-deps\*.proj" />
511512
<SharedFrameworkProjectToBuild Condition="'$(RuntimeFlavor)' == '$(PrimaryRuntimeFlavor)'" Include="$(InstallerProjectRoot)pkg\archives\dotnet-nethost.proj" />
512513
<SharedFrameworkProjectToBuild Condition="'$(MonoCrossAOTTargetOS)' != ''" Include="$(InstallerProjectRoot)pkg\sfx\Microsoft.NETCore.App\monocrossaot.sfxproj" Pack="true" />

eng/Versions.props

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,4 +260,12 @@
260260
<MicrosoftDotnetSdkInternalVersion>8.0.101</MicrosoftDotnetSdkInternalVersion>
261261
<SdkVersionForWorkloadTesting>$(MicrosoftDotnetSdkInternalVersion)</SdkVersionForWorkloadTesting>
262262
</PropertyGroup>
263+
<PropertyGroup>
264+
<!--
265+
Targeting pack package for NETStandard 2.1 gets rebuilt on demand.
266+
267+
Set to rebuild with 8.0.7 release, and automatically disabled after that.
268+
-->
269+
<BuildNETStandard21TargetingPack Condition="'$(PatchVersion)' == '7'">true</BuildNETStandard21TargetingPack>
270+
</PropertyGroup>
263271
</Project>

src/installer/pkg/sfx/installers.proj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
<InstallerProjectReference Include="installers/dotnet-runtime-deps/dotnet-runtime-deps-sles.12.proj" />
2323
</ItemGroup>
2424

25+
<ItemGroup Condition="'$(BuildNETStandard21TargetingPack)' == 'true' and '$(BuildRpmPackage)' == 'true'">
26+
<InstallerProjectReference Include="installers/netstandard2.1.proj" />
27+
</ItemGroup>
28+
2529
<Target Name="BuildInstallerProjects" BeforeTargets="Build">
2630
<MSBuild Projects="@(InstallerProjectReference)"
2731
Targets="GenerateInstallers"
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<Project Sdk="Microsoft.Build.NoTargets">
2+
<PropertyGroup>
3+
<SkipBuild Condition="'$(RuntimeFlavor)' != '$(PrimaryRuntimeFlavor)' or '$(TargetsMobile)' == 'true'">true</SkipBuild>
4+
<GenerateInstallers Condition="'$(BuildRpmPackage)' != 'true'">false</GenerateInstallers>
5+
<InstallerName>netstandard-targeting-pack-2.1</InstallerName>
6+
<PackageBrandNameSuffix>NETStandard.Library.Ref</PackageBrandNameSuffix>
7+
<ProductBrandName>NETStandard.Library.Ref 2.1.0</ProductBrandName>
8+
<VersionInstallerName>false</VersionInstallerName>
9+
<PlatformPackageType>ToolPack</PlatformPackageType>
10+
<UseBrandingNameInLinuxPackageDescription>true</UseBrandingNameInLinuxPackageDescription>
11+
<OriginalNETStandard21PkgFilename>netstandard-targeting-pack-2.1.0-x64.rpm</OriginalNETStandard21PkgFilename>
12+
<NETStandard21PkgDownloadUrl>https://dotnetcli.blob.core.windows.net/dotnet/Runtime/3.1.0/$(OriginalNETStandard21PkgFilename)</NETStandard21PkgDownloadUrl>
13+
<NETStandard21TempDir>$([MSBuild]::NormalizeDirectory('$(BaseIntermediateOutputPath)', 'download'))</NETStandard21TempDir>
14+
<NETStandard21PkgDestinationPath>$(NETStandard21TempDir)$(OriginalNETStandard21PkgFilename)</NETStandard21PkgDestinationPath>
15+
<NETStandard21PkgDownloadSemaphore>$(NETStandard21TempDir)netstandard21.semaphore</NETStandard21PkgDownloadSemaphore>
16+
</PropertyGroup>
17+
18+
<UsingTask TaskName="DownloadFile" AssemblyFile="$(ArcadeSdkBuildTasksAssembly)" />
19+
20+
<Target Name="AcquireNETStandard21PackageContents"
21+
Inputs="$(NETStandard21PkgDestinationPath)"
22+
Outputs="$(NETStandard21PkgDownloadSemaphore)">
23+
24+
<RemoveDir Directories="$(NETStandard21TempDir)" />
25+
26+
<DownloadFile
27+
Uri="$(NETStandard21PkgDownloadUrl)"
28+
DestinationPath="$(NETStandard21PkgDestinationPath)"
29+
Overwrite="true"
30+
TimeoutInSeconds="9999" />
31+
32+
<Exec Command="rpm2cpio $(NETStandard21PkgDestinationPath) | cpio -idmv"
33+
WorkingDirectory="$(NETStandard21TempDir)" />
34+
35+
<WriteLinesToFile
36+
File="$(NETStandard21PkgDownloadSemaphore)"
37+
Lines="$(NETStandard21PkgDownloadUrl)"
38+
Overwrite="true"
39+
Encoding="Unicode" />
40+
41+
</Target>
42+
43+
<Target Name="PublishToDisk"
44+
DependsOnTargets="AcquireNETStandard21PackageContents">
45+
<Error Condition="'$(OutputPath)' == ''" Text="Publishing to disk requires the OutputPath to be set to the root of the path to write to." />
46+
47+
<ItemGroup>
48+
<Content Include="$(NETStandard21TempDir)usr/share/dotnet/**/*" />
49+
</ItemGroup>
50+
51+
<Copy SourceFiles="@(Content)"
52+
DestinationFolder="$(OutputPath)/%(RecursiveDir)" />
53+
</Target>
54+
55+
<Target Name="AddLinuxPackageInformation" BeforeTargets="GetRpmInstallerJsonProperties">
56+
<ItemGroup>
57+
<RpmJsonProperty Include="directories" Object="[ &quot;/usr/share/dotnet/packs/NETStandard.Library.Ref/2.1.0&quot;, &quot;/usr/share/doc/netstandard-targeting-pack-2.1&quot; ]" />
58+
</ItemGroup>
59+
</Target>
60+
</Project>

0 commit comments

Comments
 (0)