I've got an <ItemGroup />
in MSBuild that contains a list of files. I know that you can apply a tranform to the item group when executing tasks, but I'd like to pre-transform the group into another group...an example will probabbly make it more clear.
<ItemGroup>
<File Include="One.cs" />
<File Include="Two.cs" />
</ItemGroup>
If I wanted to some sort of copy opperation I could do this:
<Copy SourceFiles="@(File)"
DestinationFiles="@(File -> '%Filename''.out')"
/>
Which results in two files called One.out and Two.out being created. What I'd like to do is transform the File
group to an OutputFile
group using the transform.
<ItemGroup>
<OutputFile Include="@(File->'%Filename''.out')" />
</ItemGroup>
I've tried the above syntax, but it doesn't actually perform a transform. Instead the @(OutputFile) group contains the text "@(File->'%Filename''.out')".
Has anyone else tried to do this? What syntax would I use to get the desired output group?