Page MenuHomePhabricator (Chris)

build.xml
No OneTemporary

Authored By
Unknown
Size
8 KB
Referenced Files
None
Subscribers
None

build.xml

<?xml version="1.0"?>
<!-- ===================================================================
Build file for TaxCalculator Application
Notes:
This is a build file for use with the Jakarta Ant build tool.
Prerequisites:
jakarta-ant from http://jakarta.apache.org
Build Instructions:
To build, run
java org.apache.tools.ant.Main <target>
on the directory where this file is located with the target you want.
Most useful targets:
- compile -> creates the classes in "./build/classes"
- javadocs -> creates the javadocs in "./build/doc/api"
- tests -> runs the junit tests
- jar -> creates the jars in "./build/lib"
Authors Jens Dietrich <j.b.dietrich@massey.ac.nz>
==================================================================== -->
<project default="all" basedir=".">
<property name="name" value="taxcalculator"/>
<property name="version" value="1.2"/>
<property name="version_suffix" value="1_2"/>
<property name="debug" value="on"/>
<property name="src.dir" value="src"/>
<property name="classes.dir" value="classes"/>
<property name="docs.dir" value="docs"/>
<property name="lib.dir" value="lib"/>
<property name="config.dir" value="config"/>
<property name="build.dir" value="build"/>
<property name="build.classes" value="${build.dir}/classes"/>
<property name="build.lib" value="${build.dir}/lib"/>
<property name="build.jar" value="${build.lib}/${name}-${version}.jar"/>
<property name="build.test.jar" value="${build.lib}/${name}-tests-${version}.jar"/>
<property name="build.tests.jar" value="${build.lib}/${name}-testsuite-${version}.jar"/>
<property name="build.docs" value="${build.dir}/docs"/>
<property name="build.docs.api" value="${build.docs}/api"/>
<property name="build.tmp" value="${build.dir}/tmp"/>
<property name="qa.dir" value="${build.dir}/qa-reports"/>
<property name="main.class.swing" value="nz.ac.massey.cs.sdc.taxcalculator.ui.TaxCalculatorUI"/>
<!-- =================================================================== -->
<!-- Set up build class path - consists of all libraries in the lib folder -->
<!-- =================================================================== -->
<path id="build.classpath">
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
</path>
<!-- =================================================================== -->
<!-- Main target: compile, jar,test and build java docs -->
<!-- =================================================================== -->
<target name="all" description="Main target - compile, jar, docs and test" depends="jar,tests,dependencyanalysis">
<echo>Build finished !</echo>
</target>
<!-- =================================================================== -->
<!-- Prepares the build directory -->
<!-- =================================================================== -->
<target name="prepare">
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.classes}"/>
<mkdir dir="${build.lib}"/>
<mkdir dir="${qa.dir}"/>
</target>
<!-- =================================================================== -->
<!-- Compiles the source directory -->
<!-- =================================================================== -->
<target name="compile" depends="prepare" description="Compile the whole project">
<javac destdir="${build.classes}"
debug="${debug}"
deprecation="on"
optimize="off"
srcdir="${src.dir}"
classpathref="build.classpath"
includes="nz/ac/massey/cs/**/*.java,test/nz/ac/massey/cs/**/*.java"
/>
<copy todir="${build.classes}">
<fileset dir="${src.dir}" includes="**/*.properties"/>
</copy>
</target>
<!-- =================================================================== -->
<!-- Jar the classes -->
<!-- =================================================================== -->
<target name="jar" depends="compile" description="Creates the jar file">
<!-- here we set certain meta information in the jar file dynamically by replacing values in a template -->
<filter token="NAME" value="${name}"/>
<filter token="TITLE" value="${name}"/>
<filter token="VERSION" value="${version}"/>
<filter token="VENDOR" value="Jens Dietrich, Massey University"/>
<filter token="MAIN_CLASS" value="${main.class.swing}"/>
<copy file="${config.dir}/${name}.mf" tofile="${build.tmp}/manifest.mf" filtering="yes"/>
<!-- separate jar files for runtime and tests -->
<jar jarfile="${build.jar}"
manifest="${build.tmp}/manifest.mf"
basedir="${build.classes}"
includes="nz/ac/massey/cs/**/*.*"
/>
<filter token="NAME" value="${name} Tests"/>
<filter token="TITLE" value="${name} Tests"/>
<copy file="${config.dir}/${name}.mf" tofile="${build.tmp}/manifest4tests.mf" filtering="yes"/>
<jar jarfile="${build.test.jar}"
manifest="${build.tmp}/manifest4tests.mf"
basedir="${build.classes}"
includes="test/**/*.*"
/>
</target>
<!-- =================================================================== -->
<!-- Tests the project, using JUnit tests -->
<!-- =================================================================== -->
<target name="tests" depends="compile" description="Tests the project">
<junit printsummary="yes" haltonfailure="no">
<classpath>
<pathelement location="${build.classes}"/>
<pathelement path="${java.class.path}"/>
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
</classpath>
<formatter type="xml"/>
<test name="test.nz.ac.massey.cs.sdc.taxcalculator.IncomeTaxCalculatorTests" outfile="${qa.dir}/testresults1"/>
<test name="test.nz.ac.massey.cs.sdc.taxcalculator.IncomeTaxCalculatorBatchTests" outfile="${qa.dir}/testresults2"/>
</junit>
<junitreport todir="${qa.dir}">
<fileset dir="${qa.dir}">
<include name="testresults1.xml"/>
<include name="testresults2.xml"/>
</fileset>
<report todir="${qa.dir}"
styledir="junitreport"
format="noframes">
<param name="key1" expression="value1"/>
<param name="key2" expression="value2"/>
</report>
</junitreport>
</target>
<!-- =================================================================== -->
<!-- Creates the API documentation -->
<!-- =================================================================== -->
<target name="javadocs" depends="prepare" description="Creates the API documentation">
<delete dir="${build.docs.api}"/>
<mkdir dir="${build.docs.api}"/>
<javadoc packagenames="nz.ac.massey.cs.*"
sourcepath="${src.dir}"
destdir="${build.docs.api}"
public="true"
author="true"
version="true"
use="false"
windowtitle="${name} ${version} "
classpath=""
>
</javadoc>
</target>
<!-- =================================================================== -->
<!-- Dependency analysis -->
<!-- =================================================================== -->
<target name="dependencyanalysis" depends="compile" description="Dependency ananlysis with JDepend">
<jdepend format="xml" outputfile="${qa.dir}/jdepend-report.xml">
<exclude name="java.*"/>
<exclude name="javax.*"/>
<exclude name="junit.*"/>
<exclude name="org.junit.*"/>
<exclude name="test.*"/>
<classespath>
<pathelement location="${build.classes}"/>
</classespath>
</jdepend>
<xslt basedir="${qa.dir}" destdir="${qa.dir}" includes="jdepend-report.xml" style="${ant.home}/etc/jdepend.xsl" />
</target>
<!-- =================================================================== -->
<!-- Cleans the build directory -->
<!-- =================================================================== -->
<target name="clean">
<delete dir="${build.dir}"/>
</target>
</project>

File Metadata

Mime Type
text/xml
Expires
Sat, Nov 14, 6:07 PM (15 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
133528
Default Alt Text
build.xml (8 KB)

Event Timeline