Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Use generated runtime.json when building shared framework packages.
  • Loading branch information
tmds committed Sep 23, 2022
commit c9f12d2718f68b94e63bbdece29bee61c643e497
3 changes: 2 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,8 @@
<PackageProjectUrl>https://dot.net</PackageProjectUrl>
<Owners>microsoft,dotnetframework</Owners>
<IncludeSymbols>true</IncludeSymbols>
<RuntimeIdGraphDefinitionFile>$([MSBuild]::NormalizePath('$(LibrariesProjectRoot)', 'Microsoft.NETCore.Platforms', 'src', 'runtime.json'))</RuntimeIdGraphDefinitionFile>
<SourceRuntimeIdentifierGraphFile>$([MSBuild]::NormalizePath('$(LibrariesProjectRoot)', 'Microsoft.NETCore.Platforms', 'src', 'runtime.json'))</SourceRuntimeIdentifierGraphFile>
<GeneratedRuntimeIdentifierGraphFile>$([MSBuild]::NormalizePath('$(ArtifactsBinDir)', 'Microsoft.NETCore.Platforms', '$(Configuration)', 'runtime.json'))</GeneratedRuntimeIdentifierGraphFile>
<LicenseFile>$(MSBuildThisFileDirectory)LICENSE.TXT</LicenseFile>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
Expand Down
2 changes: 1 addition & 1 deletion eng/liveBuilds.targets
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,6 @@
ResolveLibrariesRuntimeFilesFromLocalBuild" />

<PropertyGroup>
<BundledRuntimeIdentifierGraphFile>$(RuntimeIdGraphDefinitionFile)</BundledRuntimeIdentifierGraphFile>
<BundledRuntimeIdentifierGraphFile>$(SourceRuntimeIdentifierGraphFile)</BundledRuntimeIdentifierGraphFile>
</PropertyGroup>
</Project>
4 changes: 4 additions & 0 deletions src/installer/pkg/sfx/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets, $(MSBuildThisFileDirectory)..))" />

<PropertyGroup>
<BundledRuntimeIdentifierGraphFile>$(GeneratedRuntimeIdentifierGraphFile)</BundledRuntimeIdentifierGraphFile>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
<AvoidRestoreCycleOnSelfReference>true</AvoidRestoreCycleOnSelfReference>
<!-- TODO: Remove with AvoidRestoreCycleOnSelfReference hack. -->
<PackageValidationBaselineName>$(MSBuildProjectName)</PackageValidationBaselineName>
<BeforePack>GenerateRuntimeJson;UpdateRuntimeJson;$(BeforePack)</BeforePack>

<_generateRuntimeGraphTargetFramework Condition="'$(MSBuildRuntimeType)' == 'core'">$(NetCoreAppToolCurrent)</_generateRuntimeGraphTargetFramework>
<_generateRuntimeGraphTargetFramework Condition="'$(MSBuildRuntimeType)' != 'core'">net472</_generateRuntimeGraphTargetFramework>
Expand All @@ -43,8 +42,7 @@
</ItemGroup>

<ItemGroup>
<Content Condition="'$(AdditionalRuntimeIdentifiers)' == ''" Include="runtime.json" PackagePath="/" />
<Content Condition="'$(AdditionalRuntimeIdentifiers)' != ''" Include="$(IntermediateOutputPath)runtime.json" PackagePath="/" />
<Content Include="$(GeneratedRuntimeIdentifierGraphFile)" PackagePath="/" />
<Content Include="$(PlaceholderFile)" PackagePath="lib/netstandard1.0" />
</ItemGroup>

Expand All @@ -58,16 +56,20 @@

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

<Target Name="GenerateRuntimeJson" Condition="'$(AdditionalRuntimeIdentifiers)' != ''">
<Target Name="GenerateRuntimeJson" BeforeTargets="UpdateRuntimeJson">
<MakeDir Directories="$(IntermediateOutputPath)" />
<GenerateRuntimeGraph RuntimeGroups="@(RuntimeGroupWithQualifiers)"
<GenerateRuntimeGraph Condition="'$(AdditionalRuntimeIdentifiers)' != ''"
RuntimeGroups="@(RuntimeGroupWithQualifiers)"
AdditionalRuntimeIdentifiers="$(AdditionalRuntimeIdentifiers)"
AdditionalRuntimeIdentifierParent="$(AdditionalRuntimeIdentifierParent)"
RuntimeJson="$(IntermediateOutputPath)runtime.json"
RuntimeJson="$(GeneratedRuntimeIdentifierGraphFile)"
UpdateRuntimeFiles="True" />
<Copy Condition="'$(AdditionalRuntimeIdentifiers)' == ''"
SourceFiles="runtime.json"
DestinationFiles="$(GeneratedRuntimeIdentifierGraphFile)" />
</Target>

<Target Name="UpdateRuntimeJson">
<Target Name="UpdateRuntimeJson" BeforeTargets="Build">
<!-- Generates a Runtime graph using RuntimeGroups and diffs it with the graph described by runtime.json and runtime.compatibility.json
Specifying UpdateRuntimeFiles=true skips the diff and updates those files.
The graph can be visualized using the generated dmgl -->
Expand Down
3 changes: 1 addition & 2 deletions src/libraries/oob-src.proj
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
('$(BuildAllConfigurations)' != 'true' and '$(RuntimeFlavor)' == '$(PrimaryRuntimeFlavor)')" />

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

<!-- Don't build meta-projects in the NetCoreAppCurrent vertical. -->
<ProjectReference Remove="Microsoft.Internal.Runtime.AspNetCore.Transport\src\Microsoft.Internal.Runtime.AspNetCore.Transport.proj;
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/pretest.proj
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
Condition="'$(BuildTargetFramework)' == '$(NetCoreAppCurrent)' or '$(BuildTargetFramework)' == ''">
<!-- Shared framework deps file generation. Produces a test shared-framework deps file. -->
<GenerateTestSharedFrameworkDepsFile SharedFrameworkDirectory="$(NetCoreAppCurrentTestHostSharedFrameworkPath)"
RuntimeGraphFiles="$(RuntimeIdGraphDefinitionFile)"
RuntimeGraphFiles="$(SourceRuntimeIdentifierGraphFile)"
TargetRuntimeIdentifier="$(PackageRID)" />
</Target>

Expand Down