James Hughes
James Hughes

Reputation: 6194

Visual Studio Post Build Task passing Multiple files

I have an executable file - process.exe - which takes a single file path and does something with that file (no outputs). process.exe isn't capable of accepting wildcard paths e.g. process.exe c:\project\*.ext

What I want to do is select all files of a particular extension in my project (*.xmlt) and pass each one of these files into the process.exe as part of my AfterBuild step.

Upvotes: 1

Views: 156

Answers (1)

Julien Hoarau
Julien Hoarau

Reputation: 49970

You'll have to use batching like this (in your project file):

<PropertyGroup>
  <ProcessExe>process.exe</ProcessExe>
</PropertyGroup>

<Target Name="AfterBuild">
  <ItemGroup>
    <Xmlt Include="**\*.xmlt"/>
  </ItemGroup>

  <Exec Command="$(ProcessExe) %(Xmlt.FullPath)"/>
</Target>

Upvotes: 2

Related Questions