[MSBuild] Nested loops in MSBuild

  <Target Name="t">
    <ItemGroup>
      <item Include="1;22"/>
    </ItemGroup>
    <Message Text="foreach:@(item)" />
    <MSBuild Projects="$(MSBuildProjectFile)" Targets="tt" Properties="t=%(item.Identity)" />
  </Target>

  <Target Name="tt">
    <ItemGroup>
      <item Include="a;bb;ccc"/>
    </ItemGroup>
    <Message Text="t=$(t  ), foreach:@(item)" />
    <MSBuild Projects="$(MSBuildProjectFile)" Targets="ttt" Properties="t=$(t); tt=%(item.Identity)" />
  </Target>

  <Target Name="ttt">
    <Message Text="t:$(t) tt:$(tt)" />
 </Target>
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: