There are a few ways to get targets to run. You can use depends or you
could use antcall to call another target. So, if you wanted clean to get
called each time the build file is run you could do this:
<target name="dist" depends="compile">
<!-- Clean everything up -->
<antcall target="clean"/>
<!-- Just because -->
<antcall target="echothis"/>
<mkdir dir="${dist}/lib"/>
<jar jarfile="${dist}/lib/MyProject-${DSTAMP}.jar" basedir="${build}"/>
</target>
This should execute your clean target followed by your echothis target
followed by the other targets based on their depends relationships..
HTH,
-- Kevin
At 01:13 PM 3/28/2001 -0500, you wrote:
>Kevin,
>
> >You never run the clean target.. If you always want clean to run make init
>depend on clean or just run ant clean before you run dist..
>
>I figured out the part about using depend based on the "one of these things is
>not like the other" method. For a target to execute does it always have to be
>part of a depend relationship? The documentation is not clear on this
>requirement.
>
>For example in the attached build.xml I added a target called "EchoThis" which
>does not execute just like the "clean" target. What is the rule about when a
>target gets executed and when it does not?
>
>Thanks for your help. :)
>
>David
>