d79766f9f5
by the tests build file. Added a call to build the tests to the standard dist call to discourage test rot. Modified build process to copy library dependencies into dist/lib during build so that dist/ contains all build dependencies and build results at the end of the build. git-svn-id: https://samskivert.googlecode.com/svn/trunk@1925 6335cc39-0255-0410-8fd6-9bcaacd3b74c
81 lines
3.0 KiB
XML
81 lines
3.0 KiB
XML
<!-- build configuration -->
|
|
<project name="samskivert tests" default="test" basedir=".">
|
|
|
|
<!-- we need to do this to avoid conflicts with the XML jar files loaded -->
|
|
<!-- to run ant versus the XML jar files we load for our tests -->
|
|
<property name="junit.fork" value="true"/>
|
|
|
|
<!-- things you probably don't want to change -->
|
|
<property name="test.dir" value="."/>
|
|
<property name="src.dir" value="src/java"/>
|
|
<property name="deploy.dir" value="dist"/>
|
|
|
|
<!-- declare our classpath -->
|
|
<path id="classpath">
|
|
<pathelement location="../${deploy.dir}/classes"/>
|
|
<pathelement location="${deploy.dir}/classes"/>
|
|
<fileset dir="../${deploy.dir}/lib" includes="*.jar"/>
|
|
<fileset dir="${deploy.dir}/lib" includes="*.jar"/>
|
|
</path>
|
|
|
|
<!-- import some targets to check dependency availability -->
|
|
<import file="../depends-incl.xml"/>
|
|
|
|
<!-- prepares the application directories -->
|
|
<target name="prepare">
|
|
<mkdir dir="${deploy.dir}"/>
|
|
<mkdir dir="${deploy.dir}/lib"/>
|
|
<mkdir dir="${deploy.dir}/classes"/>
|
|
<copy todir="${deploy.dir}/classes">
|
|
<fileset dir="${src.dir}" includes="**/*.properties"/>
|
|
</copy>
|
|
<mkdir dir="${deploy.dir}/classes/rsrc"/>
|
|
<copy todir="${deploy.dir}/classes/rsrc">
|
|
<fileset dir="rsrc" includes="**/*"/>
|
|
</copy>
|
|
<copy todir="${deploy.dir}/lib">
|
|
<fileset dir="lib" includes="**/*.jar"/>
|
|
</copy>
|
|
</target>
|
|
|
|
<!-- cleans out the installed application -->
|
|
<target name="clean">
|
|
<delete dir="${deploy.dir}"/>
|
|
</target>
|
|
|
|
<!-- build the java class files -->
|
|
<target name="compile" depends="prepare">
|
|
<javac srcdir="${src.dir}" destdir="${deploy.dir}/classes"
|
|
debug="on" optimize="off" deprecation="off">
|
|
<classpath refid="classpath"/>
|
|
<exclude name="com/samskivert/io/**" unless="build.io"/>
|
|
<exclude name="com/samskivert/jdbc/**" unless="build.jdbc"/>
|
|
<exclude name="com/samskivert/jdbc/depot/**" unless="build.depot"/>
|
|
<exclude name="com/samskivert/net/**" unless="build.net"/>
|
|
<exclude name="com/samskivert/servlet/**" unless="build.servlet"/>
|
|
<exclude name="com/samskivert/swing/**" unless="build.swing"/>
|
|
<exclude name="com/samskivert/test/**" unless="build.test"/>
|
|
<exclude name="com/samskivert/util/**" unless="build.util"/>
|
|
<exclude name="com/samskivert/velocity/**" unless="build.velocity"/>
|
|
<exclude name="com/samskivert/xml/**" unless="build.xml"/>
|
|
</javac>
|
|
</target>
|
|
|
|
<!-- run the tests -->
|
|
<target name="test" depends="compile" description="Run tests.">
|
|
<taskdef name="unit" classpathref="classpath"
|
|
classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"/>
|
|
<unit printsummary="no" haltonfailure="yes" fork="${junit.fork}">
|
|
<classpath refid="classpath"/>
|
|
<sysproperty key="test_dir" value="${test.dir}"/>
|
|
<formatter type="brief" usefile="false"/>
|
|
<batchtest>
|
|
<fileset dir="${src.dir}">
|
|
<include name="**/*Test.java"/>
|
|
</fileset>
|
|
</batchtest>
|
|
</unit>
|
|
</target>
|
|
|
|
</project>
|