-
Notifications
You must be signed in to change notification settings - Fork 229
Add extra parameter to get nearest #3913
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 |
|---|---|---|
|
|
@@ -1883,16 +1883,30 @@ Copyright (C) Microsoft Corporation. All rights reserved. | |
|
|
||
| <!-- For each reference, get closest match --> | ||
|
|
||
| <!-- Pass the CurrentProjectTargetPlatform parameter to the task only if GetReferenceNearestTargetFrameworkTaskSupportsTargetPlatformParameter is true. This means | ||
| <!-- Pass the CurrentProjectTargetFrameworkProperty parameter to the task only if GetReferenceNearestTargetFrameworkTaskSupportsTargetFrameworkPropertyParameter is true. This means | ||
| that we are using a version of NuGet which supports that parameter on this task. --> | ||
|
|
||
| <GetReferenceNearestTargetFrameworkTask AnnotatedProjectReferences="@(_ProjectReferenceTargetFrameworkPossibilities)" | ||
| CurrentProjectTargetFramework="$(ReferringTargetFrameworkForProjectReferences)" | ||
| CurrentProjectTargetPlatform="$(TargetPlatformMoniker)" | ||
| CurrentProjectTargetFrameworkProperty="$(TargetFramework)" | ||
| CurrentProjectName="$(MSBuildProjectName)" | ||
| FallbackTargetFrameworks="$(AssetTargetFallback)" | ||
| Condition="'@(_ProjectReferenceTargetFrameworkPossibilities)' != '' and '$(ReferringTargetFrameworkForProjectReferences)' != '' | ||
| And '$(GetReferenceNearestTargetFrameworkTaskSupportsTargetPlatformParameter)' == 'true' and '%(_ProjectReferenceTargetFrameworkPossibilities.IsVcxOrNativeProj)' != 'true'"> | ||
| And '$(GetReferenceNearestTargetFrameworkTaskSupportsTargetFrameworkPropertyParameter)' == 'true' and '%(_ProjectReferenceTargetFrameworkPossibilities.IsVcxOrNativeProj)' != 'true'"> | ||
| <Output ItemName="AnnotatedProjects" TaskParameter="AssignedProjects" /> | ||
| </GetReferenceNearestTargetFrameworkTask> | ||
|
|
||
| <!-- Pass the CurrentProjectTargetPlatform parameter to the task only if GetReferenceNearestTargetFrameworkTaskSupportsTargetPlatformParameter is true and GetReferenceNearestTargetFrameworkTaskSupportsTargetFrameworkPropertyParameter is not true. This means | ||
|
||
| that we are using a version of NuGet which supports that parameter on this task. --> | ||
|
|
||
| <GetReferenceNearestTargetFrameworkTask AnnotatedProjectReferences="@(_ProjectReferenceTargetFrameworkPossibilities)" | ||
| CurrentProjectTargetFramework="$(ReferringTargetFrameworkForProjectReferences)" | ||
| CurrentProjectTargetPlatform="$(TargetPlatformMoniker)" | ||
| CurrentProjectName="$(MSBuildProjectName)" | ||
| FallbackTargetFrameworks="$(AssetTargetFallback)" | ||
| Condition="'@(_ProjectReferenceTargetFrameworkPossibilities)' != '' and '$(ReferringTargetFrameworkForProjectReferences)' != '' | ||
| And '$(GetReferenceNearestTargetFrameworkTaskSupportsTargetPlatformParameter)' == 'true' and '$(GetReferenceNearestTargetFrameworkTaskSupportsTargetFrameworkPropertyParameter)' != 'true' and '%(_ProjectReferenceTargetFrameworkPossibilities.IsVcxOrNativeProj)' != 'true'"> | ||
| <Output ItemName="AnnotatedProjects" TaskParameter="AssignedProjects" /> | ||
| </GetReferenceNearestTargetFrameworkTask> | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new parameter is only added to the first task invocation (lines 1889-1898) but not to the fallback invocation (lines 1903-1911). While this appears intentional for backward compatibility, there's duplicate task logic that could be error-prone during future maintenance. Consider adding a comment explaining why this parameter is omitted in the second invocation.