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
Prev Previous commit
Next Next commit
Move AcceptsRuntimeIdentifier logic and exclude test projects
  • Loading branch information
dsplaisted committed Aug 12, 2022
commit 63ae00b1af54cc74a8d1dd7b426e2b783e0d6911
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,6 @@ Copyright (c) .NET Foundation. All rights reserved.

</PropertyGroup>

<!-- Set the AcceptsRuntimeIdentifier property if this project should accept global RuntimeIdentifier and SelfContained
property values from referencing projects. -->
<PropertyGroup Condition="'$(AcceptsRuntimeIdentifier)' == ''">
<AcceptsRuntimeIdentifier Condition="'$(_IsExecutable)' == 'true' Or
'$(RuntimeIdentifier)' != '' Or
'$(RuntimeIdentifiers)' != ''">true</AcceptsRuntimeIdentifier>
</PropertyGroup>

<PropertyGroup Condition="'$(HasRuntimeOutput)' == ''">
<HasRuntimeOutput>$(_IsExecutable)</HasRuntimeOutput>
<_UsingDefaultForHasRuntimeOutput>true</_UsingDefaultForHasRuntimeOutput>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ Copyright (c) .NET Foundation. All rights reserved.
<PredefinedCulturesOnly Condition="'$(PredefinedCulturesOnly)' == '' and '$(InvariantGlobalization)' == 'true'">true</PredefinedCulturesOnly>
</PropertyGroup>

<!-- Set the AcceptsRuntimeIdentifier property if this project should accept global RuntimeIdentifier and SelfContained
property values from referencing projects. -->
<PropertyGroup Condition="'$(AcceptsRuntimeIdentifier)' == '' And '$(IsTestProject)' != 'true'">
<AcceptsRuntimeIdentifier Condition="'$(_IsExecutable)' == 'true' Or
'$(RuntimeIdentifier)' != '' Or
'$(RuntimeIdentifiers)' != ''">true</AcceptsRuntimeIdentifier>
Copy link
Member

Choose a reason for hiding this comment

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

Does this imply that if the project has any RID, we'll flow the RID from the entrypoint? Is that what we want? What if e.g. the entry-point is win11-x64 and the reference is win7-x86? That seems like an OK combination to me . . .

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, we will flow any RID. Most of this is existing logic, ie if RuntimeIdentifier or RuntimeIdentifiers was set in the referenced project, we would have flowed the RID since .NET Core 1.0 I think. The change here is to also flow it if the referenced project is an Exe project, but not if it's a test project.

</PropertyGroup>

<!-- Opt into .NET Core resource-serialization strategy by default when targeting frameworks
that support it by default.
-->
Expand Down