beaucrawford.net

Give me data or give me death

About the author

Author Name is someone.
E-mail me Send mail

Recent comments

Don't show

Authors

Tags

Don't show

    Disclaimer

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

    © Copyright 2012

    MSBuild Batching


    I banged my head on this one for a little bit but then finally found the answer here.  You sometimes find yourself in a situation where you would like “batch” items from an ItemGroup.  To do so you simply need to set your Target’s Outputs attribute to contain the identity of the item.  This will execute the entire target once per item in the group.

    Example:

    <ItemGroup>
        <TestItem Include="test A" />
        <TestItem Include="test B" />
        <TestItem Include="test C" />
    </ItemGroup>

    <Target Name="Build" Outputs="%(TestItem.Identity)">
        <Message Text="%(TestItem.Identity)" />
    </Target>

    Enjoy!

    Categories: MSBuild
    Posted by Beau on Thursday, February 12, 2009 11:53 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    Comments