Stopping Build Gracefully?
-
Thursday, November 22, 2007 7:31 PMDoes anyone know a way to force finish a build gracefully?
I want to do something like this.
The reason I am doing this is because I am importing a custom target which I cannot alter, but it only needs to be done if the inputs of "CheckTarget" are newer than the outputs. (Only in this case though, normally it should be executed regardless). And I cannot use the inputs and outputs of "Foo" because there are tasks which must be executed.Code BlockTarget Name="Foo">
<Task/>
<Task/><CallTarget Targets="CheckTarget"/>
<CheckProperty OnError="ExitGracefully"/> <--not 100% sure how I'll implement this</Target>
<Target Name="CheckTarget" inputs="xx" outputs="yy"/></Target>
<Target Name="ExitGracefully">...what goes in here? This needs to stop here and continue no furthe</Target>
<Target Name="CustomTargetWhichCantbeChanged" DependsOn="Foo"/>
If it doesn't follow this formual exactly that's fine, as long as it achieves the end goal of exiting the build process without throwing an exception or build error, and doesn't involve changing the target declaration of 'Foo' or altering the custom target in anyway.
Thanks for any help.
All Replies
-
Friday, November 23, 2007 5:27 PMModerator
Can you put the CallTarget inside CheckTarget?
Dan
-
Monday, November 26, 2007 4:21 PM
Would it not work to just put a Condition attribute on the task you're concerned about? If not, make a separate target for the stuff you don't want to execute if your condition fails, and put the Condition on the CallTarget for it.

