111 lines
3.4 KiB
XML
111 lines
3.4 KiB
XML
<project name="NetPaint" default="jar" basedir=".">
|
|
<description>
|
|
Performs different build tasks for the Lemmings project.
|
|
</description>
|
|
|
|
<!-- Global Properties -->
|
|
<property name="user.name" location="Vladimir Urazov" />
|
|
<property name="src" location="src" />
|
|
<property name="docs" location="apidoc" />
|
|
<property name="doc_packages" value="edu.gatech.cs2335.lemmings.*" />
|
|
<property name="classes" location="build" />
|
|
<property name="libs" location="lib" />
|
|
<property name="jarname" value="Lem.jar" />
|
|
<property name="runClass" value="edu.gatech.cs2335.lemmings.engine.ProgramRunner" />
|
|
<property name="checkstyle_logfile" value="checkstyle_log.txt" />
|
|
<property name="pmd_logfile" value="pmd_log.html" />
|
|
<property name="pmd_rules" value="rulesets/basic.xml,rulesets/unusedcode.xml,rulesets/design.xml,rulesets/imports.xml" />
|
|
|
|
<!-- Taskdefs -->
|
|
|
|
|
|
<!-- Targets -->
|
|
<target name="init">
|
|
<!-- Create the time stamp -->
|
|
<tstamp />
|
|
</target>
|
|
|
|
<target name="build" depends="init" description="Compiles the program">
|
|
<!-- Make sure the necessary directory structure exists -->
|
|
<mkdir dir="${classes}" />
|
|
|
|
<!-- Compile -->
|
|
<javac srcdir="${src}" destdir="${classes}" />
|
|
|
|
<!-- Copy Resources -->
|
|
<copy todir="${classes}/edu/gatech/cs2335/lemmings/graphics">
|
|
<fileset dir="images"/>
|
|
<fileset file="resources.txt"/>
|
|
</copy>
|
|
</target>
|
|
|
|
<target name="javadoc" description="Runs javadoc on all of the source files">
|
|
<!-- Make sure the necessary directory structure exists -->
|
|
<mkdir dir="${docs}" />
|
|
|
|
<!-- Generate comments -->
|
|
<javadoc packagenames="${doc_packages}" sourcepath="${src}" destdir="${docs}" />
|
|
</target>
|
|
|
|
<target name="jar" depends="build" description="Package the compiled classes into a JAR file.">
|
|
<jar destfile="${jarname}" basedir="${classes}">
|
|
<manifest>
|
|
<attribute name="Built-By" value="${user.name}" />
|
|
<attribute name="Main-Class" value="${runClass}" />
|
|
</manifest>
|
|
</jar>
|
|
</target>
|
|
|
|
<target name="run" depends="build" description="Runs the program">
|
|
<java classname="${runClass}" fork="true">
|
|
<classpath>
|
|
<pathelement path="${classes}" />
|
|
</classpath>
|
|
</java>
|
|
</target>
|
|
|
|
<target name="checkstyle" description="Checks all of the source code with Checkstyle.">
|
|
<checkstyle config="${checkstyle_path}/docs/sun_checks.xml" failOnViolation="false">
|
|
<fileset dir="${src}" includes="**/*.java" />
|
|
|
|
<formatter type="plain" toFile="${checkstyle_logfile}" />
|
|
</checkstyle>
|
|
</target>
|
|
|
|
<target name="pmd" description="Run PMD against all source code files.">
|
|
<pmd rulesetfiles="${pmd_rules}">
|
|
<fileset dir="${src}" includes="**/*.java" />
|
|
|
|
<formatter type="html" toFile="${pmd_logfile}" />
|
|
</pmd>
|
|
</target>
|
|
|
|
<target name="junit" description="Runs the JUnit tests for the program">
|
|
<junit fork="yes">
|
|
<formatter type="plain" />
|
|
|
|
<batchtest>
|
|
<fileset dir="${src}">
|
|
<include name="**/*Test*.java" />
|
|
</fileset>
|
|
</batchtest>
|
|
</junit>
|
|
</target>
|
|
|
|
<target name="all">
|
|
<antcall target="checkstyle" />
|
|
<antcall target="pmd" />
|
|
<antcall target="javadoc" />
|
|
<antcall target="build" />
|
|
<antcall target="jar" />
|
|
</target>
|
|
|
|
<target name="clean">
|
|
<delete dir="${classes}" />
|
|
<delete dir="${docs}" />
|
|
<delete file="${jarname}" />
|
|
<delete file="${checkstyle_logfile}" />
|
|
<delete file="${pmd_logfile}" />
|
|
</target>
|
|
</project>
|