Add SourceRootMappedPathsFeatureSupported property#26095
Merged
tmat merged 2 commits intodotnet:masterfrom Apr 12, 2018
Merged
Conversation
Member
Author
|
@dotnet/roslyn-compiler Please review. |
Member
Author
|
@nguerrera PTAL |
nguerrera
approved these changes
Apr 11, 2018
cston
approved these changes
Apr 11, 2018
agocke
reviewed
Apr 11, 2018
| Declare that target InitializeSourceRootMappedPaths that populates MappedPaths metadata on SourceRoot items is available. | ||
| --> | ||
| <PropertyGroup> | ||
| <SourceRootMappedPathsFeatureSupported>true</SourceRootMappedPathsFeatureSupported> |
Member
There was a problem hiding this comment.
Do you want to condition on this property not already being set?
Member
Author
There was a problem hiding this comment.
Why? This should be true if the target is present. It isn't meant to be overridable by the project.
Member
Author
There was a problem hiding this comment.
Ideally msbuild would have TargetExists function that one can pass target name to. This is just a workaround for lack of such feature.
Member
Author
There was a problem hiding this comment.
See also https://github.com/Microsoft/msbuild/blob/master/src/Tasks/Microsoft.Common.CurrentVersion.targets#L748 that uses the same pattern.
jaredpar
approved these changes
Apr 11, 2018
Member
Author
|
Approved by Barry. Merging. |
tmat
added a commit
to tmat/roslyn
that referenced
this pull request
Apr 12, 2018
tmat
added a commit
that referenced
this pull request
Apr 13, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Customer scenario
Add a property to
Microsoft.Managed.Core.targetsthat declares that targetInitializeSourceRootMappedPathsis available. This property allows SourceLink package targets to detect whether or not to depend on this target and avoid the dependency if the compiler doesn't support the target (e.g. F# projects, projects using older C# compiler version). Without this property available SourceLink package would fail with with a cryptic build error that doesn't tell the customer anything useful.Bugs this fixes
https://devdiv.visualstudio.com/DevDiv/_workitems/edit/598723
Workarounds, if any
No reasonable workaround.
Risk
Small.
Performance impact
None.
Is this a regression from a previous update?
Root cause analysis
How was the bug found?
SourceLink package testing.
Test documentation updated?