Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Transform an ItemGroup into a Delimited String

My question is almost identical to Create an ItemGroup of strings in MSBuild however the solution offered there still seems to carry over the existing delimiter. Here's a simplified snippet of what I'm attempting to do:

<Target Name="Testing">
  <ItemGroup>
    <Files Include="$(RootDirectory)\*.*"/>
  </ItemGroup>

  <Message Text="@(Files->'%(Filename)%(Extension) ')"/>
</Target>

My desired output is something that looks like this:

file1.cs file2.cs file3.cs

However the snippet above produces the following output

file1.cs ;file2.cs ;file3.cs

What have I done wrong?

like image 778
aolszowka Avatar asked Oct 26 '11 01:10

aolszowka


1 Answers

Try to use MSBuild transforms like this:

    <Message Text="@(Files->'%(Filename)%(Extension)', ' ')"/>
like image 139
Ludwo Avatar answered Sep 19 '22 16:09

Ludwo