开发者

Is it possible to batch on item metadata?

开发者 https://www.devze.com 2022-12-11 21:48 出处:网络
Given the following MSBuild project file: <Project ToolsVersion=\"3.5\" DefaultTargets=\"DoA\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">

Given the following MSBuild project file:

<Project ToolsVersion="3.5" DefaultTargets="DoA" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  &开发者_Go百科lt;ItemGroup>
    <A Include="1.txt">
      <Define>B=2;C=3</Define>
    </A>
    <A Include="2.txt" />
  </ItemGroup>
  <Target Name="DoA" Inputs="@(A)" Outputs="out\%(A.Filename).csv">
    <Message Text="perl myscript.pl @(A) ???" />
  </Target>
</Project>

What do I need to substitute for the ??? to have the text output be:

perl myscript.pl 1.txt --define B=2 --define C=3
perl myscript.pl 2.txt

?


You can use %(A.Define) but you'd have to change your Define property to:

<Define>--define B=2 --define C=3</Define>

I don't believe it's possible to treat item metadata as an item itself, though it does seem useful in this case.

0

精彩评论

暂无评论...
验证码 换一张
取 消