257c942745
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5135 542714f4-19e9-0310-aa3c-eee0fc999fb1
294 lines
11 KiB
XML
294 lines
11 KiB
XML
<!-- build configuration -->
|
|
<project name="narya tests" default="compile" basedir=".">
|
|
|
|
<!-- things you may want to change -->
|
|
<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"/>
|
|
|
|
<property name="cbundle.dir" value="rsrc/bundles/components"/>
|
|
<property name="tbundle.dir" value="rsrc/bundles/tiles"/>
|
|
|
|
<!-- declare our classpath -->
|
|
<property name="classes.dir" value="${deploy.dir}/classes"/>
|
|
<property name="narya.classes.dir" value="../${deploy.dir}/classes"/>
|
|
<path id="classpath">
|
|
<pathelement location="${classes.dir}"/>
|
|
<pathelement location="${narya.classes.dir}"/>
|
|
<fileset dir="../${deploy.dir}/lib" includes="**/*.jar"/>
|
|
</path>
|
|
|
|
<!-- generates additional methods for distributed object classes -->
|
|
<target name="gendobj" depends="prepare">
|
|
<taskdef name="dobj"
|
|
classname="com.threerings.presents.tools.GenDObjectTask"
|
|
classpathref="classpath"/>
|
|
<!-- make sure the dobject class files are all compiled -->
|
|
<javac srcdir="src/java" destdir="${classes.dir}"
|
|
debug="on" deprecation="on" source="1.5" target="1.5">
|
|
<classpath refid="classpath"/>
|
|
<include name="**/*Object.java"/>
|
|
</javac>
|
|
<!-- now generate the associated files -->
|
|
<dobj classpathref="classpath">
|
|
<fileset dir="src/java" includes="**/*Object.java"/>
|
|
</dobj>
|
|
</target>
|
|
|
|
<!-- generates marshaller and dispatcher classes for all invocation -->
|
|
<!-- service declarations -->
|
|
<target name="genservice">
|
|
<taskdef name="service" classpathref="classpath"
|
|
classname="com.threerings.presents.tools.GenServiceTask"/>
|
|
<!-- make sure the service class files are all compiled -->
|
|
<javac srcdir="src/java" destdir="${classes.dir}" debug="on"
|
|
deprecation="on" source="1.5" target="1.5">
|
|
<classpath refid="classpath"/>
|
|
<include name="**/*Service.java"/>
|
|
</javac>
|
|
<!-- now generate the associated files -->
|
|
<service header="../lib/SOURCE_HEADER" classpathref="classpath">
|
|
<fileset dir="src/java" includes="**/*Service.java"/>
|
|
</service>
|
|
</target>
|
|
|
|
<!-- generates sender and decoder classes for all invocation -->
|
|
<!-- receiver declarations -->
|
|
<target name="genreceiver">
|
|
<taskdef name="receiver" classpathref="classpath"
|
|
classname="com.threerings.presents.tools.GenReceiverTask"/>
|
|
<!-- make sure the receiver class files are all compiled -->
|
|
<javac srcdir="src/java" destdir="${classes.dir}"
|
|
debug="on" deprecation="on" source="1.5" target="1.5">
|
|
<classpath refid="classpath"/>
|
|
<include name="**/*Receiver.java"/>
|
|
<exclude name="**/InvocationReceiver.java"/>
|
|
</javac>
|
|
<!-- now generate the associated files -->
|
|
<receiver header="../lib/SOURCE_HEADER" classpathref="classpath">
|
|
<fileset dir="src/java" includes="**/*Receiver.java"/>
|
|
</receiver>
|
|
</target>
|
|
|
|
<!-- prepares the application directories -->
|
|
<target name="prepare">
|
|
<mkdir dir="${deploy.dir}"/>
|
|
<mkdir dir="${classes.dir}"/>
|
|
<copy todir="${classes.dir}">
|
|
<fileset dir="${src.dir}" includes="**/*.properties"/>
|
|
</copy>
|
|
<copy todir="${classes.dir}/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="${classes.dir}"
|
|
debug="on" optimize="off" deprecation="on">
|
|
<classpath refid="classpath"/>
|
|
<compilerarg value="-Xlint:unchecked"/>
|
|
</javac>
|
|
</target>
|
|
|
|
<!-- checks whether the abc library needs to be compiled -->
|
|
<target name="check-abclib">
|
|
<condition property="abclib_up_to_date">
|
|
<uptodate targetfile="${deploy.dir}/testslib.abc">
|
|
<srcfiles dir="../lib" includes="*.abc"/>
|
|
<srcfiles dir="../dist" includes="*.abc"/>
|
|
<srcfiles dir="src/as" includes="**/*.as"/>
|
|
</uptodate>
|
|
</condition>
|
|
</target>
|
|
|
|
<!-- builds our Flash (abc) library -->
|
|
<target name="abclib" unless="abclib_up_to_date" depends="check-abclib,prepare"
|
|
description="Build the abc library for tests classes">
|
|
<taskdef name="asc" classname="flex.ant.AscLibTask" classpathref="classpath"/>
|
|
<dirname property="abs.deploy.dir" file="${deploy.dir}/somefile.txt"/>
|
|
<asc as3="true" strict="true" classpathref="classpath"
|
|
outdir="${abs.deploy.dir}" out="testslib">
|
|
<import dir="../dist">
|
|
<include name="builtin.abc"/>
|
|
<include name="thane.abc"/>
|
|
<include name="narya-abc.abc"/>
|
|
</import>
|
|
<filespec dir="src/as">
|
|
<include name="**/*.as"/>
|
|
<exclude name="**/*Main.as"/>
|
|
</filespec>
|
|
</asc>
|
|
</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"
|
|
classpathref="classpath"/>
|
|
<taskdef name="cbundle"
|
|
classname="com.threerings.cast.bundle.tools.ComponentBundlerTask"
|
|
classpathref="classpath"/>
|
|
|
|
<!-- 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 actiondef="${cbundle.dir}/actions.xml"
|
|
target="${cbundle.dir}/pirate/components.jar"
|
|
mapfile="${cbundle.dir}/components.map"
|
|
root="${cbundle.dir}/pirate">
|
|
<fileset dir="${cbundle.dir}/pirate" includes="**/*.png"
|
|
excludes="components/**"/>
|
|
</cbundle>
|
|
<cbundle actiondef="${cbundle.dir}/actions.xml"
|
|
target="${cbundle.dir}/vessel/components.jar"
|
|
mapfile="${cbundle.dir}/components.map"
|
|
root="${cbundle.dir}/vessel">
|
|
<fileset dir="${cbundle.dir}/vessel" includes="**/*.png"
|
|
excludes="components/**"/>
|
|
</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"
|
|
classpathref="classpath"/>
|
|
<tilebundle config="${tbundle.dir}/bundler-config.xml"
|
|
mapfile="${tbundle.dir}/tilesets.map">
|
|
<fileset dir="${tbundle.dir}/ground" includes="**/*.xml"/>
|
|
</tilebundle>
|
|
<tilebundle config="${tbundle.dir}/bundler-config.xml"
|
|
mapfile="${tbundle.dir}/tilesets.map">
|
|
<fileset dir="${tbundle.dir}/objects" includes="**/*.xml"/>
|
|
</tilebundle>
|
|
|
|
<!-- build the fringe configurations -->
|
|
<taskdef name="conffringe"
|
|
classname="com.threerings.miso.tile.tools.CompileFringeConfigurationTask"
|
|
classpathref="classpath"/>
|
|
<conffringe
|
|
tilesetmap="${tbundle.dir}/tilesets.map"
|
|
fringedef="rsrc/config/miso/tile/fringeconf.xml"
|
|
target="rsrc/config/miso/tile/fringeconf.dat"/>
|
|
</target>
|
|
|
|
<!-- run the tests -->
|
|
<target name="test" depends="compile,cbundles,tsbundles"
|
|
description="Run the tests.">
|
|
<junit printsummary="no" haltonfailure="yes" fork="${junit.fork}">
|
|
<classpath refid="classpath"/>
|
|
<sysproperty key="test_dir" value="${test.dir}"/>
|
|
<sysproperty key="resource_dir" value="${test.dir}/rsrc"/>
|
|
<formatter type="brief" usefile="false"/>
|
|
<batchtest>
|
|
<fileset dir="${src.dir}">
|
|
<include name="**/*Test.java"/>
|
|
</fileset>
|
|
</batchtest>
|
|
</junit>
|
|
</target>
|
|
|
|
<!-- checks whether the bureau client needs to be compiled -->
|
|
<target name="bureau-check-thane-client">
|
|
<condition property="thane_client_up_to_date">
|
|
<uptodate targetfile="${deploy.dir}/TestClientMain.abc">
|
|
<srcfiles dir="dist" includes="testslib.abc"/>
|
|
</uptodate>
|
|
</condition>
|
|
</target>
|
|
|
|
<!-- builds the bureau thane test client -->
|
|
<target name="bureau-compile-thane-client"
|
|
unless="thane_client_up_to_date" depends="abclib,bureau-check-thane-client"
|
|
description="Compiles the thane client for testing the bureau library">
|
|
<taskdef name="ascx" classname="flex.ant.AscTask" classpathref="classpath"/>
|
|
<ascx as3="true" strict="true" classpathref="classpath">
|
|
<import dir="..">
|
|
<include name="dist/builtin.abc"/>
|
|
<include name="dist/thane.abc"/>
|
|
<include name="dist/narya-abc.abc"/>
|
|
<include name="tests/dist/testslib.abc"/>
|
|
</import>
|
|
<filespec dir="src/as">
|
|
<include name="com/threerings/bureau/client/TestClientMain.as"/>
|
|
</filespec>
|
|
</ascx>
|
|
<move overwrite="true" file="src/as/com/threerings/bureau/client/TestClientMain.abc" todir="dist"/>
|
|
</target>
|
|
|
|
<target name="bureau-runserver" depends="compile"
|
|
description="Run the bureau test server.">
|
|
<java fork="true" classname="com.threerings.bureau.server.TestServer">
|
|
<classpath refid="classpath"/>
|
|
</java>
|
|
</target>
|
|
|
|
|
|
<target name="bureau-testregistry" depends="compile"
|
|
description="Run the bureau test server and tests the registry.">
|
|
<java fork="true" classname="com.threerings.bureau.server.RegistryTester">
|
|
<classpath refid="classpath"/>
|
|
<sysproperty key="maxAgents" value="10"/>
|
|
<sysproperty key="numBureaus" value="2"/>
|
|
<sysproperty key="maxOps" value="5"/>
|
|
<sysproperty key="createChance" value="70"/>
|
|
<sysproperty key="minDelay" value="1000"/>
|
|
<sysproperty key="maxDelay" value="3000"/>
|
|
<sysproperty key="seed" value="0"/>
|
|
<sysproperty key="clientTarget" value="bureau-run-thane-client"/>
|
|
</java>
|
|
</target>
|
|
|
|
<!-- NOTE: this target is launched by the bureau-runserver target, modelling the way bureaus -->
|
|
<!-- work. As such it is not currently useful on its own -->
|
|
<target name="bureau-runclient" depends="compile"
|
|
description="Run the bureau test client.">
|
|
<java fork="true" classname="com.threerings.bureau.client.TestClient">
|
|
<classpath refid="classpath"/>
|
|
<sysproperty key="serverName" value="${serverName}"/>
|
|
<sysproperty key="serverPort" value="${serverPort}"/>
|
|
<sysproperty key="token" value="${token}"/>
|
|
<sysproperty key="bureauId" value="${bureauId}"/>
|
|
</java>
|
|
</target>
|
|
|
|
<!-- runs the thane test client -->
|
|
<target name="bureau-run-thane-client" depends="bureau-compile-thane-client"
|
|
description="Runs the thane client for testing the bureau library">
|
|
<exec executable="/export/thane/tamarin-central/dist/thane/avmthane">
|
|
<!--arg value="-Dverbose"/-->
|
|
<arg value="../dist/narya-abc.abc"/>
|
|
<arg value="dist/testslib.abc"/>
|
|
<arg value="dist/TestClientMain.abc"/>
|
|
<arg value="--"/>
|
|
<arg value="${token}"/>
|
|
<arg value="${bureauId}"/>
|
|
<arg value="${serverName}"/>
|
|
<arg value="${serverPort}"/>
|
|
</exec>
|
|
</target>
|
|
|
|
</project>
|