Skip to Main Content
Ant: The Definitive Guide, 2nd Edition
book

Ant: The Definitive Guide, 2nd Edition

by Steve Holzner
April 2005
Intermediate to advanced content levelIntermediate to advanced
336 pages
7h 20m
English
O'Reilly Media, Inc.
Content preview from Ant: The Definitive Guide, 2nd Edition

Running the Build File

That completes the build file that runs the JUnit tests in Project.java. You can see the final version of this file, build.xml in Example 5-1Example 5-1.

Example 5-3. Using Junit ch05/junit/build.xml

<?xml version="1.0" ?> <project default="main"> <property name="message" value="Building the project...." /> <property name="testsOK" value="Tested OK...." /> <property name="src" location="source" /> <property name="output" location="." /> <property name="results" location="results" /> <property name="jars" location="jars" /> <property name="dist" location="user" /> <property name="junit.fork" value="true"/> <target name="main" depends="init, compile, test, compress, deploy"> <echo> ${message} </echo> </target> <target name="init"> <mkdir dir="${output}" /> <mkdir dir="${results}" /> <mkdir dir="${jars}" /> </target> <target name="compile"> <javac srcdir="${src}" destdir="${output}" /> </target> <target name="test" depends="test1, test2, test3, test4, test5, test6"> <echo> ${testsOK} </echo> </target> <target name="test1" depends="compile"> <java fork="true" classname="junit.textui.TestRunner" classpath="${ant.home}/lib/junit.jar;."> <arg value="org.antbook.Project"/> </java> </target> <target name="test2" depends="compile"> <junit printsummary="yes" errorProperty="test.failed" failureProperty="test.failed" fork="${junit.fork}" haltonfailure="yes"> <formatter type="plain"/> <classpath path="."/> <test todir="${results}" name="org.antbook.Project"/> </junit> <fail ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Ant: The Definitive Guide

Ant: The Definitive Guide

Eric M. Burke, Jesse Tilly
Tomcat: The Definitive Guide, 2nd Edition

Tomcat: The Definitive Guide, 2nd Edition

Jason Brittain, Ian F. Darwin
Ant in Action

Ant in Action

Erik Hatcher, Steve Loughran
CMake Cookbook

CMake Cookbook

Radovan Bast, Roberto Di Remigio

Publisher Resources

ISBN: 0596006098Supplemental ContentErrata Page