views:

22

answers:

1

I have list of items like this:

<ItemGroup>
    <ToCompile Include="clojure\core.clj;clojure\set.clj;clojure\zip.clj;clojure\test\junit.clj;"/>
</ItemGroup>

And I want to transform that to a list of items like this:

clojure.core clojure.set clojure.zip clojure.test.junit

Is there a way to do this with MSBuild transforms? I tried but I can only get at the file name; the extension and the root path, and I can change the separator. But not the path separators.

If not, any other solution that avoids using custom tasks is appreciated.

+1  A: 

This is a bit cheesy, but it works in MSBuild 4.0+.

<Target Name="Namespaces">
  <PropertyGroup>
    <Cheesy>@(ToCompile -> '%(relativedir)%(filename)', ' ')</Cheesy>
  </PropertyGroup>
  <Message Text="$(Cheesy.Replace(`\`, `.`))" />
</Target>
nullptr