我有这样一个情况,我有一堆绝对路径,我想根据另一个目录使用MSBuild将它们转换为相对路径。以下是我目前的代码:
<PropertyGroup>
<FromPath>$(Bar)</FromPath>
</PropertyGroup>
<ItemGroup>
<AbsolutePaths Include="@(Foo)" Exclude="@(Baz)" />
<PathsRelativeToBar Include="@(AbsolutePaths->'???')" /> <!-- What goes here? -->
</ItemGroup>
希望能得到任何帮助,谢谢!
编辑:我在this StackOverflow问题中找到了一个基于C#的解决方案,但我不确定如何(或是否可能)将其转换为MSBuild。