Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
63 lines (57 sloc) 2.47 KB
<project name="clamp" default="compile">
<!-- set global properties for this build -->
<property name="src.java" location="src/java"/>
<property name="src.python" location="src/python"/>
<property name="test.java" location="test/java"/>
<property name="test.python" location="test/python"/>
<property name="build.dir" location="build"/>
<property name="extlibs.dir" location="extlibs"/>
<property name="dist.dir" location="dist"/>
<property name="src.build" value="${build.dir}/src-classes"/>
<property name="test.build" value="${build.dir}/test-classes"/>
<property name="src.jar" value="${build.dir}/clamp-dev.jar"/>
<property name="test.jar" value="${build.dir}/clamp-test.jar"/>
<!-- Jython properties -->
<property name="jython.home" location="../jython/trunk"/>
<property name="jython.jar" value="${jython.home}/dist/jython-dev.jar"/>
<property name="jython.script" value="${jython.home}/dist/bin/jython"/>
<path id="main.classpath">
<pathelement path="${extlibs.dir}/asm-3.1.jar"/>
<pathelement path="${jython.jar}"/>
</path>
<target name="init">
<!-- Create the build directory structure used by compile -->
<mkdir dir="${src.build}"/>
<mkdir dir="${test.build}"/>
<mkdir dir="${dist.dir}"/>
</target>
<target name="compile" depends="init">
<javac srcdir="${src.java}" destdir="${src.build}" debug="on">
<classpath refid="main.classpath"/>
</javac>
<javac srcdir="${test.java}" destdir="${test.build}" debug="on">
<classpath refid="main.classpath"/>
</javac>
<jar destfile="${src.jar}">
<fileset dir="${src.build}"/>
<fileset dir="${src.python}"/>
</jar>
<jar destfile="${test.jar}">
<fileset dir="${test.build}"/>
</jar>
</target>
<target name="test" depends="compile">
<exec executable="${jython.script}">
<env key="CLASSPATH" path="${src.jar}:${test.jar}"/>
<env key="JYTHONPATH" path="${extlibs.dir}/nose-0.10.4.zip"/>
<env key="NOSE_WHERE" value="${src.python}"/>
<arg value="-J-Dpython.cachedir.skip=true"/>
<arg value="-c"/>
<arg value="import nose; nose.main()"/>
</exec>
</target>
<target name="clean" description="clean up" >
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
</target>
</project>