-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Adjust IsTestProject
hacks to not include MTP
#49085
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,9 +93,11 @@ Copyright (c) .NET Foundation. All rights reserved. | |
|
||
Finally, library projects and non-executable projects have awkward interactions here so they are excluded.--> | ||
<PropertyGroup Condition="'$(UseCurrentRuntimeIdentifier)' == ''"> | ||
<!-- This excludes MTP projects, as they are normal console apps --> | ||
<_IsVSTestOnlyTestProject Condition="'$(IsTestProject)' == 'true' AND '$(IsTestingPlatformApplication)' != 'true'">true</_IsVSTestOnlyTestProject> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TODO: Ensure that this is even late enough to read |
||
<UseCurrentRuntimeIdentifier Condition=" | ||
'$(RuntimeIdentifier)' == '' and | ||
'$(_IsExecutable)' == 'true' and '$(IsTestProject)' != 'true' and | ||
'$(_IsExecutable)' == 'true' and '$(_IsVSTestOnlyTestProject)' != 'true' and | ||
'$(IsRidAgnostic)' != 'true' and | ||
( | ||
'$(SelfContained)' == 'true' or | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,6 +97,8 @@ Copyright (c) .NET Foundation. All rights reserved. | |
<_DefaultUserProfileRuntimeStorePath Condition="$([MSBuild]::IsOSPlatform(`Windows`))">$(USERPROFILE)</_DefaultUserProfileRuntimeStorePath> | ||
<_DefaultUserProfileRuntimeStorePath>$([System.IO.Path]::Combine($(_DefaultUserProfileRuntimeStorePath), '.dotnet', 'store'))</_DefaultUserProfileRuntimeStorePath> | ||
<UserProfileRuntimeStorePath Condition="'$(UserProfileRuntimeStorePath)' == ''">$(_DefaultUserProfileRuntimeStorePath)</UserProfileRuntimeStorePath> | ||
<!-- This excludes MTP projects, as they are normal console apps --> | ||
<_IsVSTestOnlyTestProject Condition="'$(IsTestProject)' == 'true' AND '$(IsTestingPlatformApplication)' != 'true'">true</_IsVSTestOnlyTestProject> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nitpick] Consider adding an inline comment explaining the purpose of the new _IsVSTestOnlyTestProject property, clarifying that it excludes MTP projects from test-specific conditions. Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback
Youssef1313 marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like this property is defined multiple times. Can you find a single place to define it? You may need to dig into the evaluation order to figure out the right place to do this. |
||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '6.0'))"> | ||
|
@@ -114,7 +116,7 @@ Copyright (c) .NET Foundation. All rights reserved. | |
<!-- Set the IsRidAgnostic property if this project should NOT accept global RuntimeIdentifier and SelfContained | ||
property values from referencing projects. --> | ||
<PropertyGroup Condition="'$(IsRidAgnostic)' == ''"> | ||
<IsRidAgnostic Condition="('$(_IsExecutable)' == 'true' And '$(IsTestProject)' != 'true') Or | ||
<IsRidAgnostic Condition="('$(_IsExecutable)' == 'true' And '$(_IsVSTestOnlyTestProject)' != 'true') Or | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nitpick] Review and update any nearby inline comments to ensure they accurately reflect the change from IsTestProject to _IsVSTestOnlyTestProject for non-MTP test projects. Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||
'$(RuntimeIdentifier)' != '' Or | ||
'$(RuntimeIdentifiers)' != ''">false</IsRidAgnostic> | ||
<IsRidAgnostic Condition="'$(IsRidAgnostic)' == ''">true</IsRidAgnostic> | ||
|
@@ -1355,14 +1357,14 @@ Copyright (c) .NET Foundation. All rights reserved. | |
<ShouldBeValidatedAsExecutableReference>false</ShouldBeValidatedAsExecutableReference> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(IsTestProject)' == 'true' And '$(ValidateExecutableReferencesMatchSelfContained)' == ''"> | ||
<PropertyGroup Condition="'$(_IsVSTestOnlyTestProject)' == 'true' And '$(ValidateExecutableReferencesMatchSelfContained)' == ''"> | ||
<!-- Don't generate an error if a test project references a self-contained Exe. Test projects | ||
use an OutputType of Exe but will usually call APIs in a referenced Exe rather than try | ||
to run it. --> | ||
<ValidateExecutableReferencesMatchSelfContained>false</ValidateExecutableReferencesMatchSelfContained> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(IsTestProject)' == 'true'"> | ||
<PropertyGroup Condition="'$(_IsVSTestOnlyTestProject)' == 'true'"> | ||
<!-- Don't generate an error if an Exe project references a test project. --> | ||
<ShouldBeValidatedAsExecutableReference>false</ShouldBeValidatedAsExecutableReference> | ||
</PropertyGroup> | ||
|
Uh oh!
There was an error while loading. Please reload this page.