I am looking for a way to tell NAnt not to execute a specified target. I've not found anything online so I'm not hopeful but perhaps the good people of SO can help.
The situation is: we have targets A, B, C, D,
as well as an overall target T
that calls all the others. A
is independent of the others so is not really necessary; consider it a sort of an expensive sanity check.
I want to be able to run T
and but exclude A
- so it would only run B, C, D
.
Is this possible, or do I have to declare a new target to specifically run those jobs?
@NotAgain's answer is useful if the target to be excluded is at the beginning or the end of the chain, but it does involve setting up a new target, or at least editing the existing one.
The best solution I've found so far is to use the conditional logic expressions. Example:
This way you can set up any targets you may wish to exclude and switch them on and off by editing the property or by passing it in as a parameter instead. I assume you can use the
unless
expression just as easily but I haven't tested it.