Don’t use the depends script for everything it is bad form. This is mistake I was doing when I first learned NAnt. Depends has it place, but most times you should use <call> instead of declaring it depends in the target tag. depends should be reserved for use when something has to happen first.
An example of this would be, I have to copy files, but I can’t until I backup my files. You could put the back up call in depends. If you use depends, you lose the ability to call variables in the current task.
How to use <call>:
<!-- Using Depends -->
<target name="task.build" depends="action.build.project, action.copy.to.beta" >
</target>
<!-- Using Call -->
<target name="task.build"> <property name="action.source.dir" value="\\path\to\folder" /> <property name="action.output.dir" value="\\path\to\folder" /> <call target="action.build.project" /> <call target="action.copy.to.beta /></target>
When we use depends, it has to happen before our script runs. Call is more flexible, because you can then scope variables to use with the tasks you are calling, and it does not control the structure of your scripting.












