-
Notifications
You must be signed in to change notification settings - Fork 1
/
Directory.Build.targets
29 lines (24 loc) · 1.38 KB
/
Directory.Build.targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<Project>
<!-- temporary until https://github.com/dotnet/fsharp/pull/11921 implemented -->
<Target Name="_SetPathMapFromSourceRoots"
DependsOnTargets="InitializeSourceRootMappedPaths"
BeforeTargets="CoreCompile"
Condition="'$(DeterministicSourcePaths)' == 'true'">
<ItemGroup>
<_TopLevelSourceRoot Include="@(SourceRoot)" Condition="'%(SourceRoot.NestedRoot)' == ''">
<EscapedKey>$([MSBuild]::ValueOrDefault('%(Identity)', '').Replace(',', ',,').Replace('=', '=='))</EscapedKey>
<EscapedValue>$([MSBuild]::ValueOrDefault('%(MappedPath)', '').Replace(',', ',,').Replace('=', '=='))</EscapedValue>
</_TopLevelSourceRoot>
</ItemGroup>
<PropertyGroup Condition="'@(_TopLevelSourceRoot)' != ''">
<!--
Prepend the SourceRoot.MappedPath values to PathMap, if it already has a value.
For each emitted source path the compiler applies the first mapping that matches the path.
PathMap values set previously will thus only be applied if the mapping provided by
SourceRoot.MappedPath doesn't match. Since SourceRoot.MappedPath is also used by SourceLink
preferring it over manually set PathMap ensures that PathMap is consistent with SourceLink.
-->
<PathMap>@(_TopLevelSourceRoot->'%(EscapedKey)=%(EscapedValue)', ','),$(PathMap)</PathMap>
</PropertyGroup>
</Target>
</Project>