92 lines
2.8 KiB
XML
92 lines
2.8 KiB
XML
<project name="CS8803_P3" default="dist" basedir=".">
|
|
<description>
|
|
simple example build file
|
|
</description>
|
|
|
|
<!-- set global properties for this build -->
|
|
<property name="build" location="classes" />
|
|
<property name="dist" location="dist" />
|
|
<property name="docs" location="docs" />
|
|
<property name="lib" location="lib" />
|
|
<property name="res" location="res" />
|
|
<property name="project.name" value="CS8803_P3" />
|
|
<property name="src" location="src" />
|
|
<property name="test" location="test" />
|
|
|
|
<path id="build.classpath">
|
|
<fileset dir="${lib}">
|
|
<include name="**/*.jar" />
|
|
</fileset>
|
|
</path>
|
|
|
|
<path id="classpath.test">
|
|
<path refid="build.classpath" />
|
|
<pathelement location="lib/junit-4.10.jar" />
|
|
<pathelement location="${build}" />
|
|
</path>
|
|
|
|
<target name="clean" description="clean up">
|
|
<!-- Delete the ${build} and ${dist} directory trees -->
|
|
<delete dir="${build}" />
|
|
<delete dir="${dist}" />
|
|
</target>
|
|
|
|
<target name="compile" depends="copy-resources">
|
|
<!-- Compile the java code from ${src} into ${build} -->
|
|
<javac srcdir="${src}" destdir="${build}" classpathref="build.classpath" debug="true" source="1.6" target="1.6"/>
|
|
</target>
|
|
|
|
<target name="compile-test" depends="compile">
|
|
<javac srcdir="${test}" destdir="${build}" debug="true">
|
|
<classpath refid="classpath.test"/>
|
|
</javac>
|
|
</target>
|
|
|
|
<target name="copy-resources" depends="init" >
|
|
<copy todir="${build}/res">
|
|
<fileset dir="${res}">
|
|
<include name="**/*" />
|
|
</fileset>
|
|
</copy>
|
|
<copy file="DetailedInfo.txt" todir="${dist}" />
|
|
<copy file="player.txt" todir="${dist}" />
|
|
</target>
|
|
|
|
<target name="dist" depends="copy-resources, compile"
|
|
description="generate the distribution">
|
|
<jar jarfile="${dist}/${project.name}.jar">
|
|
<fileset dir="${build}" excludes="**/*Test.class" />
|
|
<manifest>
|
|
<attribute name="Main-Class" value="dk.itu.mario.engine.Play" />
|
|
</manifest>
|
|
</jar>
|
|
</target>
|
|
|
|
<!-- Creates Javadoc -->
|
|
<target name="docs" depends="compile">
|
|
<javadoc packagenames="src" sourcepath="${src}" destdir="${docs}">
|
|
<!-- Define which files / directory should get included, we include all -->
|
|
<fileset dir="${src}">
|
|
<include name="**" />
|
|
</fileset>
|
|
</javadoc>
|
|
</target>
|
|
|
|
<target name="init">
|
|
<!-- Create the time stamp -->
|
|
<tstamp />
|
|
<!-- Create the build directory structure used by compile -->
|
|
<mkdir dir="${build}" />
|
|
</target>
|
|
|
|
<target name="test" depends="compile-test">
|
|
<junit haltonfailure="true">
|
|
<classpath refid="classpath.test" />
|
|
<formatter type="brief" usefile="false" />
|
|
<batchtest>
|
|
<fileset dir="${build}" includes="**/*Test.class" />
|
|
</batchtest>
|
|
</junit>
|
|
</target>
|
|
</project>
|