I have written the following in build.xml ========================================== <?xml version="1.0" encoding="UTF-8"?> <project name="helloworld" default="compile" basedir="."> <description> Build file for the Hello World application. </description>
<target name="clean" description="Clean up output directories."> <delete dir="classes" /> </target>
<target name="rebuild" depends="clean,compile" description="Cleanly compiles all sources." /> </project>
================================================== But only the default "compile" seems to be working. when i am putting the delete task in compile target it's working fine. which proves target set in default attribute of project is working. what should i do to make all the targets work. i am new to ant and i am using 1.5.4 version. [ February 21, 2006: Message edited by: Bear Bibeault ]
I expect the "rebuild" target to work first which will call targets clean and then compile. But by default only compile is happening. rebuild and clean is not getting called. It is a bit problematic to download and work with 1.6 version from where i run this ant. [ February 21, 2006: Message edited by: subho saha ]
If you do that Ant looks for a file called build.xml, then calls the default target in that build file. It will not call any of the other targets unless you explicitly ask it to. Run Ant with the -help option to see what other option you can run Ant with.