Skip to content

Commit cd2f0ff

Browse files
tmdsViktorHofer
andauthored
Use generated runtime.json when building shared framework packages. (dotnet#76068)
* Use generated runtime.json when building shared framework packages. * Don't UpdateRuntimeJson on Build. * PR feedback. * Update Microsoft.NETCore.Platforms.csproj Co-authored-by: Viktor Hofer <[email protected]>
1 parent 0075639 commit cd2f0ff

File tree

6 files changed

+9
-11
lines changed

6 files changed

+9
-11
lines changed

Directory.Build.props

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,6 @@
274274
<PackageProjectUrl>https://dot.net</PackageProjectUrl>
275275
<Owners>microsoft,dotnetframework</Owners>
276276
<IncludeSymbols>true</IncludeSymbols>
277-
<RuntimeIdGraphDefinitionFile>$([MSBuild]::NormalizePath('$(LibrariesProjectRoot)', 'Microsoft.NETCore.Platforms', 'src', 'runtime.json'))</RuntimeIdGraphDefinitionFile>
278277
<LicenseFile>$(MSBuildThisFileDirectory)LICENSE.TXT</LicenseFile>
279278
<PackageLicenseExpression>MIT</PackageLicenseExpression>
280279
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>

eng/liveBuilds.targets

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,8 @@
223223
ResolveLibrariesRuntimeFilesFromLocalBuild" />
224224

225225
<PropertyGroup>
226-
<BundledRuntimeIdentifierGraphFile>$(RuntimeIdGraphDefinitionFile)</BundledRuntimeIdentifierGraphFile>
226+
<!-- Keep in sync with outputs defined in Microsoft.NETCore.Platforms.csproj. -->
227+
<BundledRuntimeIdentifierGraphFile>$([MSBuild]::NormalizePath('$(ArtifactsBinDir)', 'Microsoft.NETCore.Platforms', 'runtime.json'))</BundledRuntimeIdentifierGraphFile>
228+
<BundledRuntimeIdentifierGraphFile Condition="!Exists('$(BundledRuntimeIdentifierGraphFile)')">$([MSBuild]::NormalizePath('$(LibrariesProjectRoot)', 'Microsoft.NETCore.Platforms', 'src', 'runtime.json'))</BundledRuntimeIdentifierGraphFile>
227229
</PropertyGroup>
228230
</Project>

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
<AvoidRestoreCycleOnSelfReference>true</AvoidRestoreCycleOnSelfReference>
1818
<!-- TODO: Remove with AvoidRestoreCycleOnSelfReference hack. -->
1919
<PackageValidationBaselineName>$(MSBuildProjectName)</PackageValidationBaselineName>
20-
<BeforePack>GenerateRuntimeJson;UpdateRuntimeJson;$(BeforePack)</BeforePack>
2120

2221
<_generateRuntimeGraphTargetFramework Condition="'$(MSBuildRuntimeType)' == 'core'">$(NetCoreAppToolCurrent)</_generateRuntimeGraphTargetFramework>
2322
<_generateRuntimeGraphTargetFramework Condition="'$(MSBuildRuntimeType)' != 'core'">net472</_generateRuntimeGraphTargetFramework>
@@ -44,7 +43,7 @@
4443

4544
<ItemGroup>
4645
<Content Condition="'$(AdditionalRuntimeIdentifiers)' == ''" Include="runtime.json" PackagePath="/" />
47-
<Content Condition="'$(AdditionalRuntimeIdentifiers)' != ''" Include="$(IntermediateOutputPath)runtime.json" PackagePath="/" />
46+
<Content Condition="'$(AdditionalRuntimeIdentifiers)' != ''" Include="$(BaseOutputPath)runtime.json" PackagePath="/" />
4847
<Content Include="$(PlaceholderFile)" PackagePath="lib/netstandard1.0" />
4948
</ItemGroup>
5049

@@ -58,12 +57,12 @@
5857

5958
<UsingTask TaskName="GenerateRuntimeGraph" AssemblyFile="$(_generateRuntimeGraphTask)"/>
6059

61-
<Target Name="GenerateRuntimeJson" Condition="'$(AdditionalRuntimeIdentifiers)' != ''">
60+
<Target Name="GenerateRuntimeJson" AfterTargets="Build" Condition="'$(AdditionalRuntimeIdentifiers)' != ''">
6261
<MakeDir Directories="$(IntermediateOutputPath)" />
6362
<GenerateRuntimeGraph RuntimeGroups="@(RuntimeGroupWithQualifiers)"
6463
AdditionalRuntimeIdentifiers="$(AdditionalRuntimeIdentifiers)"
6564
AdditionalRuntimeIdentifierParent="$(AdditionalRuntimeIdentifierParent)"
66-
RuntimeJson="$(IntermediateOutputPath)runtime.json"
65+
RuntimeJson="$(BaseOutputPath)runtime.json"
6766
UpdateRuntimeFiles="True" />
6867
</Target>
6968

src/libraries/oob-all.proj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
<!-- Build these packages in the allconfigurations leg only. -->
1717
<ProjectReference Remove="Microsoft.Internal.Runtime.AspNetCore.Transport\src\Microsoft.Internal.Runtime.AspNetCore.Transport.proj;
1818
Microsoft.Internal.Runtime.WindowsDesktop.Transport\src\Microsoft.Internal.Runtime.WindowsDesktop.Transport.proj;
19-
Microsoft.Windows.Compatibility\src\Microsoft.Windows.Compatibility.csproj;
20-
Microsoft.NETCore.Platforms\src\Microsoft.NETCore.Platforms.csproj"
19+
Microsoft.Windows.Compatibility\src\Microsoft.Windows.Compatibility.csproj"
2120
Condition="'$(BuildAllConfigurations)' != 'true'" />
2221

2322
<!-- Skip these projects during source-build as they rely on external prebuilts. -->

src/libraries/oob-src.proj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
('$(BuildAllConfigurations)' != 'true' and '$(RuntimeFlavor)' == '$(PrimaryRuntimeFlavor)')" />
2222

2323
<!-- Don't build task and tools project in the NetCoreAppCurrent vertical. -->
24-
<ProjectReference Remove="Microsoft.NETCore.Platforms\src\Microsoft.NETCore.Platforms.csproj;
25-
Microsoft.XmlSerializer.Generator\src\Microsoft.XmlSerializer.Generator.csproj" />
24+
<ProjectReference Remove="Microsoft.XmlSerializer.Generator\src\Microsoft.XmlSerializer.Generator.csproj" />
2625

2726
<!-- Don't build meta-projects in the NetCoreAppCurrent vertical. -->
2827
<ProjectReference Remove="Microsoft.Internal.Runtime.AspNetCore.Transport\src\Microsoft.Internal.Runtime.AspNetCore.Transport.proj;

src/libraries/pretest.proj

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

0 commit comments

Comments
 (0)