tags:

views:

33

answers:

1

Given the following MSBuild project file:

<Project ToolsVersion="3.5" DefaultTargets="DoA" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;
  <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

?

+1  A: 

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.

nullptr
That's what I figured...oh, well.
Brian Bassett