Skip to content

Commit 526eafa

Browse files
authored
Use generated runtime.json when building shared framework packages (backport of #76068) (#77510)
1 parent fe21795 commit 526eafa

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

Directory.Build.props

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,6 @@
253253
<PackageProjectUrl>https://dot.net</PackageProjectUrl>
254254
<Owners>microsoft,dotnetframework</Owners>
255255
<IncludeSymbols>true</IncludeSymbols>
256-
<RuntimeIdGraphDefinitionFile>$([MSBuild]::NormalizePath('$(LibrariesProjectRoot)', 'Microsoft.NETCore.Platforms', 'src', 'runtime.json'))</RuntimeIdGraphDefinitionFile>
257256
<LicenseFile>$(MSBuildThisFileDirectory)LICENSE.TXT</LicenseFile>
258257
<PackageLicenseExpression>MIT</PackageLicenseExpression>
259258
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>

eng/liveBuilds.targets

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@
193193
</Target>
194194

195195
<PropertyGroup>
196-
<BundledRuntimeIdentifierGraphFile>$(RuntimeIdGraphDefinitionFile)</BundledRuntimeIdentifierGraphFile>
196+
<!-- Keep in sync with outputs defined in Microsoft.NETCore.Platforms.csproj. -->
197+
<BundledRuntimeIdentifierGraphFile>$([MSBuild]::NormalizePath('$(ArtifactsBinDir)', 'Microsoft.NETCore.Platforms', 'runtime.json'))</BundledRuntimeIdentifierGraphFile>
198+
<BundledRuntimeIdentifierGraphFile Condition="!Exists('$(BundledRuntimeIdentifierGraphFile)')">$([MSBuild]::NormalizePath('$(LibrariesProjectRoot)', 'Microsoft.NETCore.Platforms', 'src', 'runtime.json'))</BundledRuntimeIdentifierGraphFile>
197199
</PropertyGroup>
198200
</Project>

src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
<ItemGroup>
4343
<Content Condition="'$(AdditionalRuntimeIdentifiers)' == ''" Include="runtime.json" PackagePath="/" />
44-
<Content Condition="'$(AdditionalRuntimeIdentifiers)' != ''" Include="$(IntermediateOutputPath)runtime.json" PackagePath="/" />
44+
<Content Condition="'$(AdditionalRuntimeIdentifiers)' != ''" Include="$(BaseOutputPath)runtime.json" PackagePath="/" />
4545
<Content Include="$(PlaceholderFile)" PackagePath="lib/netstandard1.0" />
4646
</ItemGroup>
4747

@@ -50,12 +50,12 @@
5050
<PackageReference Include="NuGet.ProjectModel" Version="$(NugetProjectModelVersion)" />
5151
</ItemGroup>
5252

53-
<Target Name="GenerateRuntimeJson" Condition="'$(AdditionalRuntimeIdentifiers)' != ''" BeforeTargets="GenerateNuspec">
53+
<Target Name="GenerateRuntimeJson" AfterTargets="Build" Condition="'$(AdditionalRuntimeIdentifiers)' != ''">
5454
<MakeDir Directories="$(IntermediateOutputPath)" />
5555
<GenerateRuntimeGraph RuntimeGroups="@(RuntimeGroupWithQualifiers)"
5656
AdditionalRuntimeIdentifiers="$(AdditionalRuntimeIdentifiers)"
5757
AdditionalRuntimeIdentifierParent="$(AdditionalRuntimeIdentifierParent)"
58-
RuntimeJson="$(IntermediateOutputPath)runtime.json"
58+
RuntimeJson="$(BaseOutputPath)runtime.json"
5959
UpdateRuntimeFiles="True" />
6060
</Target>
6161

src/libraries/pretest.proj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
Condition="'$(BuildTargetFramework)' == '$(NetCoreAppCurrent)' or '$(BuildTargetFramework)' == ''">
9393
<!-- Shared framework deps file generation. Produces a test shared-framework deps file. -->
9494
<GenerateTestSharedFrameworkDepsFile SharedFrameworkDirectory="$(NetCoreAppCurrentTestHostSharedFrameworkPath)"
95-
RuntimeGraphFiles="$(RuntimeIdGraphDefinitionFile)"
95+
RuntimeGraphFiles="$(BundledRuntimeIdentifierGraphFile)"
9696
TargetRuntimeIdentifier="$(PackageRID)" />
9797
</Target>
9898

0 commit comments

Comments
 (0)