Daniel Doubrovkine bio photo

Daniel Doubrovkine

aka dB., @awscloud, former CTO @artsy, +@vestris, NYC

Email Twitter LinkedIn Github Strava
Creative Commons License

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="https://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.