Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 127 lines (104 sloc) 4.37 KB
<?xml version="1.0" encoding="UTF-8"?>
<project name="SketchChair" basedir="." default="build">
<!-- Hook into One-Jar project -->
<available property="one-jar.dir" file="../one-jar/build.onejar.xml" value="../one-jar"/>
<!-- Will be ignored if available above -->
<property name="one-jar.dir" location="one-jar" />
<import file="${one-jar.dir}/build.onejar.xml"/>
<property name="eclipse.jar-in-jar.dir" value="build-lib/eclipse"/>
<property name="temp.dir" value="temp" />
<path id="libraries">
<fileset dir="lib" includes="*.jar"/>
</path>
<target name="mkdirs">
<mkdir dir="${test.results.dir}" />
<mkdir dir="${test.reports.dir}"/>
<mkdir dir="classes/src"/>
<mkdir dir="classes/test"/>
<mkdir dir="classes/junit"/>
<mkdir dir="build"/>
</target>
<target name="build" depends="clean, mkdirs, compile, build.SketchChair" />
<target name="clean">
<delete dir="classes" />
</target>
<target name="distclean" depends="clean" description="clean distribution">
<delete dir="build"/>
<delete dir="test-reports"/>
<delete dir="test-results"/>
</target>
<target name="compile" depends="mkdirs">
<javac destdir="classes/src" includes="**/*.java" debug="true" verbose="true" target="1.5">
<src path="src" />
<exclude name="**/processingjs/**" />
<classpath refid="libraries" />
<classpath refid="one-jar.libraries"/>
<classpath path="${one-jar.ant.jar}"/>
</javac>
</target>
<!-- Build the One-Jar -->
<target name="build.SketchChair">
<mkdir dir="build"/>
<one-jar destfile="build/SketchChair.jar">
<manifest>
<attribute name="Main-Class" value="OneJar"/>
<attribute name="One-Jar-Main-Class" value="main.main"/>
</manifest>
<main>
<fileset dir="classes/src">
<exclude name="**/processingjs/**" />
</fileset>
</main>
<lib>
<fileset dir="lib" includes="*.jar">
<exclude name="**/processingjs/**" />
</fileset>
</lib>
<fileset dir="data"/>
<binlib>
<fileset dir="binlib" includes="**" />
</binlib>
</one-jar>
<one-jar destfile="build/test-SketchChair.jar">
<manifest>
<attribute name="Main-Class" value="cc.sketchchair.Boot"/>
<attribute name="One-Jar-Main-Class" value="cc.sketchchair.test.Test"/>
</manifest>
<zipfileset src="${one-jar.ant.jar}" includes="**/Testable.class"/>
<main>
<fileset dir="classes/test"/>
</main>
<lib>
<fileset dir="lib" includes="*.jar" />
</lib>
</one-jar>
<delete dir="${temp.dir}" />
</target>
<property name="formatter" value="xml" />
<!-- Test the distribution -->
<target name="junit.report.SketchChair" depends="build" description="JUnit test of SketchChair">
<antcall target="junit.SketchChair" />
<antcall target="junit.report"/>
</target>
<target name="junit.SketchChair" depends="build">
<echo>********** junit-SketchChair.jar</echo>
<junit fork="yes" showoutput="no" printsummary="yes">
<jvmarg value="-Done-jar.verbose=true" />
<jvmarg value="-Done-jar.jarname=${basedir}/build/test-SketchChair.jar" />
<classpath>
<fileset file="${basedir}/build/test-SketchChair.jar" />
<path refid="one-jar.libraries"/>
<path location="classes/junit" />
</classpath>
<!-- Uses Invoker to set up a JUnit test bridge -->
<test name="cc.sketchchair.test.SketchChairSuite" todir="${test.results.dir}" outfile="SketchChairSuite" />
<formatter type="${formatter}" usefile="yes" />
</junit>
</target>
<target name="run.SketchChair" depends="build" description="Run a One-Jar SketchChair">
<java fork="true" jar="build/SketchChair.jar"/>
</target>
<target name="test.SketchChair" depends="build" description="Stand-alone test a One-Jar SketchChair">
<java fork="true" jar="build/test-SketchChair.jar"/>
</target>
</project>