Hi all. I am learning ant and encountered these questions: 1. the default target for my build file is "packageing", which package the the class files and produce an executable jar file. ok, but I found in ant manual that we must provide a cleanup target which deletes some dirs : <target name="clean"> <delete dir="${buildDir}" /> <delete dir="${distDir}" /> </target> when running ant again , the clean target doesn't run (I mean , these dirs didnt delete), so can you explain what should I do ? indead, if we delete these dirs, and lost our executable files, so why we provide this target?? 2. Then I have cahenged the default target and put instead of "run target" which invokes the java command on my main class. when running ant , its running the application , but the application terminates in one second. so what??
Tony Yan
Ranch Hand
Joined: Apr 10, 2002
Posts: 170
posted
0
you need to specify the depends attribute in all those targets to build their dependencies. Check Ant Manual for details. The idea is that if your default target is 'clean_up', then make sure it depends on other targets, which then will be run themselves.
Tony Yan<br /> <br />IBM Certified Developer XML and Related Technology<br />Sun Certified Web Component Developer For J2EE Platform<br />Sun Certified Programmer For Java 2 Platform