The way to do this is to create another goal to wrap the goal you are interested in conditioning.
So, if you have a script with this type:
<Target Name="MainTarget"> command - run under a certain condition command - run under a certain condition command - run under a certain condition command - run under a certain condition command - run under a certain condition </Target>
The thing is, you want to keep the need to use the condition statement a whole bunch of times, right?
To solve this problem you can do this:
<Target Name="MainWrapper" DependsOnTargets="EstablishCondition;MainTarget" /> <Target Name="EstablishCondition"> <SomeCustomTask Input="blah"> <Output PropertyName="TestProperty" TaskParameter="value" /> </SomeCustomTask> </Target> <Target Name="MainTarget" Condition="$(TestProperty)='true'"> command command command command command </Target>
Brandon hawbaker
source share