Simple ant build script that supports src/ and test/?

Posted by M-x on Stack Overflow See other posts from Stack Overflow or by M-x
Published on 2011-01-15T21:17:40Z Indexed on 2011/01/15 21:53 UTC
Read the original article Hit count: 167

Filed under:

Currently I use an IDE for all my builds and unit tests. Now I have a need to use ant. I found a few simple ant build.xml scripts but they didn't support a separate Junit test/ dir. My projects are structured as follows:

src/
  com/foo/
  com/bar/

test/ -- Mirror of src/, with all *Test.java files.
  com/foo/ 
  com/bar/

lib/  -- All Java libs, including junit 4.

How can a construct a small ant script that builds my src/ and test/ Java classes then runs all my JUnit tests?

© Stack Overflow or respective owner

Related posts about ant