b18c6dc7bf
every time. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1178 542714f4-19e9-0310-aa3c-eee0fc999fb1
127 lines
4.5 KiB
XML
127 lines
4.5 KiB
XML
<!-- build configuration -->
|
|
<project name="narya tests" default="compile" basedir=".">
|
|
|
|
<!-- things you may want to change -->
|
|
<property name="build.compiler" value="jikes"/>
|
|
<property name="junit.fork" value="true"/>
|
|
|
|
<!-- we want to access the environment -->
|
|
<property environment="env"/>
|
|
<property name="java.libraries" value="${env.JAVA_LIBS}"/>
|
|
|
|
<!-- 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"/>
|
|
|
|
<property name="cbundle.dir" value="rsrc/bundles/components"/>
|
|
<property name="tbundle.dir" value="rsrc/bundles/tiles"/>
|
|
|
|
<!-- declare our classpath -->
|
|
<path id="classpath">
|
|
<pathelement location="${deploy.dir}/classes"/>
|
|
<pathelement location="../${deploy.dir}/classes"/>
|
|
<fileset dir="../lib" includes="**/*.jar"/>
|
|
<fileset dir="${java.libraries}" includes="**/*.jar"/>
|
|
</path>
|
|
|
|
<!-- generates .java files for all .dobj files -->
|
|
<target name="gendobj">
|
|
<apply executable="../bin/gendobj" failonerror="true">
|
|
<srcfile/>
|
|
<fileset dir="src/java" includes="**/*.dobj"/>
|
|
</apply>
|
|
</target>
|
|
|
|
<!-- prepares the application directories -->
|
|
<target name="prepare" depends="gendobj">
|
|
<mkdir dir="${deploy.dir}"/>
|
|
<mkdir dir="${deploy.dir}/classes"/>
|
|
<copy todir="${deploy.dir}/classes">
|
|
<fileset dir="${src.dir}" includes="**/*.properties"/>
|
|
</copy>
|
|
<copy todir="${deploy.dir}/classes/rsrc">
|
|
<fileset dir="rsrc" includes="**/*"/>
|
|
</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"/>
|
|
</javac>
|
|
</target>
|
|
|
|
<!-- run the tests -->
|
|
<target name="test" depends="compile" description="Run tests.">
|
|
<junit printsummary="no" haltonfailure="yes" fork="${junit.fork}">
|
|
<classpath refid="classpath"/>
|
|
<sysproperty key="test_dir" value="${test.dir}"/>
|
|
<sysproperty key="resource_url" value="file:${test.dir}/rsrc"/>
|
|
<formatter type="brief" usefile="false"/>
|
|
<batchtest>
|
|
<fileset dir="${src.dir}">
|
|
<include name="**/*Test.java"/>
|
|
</fileset>
|
|
</batchtest>
|
|
</junit>
|
|
</target>
|
|
|
|
<!-- test the component metadata bundling process -->
|
|
<target name="cbundles" description="Build component bundles.">
|
|
<!-- define our tasks -->
|
|
<taskdef name="metabundle"
|
|
classname="com.threerings.cast.bundle.tools.MetadataBundlerTask"/>
|
|
<taskdef name="cbundle"
|
|
classname="com.threerings.cast.bundle.tools.ComponentBundlerTask"/>
|
|
|
|
<!-- build the metadata bundles -->
|
|
<metabundle actiondef="${cbundle.dir}/actions.xml"
|
|
classdef="${cbundle.dir}/classes.xml"
|
|
target="${cbundle.dir}/metadata.jar"/>
|
|
|
|
<!-- blow away the components map file so that we get a consistent
|
|
mapping every time-->
|
|
<delete file="${cbundle.dir}/components.map"/>
|
|
|
|
<!-- build the component bundles -->
|
|
<cbundle target="${cbundle.dir}/pirate/components.jar"
|
|
mapfile="${cbundle.dir}/components.map"
|
|
root="${cbundle.dir}/pirate">
|
|
<fileset dir="${cbundle.dir}/pirate" includes="**/*.png"/>
|
|
</cbundle>
|
|
<cbundle target="${cbundle.dir}/vessel/components.jar"
|
|
mapfile="${cbundle.dir}/components.map"
|
|
root="${cbundle.dir}/vessel">
|
|
<fileset dir="${cbundle.dir}/vessel" includes="**/*.png"/>
|
|
</cbundle>
|
|
</target>
|
|
|
|
<!-- test the tileset bundling process -->
|
|
<target name="tsbundles" description="Build tileset bundles.">
|
|
|
|
<!-- blow away the tilesetid map file so that we get a consistent
|
|
mapping every time-->
|
|
<delete file="${tbundle.dir}/tilesets.map"/>
|
|
|
|
<!-- build the tileset bundles -->
|
|
<taskdef name="tilebundle"
|
|
classname="com.threerings.media.tile.bundle.tools.TileSetBundlerTask"/>
|
|
<tilebundle config="${tbundle.dir}/bundler-config.xml"
|
|
mapfile="${tbundle.dir}/tilesets.map"
|
|
bundledef="${tbundle.dir}/ground/bundle.xml"
|
|
target="${tbundle.dir}/ground/bundle.jar"/>
|
|
<tilebundle config="${tbundle.dir}/bundler-config.xml"
|
|
mapfile="${tbundle.dir}/tilesets.map"
|
|
bundledef="${tbundle.dir}/objects/bundle.xml"
|
|
target="${tbundle.dir}/objects/bundle.jar"/>
|
|
</target>
|
|
|
|
</project>
|