Skip to content

How do I selectively perform certain responses tasks or targets based on item properties #7524

Answered by jrdodds
mwpowellhtx asked this question in Q&A
Discussion options

You must be logged in to vote

It sounds like you are asking about how to do batching.

Here is an example of task batching using your example data:

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <ItemGroup>
        <MySpec Include="Alpha" Type="Module" />
        <MySpec Include="Bravo" Type="Feature" />
        <MySpec Include="Charlie" Type="Feature" />
        <MySpec Include="Delta" Type="Theme" />
        <MySpec Include="Echo">
            <Type>Theme</Type>
        </MySpec>
        <MySpec Include="Foxtrot" Type="SomethingElse" />
    </ItemGroup>

    <Target Name="Test">
        <Message Text="Features:     @(MySpec, ', ')" Condition="%(Type) == 'Feature'"/>
        <Message Text="M…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@mwpowellhtx
Comment options

Answer selected by mwpowellhtx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants