Command-line Demonstrates
ant simple_compile
  •  javac

Note: must create the build directory first.

ant compile
  • init dependency
  • use of properties
  • run twice to see compile only occurs once
ant jar
  • jar task
  • hierarchical dependency (compile depends on init)
  • exclusion syntax
ant runtests
  • Use of JUnit and <junitreport> task
  • classpath and fileset syntax
  • Multiple dependency
  • Build still successful despite test failure
ant dist
  • zip task
  • Build failure because test fails
ant
  • Default target dist runs; same as 'ant dist'
ant -Ddont.test.dist=true
  • Property setting from command-line
  • junit.fail property override via <antcall>
ant -logfile build.log
  • Standard output suppressed
  • Output directed to specified file
ant -listener org.apache.tools.ant.XmlLogger
  • Use of build listener