At 10:56 AM 1/28/02 +0100, you wrote:
>junit is not on your CLASSPATH on deadrat (whatever that may be) but
>on Windows and the way you add it in the build file doesn't work:
>
> > <path id="compileClasspath">
> > <pathelement path="/usr/java"/>
> > <pathelement location="junit.jar"/>
> > </path>
>
>Adds the directory /usr/java and the file junit.jar that lives in your
>basedir to the classpath. Make the second one
>
> <pathelement location="/usr/java/junit.jar"/>
>
>and it should work.
great! that made the compile work. now i get:
[ray@k6 junit]$ ant
Buildfile: build.xml
init:
compile:
test:
BUILD FAILED
/home/ray/junit/build.xml:17: Could not create task of type: junit. Common
solutions are to use taskdef to declare your task, or, if this is an
optional task, to put the optional.jar in the lib directory of your ant
installation (ANT_HOME).
Total time: 4 seconds
i do have an optional.jar in the lib directory. there are 3 junit*.xsl
files in there. do i need more?
thanks
<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"/>
<path id="compileClasspath">
<!-- <pathelement path="/usr/java"/> -->
<pathelement location="/usr/java/junit.jar"/>
</path>
<target name="init"> <tstamp/> <mkdir dir="${build}"/> </target>
<target name="compile" depends="init">
<javac srcdir="${src}" destdir="${build}">
<classpath refid="compileClasspath"/>
</javac>
</target>
<target name="test" depends="compile">
<junit fork="yes" printsummary="on" haltonfailure="true">
<classpath> <pathelement path="."/> </classpath>
<test name="MainTest"/>
<formatter type="brief" usefile="false"/>
</junit>
</target>
<target name="dist" depends="test">
<mkdir dir="${dist}/lib"/>
<jar jarfile="${dist}/lib/MyProject-${DSTAMP}.jar" basedir="${build}"/>
</target>
<target name="clean">
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
</project>
---
ray tayek http://home.earthlink.net/~rtayek/
actively seeking telecommuting work
orange county java users group http://www.ocjug.org/
hate spam? http://samspade.org/ssw/
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>