Skip to content

Commit 365d7a6

Browse files
authored
Add CG2 to source-build bundle (#49241)
1 parent 2f2cc45 commit 365d7a6

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

src/Layout/Directory.Build.props

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@
5454
<BundleRuntimePacks Condition="'$(BundleRuntimePacks)' == '' and '$(DotNetBuildSourceOnly)' == 'true'">true</BundleRuntimePacks>
5555
<BundleNativeAotCompiler Condition="'$(BundleNativeAotCompiler)' == '' and '$(DotNetBuildSourceOnly)' == 'true' and '$(DotNetBuildUseMonoRuntime)' != 'true'">true</BundleNativeAotCompiler>
5656

57+
<!-- Crossgen2 is not bundled by default on platforms where Microsoft provides a package on nuget.org,
58+
because it is large (100MB+). -->
59+
<_IsCommunityPlatform Condition="'$(OSName)' != 'win' and '$(OSName)' != 'osx'
60+
and !('$(OSName)' == 'linux' and ('$(TargetArchitecture)' == 'x64' or '$(TargetArchitecture)' == 'x86' or '$(TargetArchitecture)' == 'arm' or '$(TargetArchitecture)' == 'arm64'))">true</_IsCommunityPlatform>
61+
<BundleCrossgen2 Condition="'$(BundleCrossgen2)' == '' and '$(DotNetBuildSourceOnly)' == 'true' and '$(DotNetBuildUseMonoRuntime)' != 'true' and '$( _IsCommunityPlatform )' == 'true'">true</BundleCrossgen2>
62+
5763
<!-- Use the portable "linux-x64" Rid when downloading Linux shared framework compressed file. -->
5864
<UsePortableLinuxSharedFramework Condition="'$(UsePortableLinuxSharedFramework)' == '' and '$(IsLinux)' == 'true' and !$(TargetRid.StartsWith('linux-musl'))">true</UsePortableLinuxSharedFramework>
5965
<HighEntropyVA>true</HighEntropyVA>

src/Layout/redist/targets/GenerateBundledVersions.targets

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,10 @@
276276
Condition="'$(BundleNativeAotCompiler)' == 'true'"
277277
Include="$(ProductMonikerRid)" />
278278

279+
<Crossgen2SupportedRids
280+
Condition="'$(BundleCrossgen2)' == 'true'"
281+
Include="$(ProductMonikerRid)" />
282+
279283
<Net60MonoRuntimePackRids Include="
280284
@(Net60RuntimePackRids);
281285
browser-wasm;

src/Layout/redist/targets/RestoreLayout.targets

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,12 @@
114114
PackageVersion="$(MicrosoftWindowsDesktopAppRefPackageVersion)"
115115
RelativeLayoutPath="packs/%(PackageName)/%(PackageVersion)" />
116116

117+
<BundledLayoutPackage Include="Microsoft.NETCore.App.Crossgen2.$(SharedFrameworkRid)"
118+
Condition="'$(BundleCrossgen2)' == 'true'"
119+
PackageName="Microsoft.NETCore.App.Crossgen2.$(SharedFrameworkRid)"
120+
PackageVersion="$(MicrosoftNETCoreAppRuntimePackageVersion)"
121+
RelativeLayoutPath="packs/%(PackageName)/%(PackageVersion)" />
122+
117123
<BundledLayoutPackage Include="runtime.$(SharedFrameworkRid).Microsoft.DotNet.ILCompiler"
118124
Condition="'$(BundleNativeAotCompiler)' == 'true'"
119125
PackageName="runtime.$(SharedFrameworkRid).Microsoft.DotNet.ILCompiler"

0 commit comments

Comments
 (0)