I have the following task in my MSBuild script:
<Target Name="ZipStates">
<Message Text="CREATING ZIP FOR %(StateSet.Name)" />
<CreateItem Include="$(StagingArea)\v$(VersionString)\States\%(StateSet.Name)\v$(VersionString)%20%(StateSet.Abbreviation)XTend\**\*.*" >
<Output ItemName="ZipFiles" TaskParameter="Include"/>
</CreateItem>
<MSBuild.Community.Tasks.Zip Files="@(ZipFiles)"
ZipFileName="$(StagingArea)\v$(VersionString)\States\%(StateSet.Name)\v$(VersionString)%(StateSet.Abbreviation).zip" />
</Target>
<ItemGroup>
<StateSet Include="AK">
<Name>Alaska</Name>
<Abbreviation>AK</Abbreviation>
</StateSet>
<StateSet Include="FL">
<Name>Florida</Name>
<Abbreviation>FL</Abbreviation>
</StateSet>
<StateSet Include="LA">
<Name>Louisiana</Name>
<Abbreviation>LA</Abbreviation>
</StateSet>
</ItemGroup>
The output looks like this:
ZipStates: CREATING ZIP FOR Alaska CREATING ZIP FOR Florida CREATING ZIP FOR Louisiana Creating zip file "C:\StagingArea\v5_6_0\States\Alaska\v5_6_0AK.zip".
It seems that when I do a batch in this way each command in the task is executed for every node in the item group batch and then it moves on to the next step. What I end up with is 3 zips that all contain the same files.
Anyone have an idea of how I can do this differently?