Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove duplication with regard to ReadyToRun compiler resolution #48201

Merged
merged 2 commits into from
Feb 12, 2021
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
Original file line number Diff line number Diff line change
Expand Up @@ -70,28 +70,7 @@
<NativeRuntimeAsset Include="$(_diaSymReaderPathIfExists)" TargetPath="tools/" />
</ItemGroup>

<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.SharedFramework.Sdk" />

<Target Name="ResolveReadyToRunCompilers" DependsOnTargets="ResolveRuntimeFilesFromLocalBuild">
<ItemGroup Condition="'$(RuntimeFlavor)' != 'Mono'">
<_crossTargetJit Include="@(CoreCLRCrossTargetFiles)" Condition="'%(FileName)' == '$(LibPrefix)clrjit' and '%(Extension)' == '$(LibSuffix)'" />
<_clrjit Include="@(RuntimeFiles)" Condition="'%(FileName)' == '$(LibPrefix)clrjit' and '%(Extension)' == '$(LibSuffix)'" />
<_crossTargetCrossgen Include="@(CoreCLRCrossTargetFiles)" Condition="'%(FileName)' == 'crossgen' and '%(Extension)' == '$(ExeSuffix)'" />
<_crossgen Include="@(RuntimeFiles)" Condition="'%(FileName)' == 'crossgen' and '%(Extension)' == '$(ExeSuffix)'" />
</ItemGroup>
<ItemGroup Condition="'@(_crossTargetJit)' != '' and '@(_crossTargetCrossgen)' != ''">
<CrossgenTool Include="@(_crossTargetCrossgen->ClearMetadata())"
JitPath="@(_crossTargetJit)"
DiaSymReader="$(_diaSymReaderPathIfExists)" />
</ItemGroup>
<ItemGroup Condition="'@(_crossTargetJit)' == '' and '@(_crossTargetCrossgen)' == ''">
<CrossgenTool Include="@(_crossgen->ClearMetadata())"
JitPath="@(_clrjit)"
DiaSymReader="$(_diaSymReaderPathIfExists)" />
</ItemGroup>
</Target>

<Import Project="ReadyToRun.targets" />

<Target Name="GetFilesToPublish">
<MSBuild Projects="$(MSBuildProjectFullPath)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,25 +140,5 @@
</ItemGroup>
</Target>

<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.SharedFramework.Sdk" />

<Target Name="ResolveReadyToRunCompilers" DependsOnTargets="ResolveRuntimeFilesFromLocalBuild">
<ItemGroup Condition="'$(RuntimeFlavor)' != 'Mono'">
<_crossTargetJit Include="@(CoreCLRCrossTargetFiles)" Condition="'%(FileName)' == '$(LibPrefix)clrjit' and '%(Extension)' == '$(LibSuffix)'" />
<_clrjit Include="@(RuntimeFiles)" Condition="'%(FileName)' == '$(LibPrefix)clrjit' and '%(Extension)' == '$(LibSuffix)'" />
<_crossTargetCrossgen Include="@(CoreCLRCrossTargetFiles)" Condition="'%(FileName)' == 'crossgen' and '%(Extension)' == '$(ExeSuffix)'" />
<_crossgen Include="@(RuntimeFiles)" Condition="'%(FileName)' == 'crossgen' and '%(Extension)' == '$(ExeSuffix)'" />
</ItemGroup>
<ItemGroup Condition="'@(_crossTargetJit)' != '' and '@(_crossTargetCrossgen)' != ''">
<CrossgenTool Include="@(_crossTargetCrossgen->ClearMetadata())"
JitPath="@(_crossTargetJit)"
DiaSymReader="$(_diaSymReaderPathIfExists)" />
</ItemGroup>
<ItemGroup Condition="'@(_crossTargetJit)' == '' and '@(_crossTargetCrossgen)' == ''">
<CrossgenTool Include="@(_crossgen->ClearMetadata())"
JitPath="@(_clrjit)"
DiaSymReader="$(_diaSymReaderPathIfExists)" />
</ItemGroup>
</Target>
<Import Project="ReadyToRun.targets" />
</Project>
23 changes: 23 additions & 0 deletions src/installer/pkg/sfx/Microsoft.NETCore.App/ReadyToRun.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<Project>
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t like these Imports not being in the project files directly. Can we move these imports back to the .sfxproj files?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem, fixed in 2nd commit.

<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.SharedFramework.Sdk" />

<Target Name="ResolveReadyToRunCompilers" DependsOnTargets="ResolveRuntimeFilesFromLocalBuild">
<ItemGroup Condition="'$(RuntimeFlavor)' != 'Mono'">
<_crossTargetJit Include="@(CoreCLRCrossTargetFiles)" Condition="'%(FileName)' == '$(LibPrefix)clrjit' and '%(Extension)' == '$(LibSuffix)'" />
<_clrjit Include="@(RuntimeFiles)" Condition="'%(FileName)' == '$(LibPrefix)clrjit' and '%(Extension)' == '$(LibSuffix)'" />
<_crossTargetCrossgen Include="@(CoreCLRCrossTargetFiles)" Condition="'%(FileName)' == 'crossgen' and '%(Extension)' == '$(ExeSuffix)'" />
<_crossgen Include="@(RuntimeFiles)" Condition="'%(FileName)' == 'crossgen' and '%(Extension)' == '$(ExeSuffix)'" />
</ItemGroup>
<ItemGroup Condition="'@(_crossTargetJit)' != '' and '@(_crossTargetCrossgen)' != ''">
<CrossgenTool Include="@(_crossTargetCrossgen->ClearMetadata())"
JitPath="@(_crossTargetJit)"
DiaSymReader="$(_diaSymReaderPathIfExists)" />
</ItemGroup>
<ItemGroup Condition="'@(_crossTargetJit)' == '' and '@(_crossTargetCrossgen)' == ''">
<CrossgenTool Include="@(_crossgen->ClearMetadata())"
JitPath="@(_clrjit)"
DiaSymReader="$(_diaSymReaderPathIfExists)" />
</ItemGroup>
</Target>
</Project>