Article:
  Top 15 Ant Best Practices
Subject:   The easiest way to implement a "clean" target...
Date:   2003-12-19 02:29:44
From:   anonymous2
... is to produce all of your output (classes, tests...) in a new "build" directory. This way you can just delete this directory to implement your clean target.


To the most extent, you would copy your sources in it, then compile them here, just to make consistent "dist" target if you want to distribute the sources also...


I've seen horrible things in some "clean" targets where the guy tries to identifies all of its project output (some classes here, other there...), while it is so easy to centralise all in a single specific directory, like this for instance :
root
+- src
+- srcTest
+- rsc
+- ant.output <- your output dir !
+- src
+- srcTest
+- src.classes (maybe resources have been copied inside...)
+- srcTest.classes
+- testOutput
+- lib
+- dist


And voila the clean target : <delete dir="ant.output"/>


Just my personal best practice :)

Main Topics Newest First

Showing messages 1 through 1 of 1.

  • The easiest way to implement a "clean" target...
    2003-12-19 02:31:49  anonymous2 [View]

    wow, my display has been trimed, but all below "ant.output" should be indented, you get the idea...