first commit
This commit is contained in:
132
CS2335/2335_lemmings/build.xml
Normal file
132
CS2335/2335_lemmings/build.xml
Normal file
@@ -0,0 +1,132 @@
|
||||
<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" />
|
||||
|
||||
<!-- Paths -->
|
||||
<property name="pmd_path" location="/net/hu15/cs2335/java/pmd/lib" />
|
||||
<property name="checkstyle_path" location="/net/hu15/cs2335/java/checkstyle" />
|
||||
<property name="junit_path" location="/net/hu15/cs2335/java/junit" />
|
||||
|
||||
<path id="pmd.classpath">
|
||||
<fileset dir="${pmd_path}">
|
||||
<include name="*.jar"/>
|
||||
</fileset>
|
||||
</path>
|
||||
|
||||
<path id="checkstyle.classpath">
|
||||
<fileset dir="${checkstyle_path}">
|
||||
<include name="checkstyle-all-3.3.jar" />
|
||||
</fileset>
|
||||
</path>
|
||||
|
||||
<!-- Taskdefs -->
|
||||
<taskdef resource="checkstyletask.properties" classpathref="checkstyle.classpath" />
|
||||
<taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpathref="pmd.classpath" />
|
||||
|
||||
<!-- 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" depends="build" description="Runs the JUnit tests for the program">
|
||||
<junit fork="yes" showoutput="yes">
|
||||
<formatter type="plain" usefile="false"/>
|
||||
|
||||
<classpath>
|
||||
<pathelement location="${classes}" />
|
||||
</classpath>
|
||||
|
||||
<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>
|
||||
Reference in New Issue
Block a user