Skip to content

Commit d47faf2

Browse files
authored
source-build: support building runtime using non-portable runtime packages (backport of #75597) (#77509)
1 parent 552fcf0 commit d47faf2

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Directory.Build.targets

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,21 @@
1111
<Import Project="$(RepositoryEngineeringDir)liveBuilds.targets" />
1212
<Import Project="$(RepositoryEngineeringDir)python.targets" />
1313

14+
<!--
15+
When .NET gets built from source, make the SDK aware there are bootstrap packages
16+
for Microsoft.NETCore.App.Runtime.<rid> and Microsoft.NETCore.App.Crossgen2.<rid>.
17+
-->
18+
<ItemGroup Condition="'$(DotNetBuildFromSource)' == 'true'">
19+
<KnownFrameworkReference Update="@(KnownFrameworkReference->WithMetadataValue('Identity', 'Microsoft.NETCore.App')->WithMetadataValue('TargetFramework', '$(NetCoreAppCurrent)'))">
20+
<RuntimePackRuntimeIdentifiers>$(PackageRID)</RuntimePackRuntimeIdentifiers>
21+
</KnownFrameworkReference>
22+
<KnownCrossgen2Pack Update="@(KnownCrossgen2Pack->WithMetadataValue('Identity', 'Microsoft.NETCore.App.Crossgen2')->WithMetadataValue('TargetFramework', '$(NetCoreAppCurrent)'))">
23+
<Crossgen2RuntimeIdentifiers>$(PackageRID)</Crossgen2RuntimeIdentifiers>
24+
</KnownCrossgen2Pack>
25+
<!-- Avoid references to Microsoft.AspNetCore.App.Runtime.<rid> -->
26+
<KnownFrameworkReference Remove="Microsoft.AspNetCore.App" />
27+
</ItemGroup>
28+
1429
<PropertyGroup>
1530
<!--
1631
Define this here (not just in Versions.props) because the SDK resets it

0 commit comments

Comments
 (0)