ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ray Tayek <>
Subject Re: simple ant and junit fails - solved!
Date Mon, 07 Jan 2002 18:09:41 GMT
At 11:33 PM 1/6/02 -0500, you wrote:
>----- Original Message -----
>From: "Ray Tayek" <>
> > wonderful! (but those classpaths are confusing)
>But Ant will make them easier for you.  Explore "path-like structures" in
>Ant's documentation and learn to define <path>'s and re-use them via

those references look nice. but it is not clear what happens if you have a 
bunch of <classpath...>'s or what there scope is.

i did discover something interesting though (see build.xml below). i was 
able to remove the junit.jar from ant/lib because i had a: 
classpath=".;d:/classpath/junit.jar" in the <javac...> step. and the 
<junit..> step apparently "remembers" this (or something) because it 
worked. but it did not "remember" the "." that was defined in the <javac> 
step, because i needed to add that explicitly with <classpath> in the 
<junit> step. intresting.

this (ant) looks like a big upgrade from make :)


<project name="MyProject" default="dist" basedir=".">
   <property name="src" value="."/>
   <property name="build" value="build"/>
   <property name="dist"  value="dist"/>
   <property name="test"  value="test"/>
   <target name="init">
     <mkdir dir="${build}"/>
   <target name="compile" depends="init">
     <javac srcdir="${src}" destdir="${build}" 
   <target name="test" depends="compile">
     <junit fork="yes" printsummary="on"  haltonfailure="true">
       <pathelement path="."/>
     <test name="MainTest"/>
           <formatter type="brief" usefile="false"/>
   <target name="dist" depends="test">
     <mkdir dir="${dist}/lib"/>
     <jar jarfile="${dist}/lib/MyProject-${DSTAMP}.jar" basedir="${build}"/>
   <target name="clean">
     <delete dir="${build}"/>
     <delete dir="${dist}"/>

ray tayek
orange county java users group
want privacy?
hate spam?

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message