Means. targetA will run after TargetC.
<Project xmlns="..."> <Target Name="TargetA" AfterTargets="TargetC"> <Message Text="This is Target A" /> </Target> <Target Name="TargetB"> <Message Text="This is Target B" /> </Target> <Target Name="TargetC"> <Message Text="This is Target C" /> </Target> </Project>
This behaviour invokes that, when targetC is ran with /target:C option or through any other option, TargetA will run after that.
But it doesn't mean, C will run before we run A(when A is invoked).That is dependson.
<Project xmlns="..."> <Target Name="TargetA" AfterTargets="TargetC"> <Message Text="This is Target A" /> </Target> <Target Name="TargetB" AfterTargets="TargetC"> <Message Text="This is Target B" /> </Target> <Target Name="TargetC"> <Message Text="This is Target C" /> </Target> </Project>
This will run in order, C A B, hen we invoke C.
<Project xmlns="..."> <Target Name="TargetA" BeforeTargets="TargetC"> <Message Text="This is Target A" /> </Target> <Target Name="TargetB" AfterTargets="TargetC"> <Message Text="This is Target B" /> </Target> <Target Name="TargetC"> <Message Text="This is Target C" /> </Target> </Project>
This means, when C invoked, order: A C B
Indirect invocation can be altered with conditionals.As value is false, C will not be invoked after A.
If it is a string instead of boolean, Condition="$(DoIt) == 'foo'"
No comments:
Post a Comment