Files
lightspeed/build.xml
T

89 lines
2.7 KiB
XML

<project name="Lightspeed" default="jar" basedir=".">
<description>
Standard Lightspeed Build File
</description>
<!-- set global properties for this build -->
<property name="src" location="${opdir}/src"/>
<property name="test" location="${opdir}/test"/>
<property name="bin" location="${opdir}/bin"/>
<property name="lib" location="${opdir}/lib"/>
<property name="dist" location="${bin}/dist"/>
<property name="jar" location="${dist}/ProjectSWG.jar"/>
<path id="ant.path">
<fileset dir="lib/ant/">
<include name="*.jar" />
</fileset>
<pathelement location="junit-4.12.jar"/>
</path>
<taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask" classpathref="ant.path" />
<target name="init">
<!-- Create the bin directory structure used by compile -->
<mkdir dir="${bin}"/>
</target>
<target name="compile" depends="init" description="Compile the sources">
<path id="classpath">
<pathelement path="${classpath}"/>
<fileset dir="${lib}">
<include name="**/*.jar"/>
</fileset>
</path>
<!-- Compile sources -->
<javac srcdir="${src}" destdir="${bin}" includeantruntime="true" fork="true" debug="true">
<classpath refid="classpath" />
</javac>
<!-- Compile tests -->
<javac srcdir="${test}" destdir="${bin}" includeantruntime="true" fork="true" debug="true">
<classpath refid="classpath" />
</javac>
</target>
<target name="test" depends="compile" description="Test">
<junit printsummary="yes" haltonfailure="no" includeantruntime="true" fork="true" dir="${opdir}">
<classpath>
<pathelement location="${bin}" />
<pathelement location="hamcrest-core-1.3.jar" />
<pathelement location="junit-4.12.jar" />
<fileset dir="${lib}">
<include name="**/*.jar"/>
</fileset>
</classpath>
<test name="main.TestAll" haltonfailure="no">
</test>
</junit>
</target>
<target name="jar" depends="compile" description="Create the JAR">
<!-- Create the distribution directory -->
<delete dir="${dist}" />
<mkdir dir="${dist}"/>
<!-- Create the classpath -->
<path id="classpath">
<pathelement location="${bin}" />
<fileset dir="${lib}">
<include name="**/*.jar"/>
</fileset>
</path>
<!-- Create the JAR -->
<manifestclasspath property="manifest.classpath" jarfile="${jar}">
<classpath refid="classpath" />
</manifestclasspath>
<jar jarfile="${jar}">
<fileset dir="${bin}" includes="**/*.class" />
<manifest>
<attribute name="Main-Class" value="main.ProjectSWG"/>
<attribute name="Class-Path" value="${manifest.classpath}"/>
</manifest>
</jar>
</target>
<target name="clean" description="Clean up">
<!-- Delete the ${bin} directory -->
<delete dir="${dist}"/>
<delete dir="${bin}"/>
</target>
</project>