102 lines
3.0 KiB
XML
102 lines
3.0 KiB
XML
<project name="NetPaint" default="runclient" basedir=".">
|
|
<description>
|
|
Performs different build tasks for the NetText project.
|
|
</description>
|
|
|
|
|
|
<property name="src" location="src" />
|
|
|
|
<property name="classes" location="build" />
|
|
<property name="runClass_server" value="nettext.server.ServerRunner" />
|
|
<property name="runClass_client" value="nettext.client.ClientRunner" />
|
|
|
|
|
|
<!-- 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}" />
|
|
</target>
|
|
|
|
<target name="javadoc" description="Creates JavaDoc for NetText">
|
|
<!-- 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_server}" basedir="${classes}">
|
|
<manifest>
|
|
<attribute name="Built-By" value="${user.name}" />
|
|
|
|
<attribute name="Main-Class" value="${runClass_server}" />
|
|
</manifest>
|
|
</jar>
|
|
|
|
<jar destfile="${jarname_client}" basedir="${classes}">
|
|
<manifest>
|
|
<attribute name="Built-By" value="${user.name}" />
|
|
|
|
<attribute name="Main-Class" value="${runClass_client}" />
|
|
</manifest>
|
|
</jar>
|
|
</target>
|
|
|
|
<target name="runserver" depends="build" description="Start the server">
|
|
<java classname="${runClass_server}" fork="true">
|
|
<classpath>
|
|
<pathelement path="${classes}" />
|
|
</classpath>
|
|
|
|
</java>
|
|
</target>
|
|
|
|
<target name="runclient" depends="build" description="Start the client">
|
|
<java classname="${runClass_client}" 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="all">
|
|
<antcall target="checkstyle" />
|
|
<antcall target="pmd" />
|
|
<antcall target="build" />
|
|
<antcall target="javadoc" />
|
|
</target>
|
|
|
|
<target name="clean">
|
|
<delete dir="${classes}" />
|
|
<delete dir="${docs}" />
|
|
<delete file="${jarname}" />
|
|
<delete file="${checkstyle_logfile}" />
|
|
<delete file="${pmd_logfile}" />
|
|
</target>
|
|
</project>
|