Daniel Doubrovkine bio photo

Daniel Doubrovkine

aka dB., CTO at artsy.net, fun at playplay.io, NYC

Email Twitter LinkedIn Github Strava

I never remember how to do this, so here’s a refresher. In MSBuild you can easily define a list with properties and iterate over it.

<Project DefaultTargets="all" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" >
    <Squirrel Include="Bob">
    <Squirrel Include="Marc">
  <Target Name="ShowSquirrels" Inputs="@Squirrel" Outputs="%(Squirrel.Identity)">
    <Message Text="%(Squirrel.Identity) is an %(Squirrel.Color) squirrel with %(Squirrel.Teeth) teeth" />

Run the sample above with msbuild test.proj /t:ShowSquirrels.