<?xml version="1.0"?>
<!-- $Date$ $Rev$ $URL$ -->
<!--
Treecster - an enterprise configuration framework, see http://treecster.sourceforge.net
Copyright (C) 2011 APP Design, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<project name="treecster" default="dist" basedir=".">
<property file="build.properties"/>
<property environment="env."/>
<tstamp>
<format property="time.long" pattern="MM/dd/yyyy HH:mm:ss"/>
</tstamp>
<tstamp>
<format property="time.short" pattern="yyyy-MM-dd-HH-mm-ss"/>
</tstamp>
<target name="clean" description="Remove all the temp stuff">
<!-- Remove transients -->
<delete dir="${build}" quiet="true"/>
<delete quiet="true" includeemptydirs="true">
<fileset file="${treecster.lib}"/>
<fileset file="${treecster.src}"/>
<fileset dir="${basedir}">
<!-- Our log files -->
<include name="**/*.log"/>
<!-- JUnit's log files -->
<include name="**/TEST-*.txt"/>
</fileset>
</delete>
</target>
<target name="compile" description="Compile the sources">
<mkdir dir="${build}"/>
<path id="tools.classpath">
<pathelement location="${junit.lib}"/>
<pathelement location="${configuration.lib}"/>
<pathelement location="${log4j.lib}"/>
<pathelement location="${lang.lib}"/>
</path>
<javac
destdir ="${build}"
includeAntRuntime ="no"
debug ="${debug}"
optimize ="${optimize}"
>
<classpath>
<path refid="tools.classpath" />
</classpath>
<src path="${src}"/>
</javac>
<!-- Main jar file -->
<jar jarfile="${treecster.lib}" index="on">
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<section name="common">
<attribute name="Implementation-Title" value="${app.name}"/>
<attribute name="Implementation-Version" value="${app.version}"/>
<attribute name="Implementation-Vendor" value="${app.vendor}"/>
<attribute name="Built-On" value="${time.long}"/>
</section>
</manifest>
<fileset dir="${build}" casesensitive="true">
<include name="com/**"/>
</fileset>
</jar>
</target>
<target name="dist" description="Produce distributables" depends="clean">
<antcall target="compile">
<param name="optimize" value="true"/>
<param name="debug" value="no"/>
</antcall>
<antcall target="javadoc"/>
<!-- Source distribution jar file -->
<jar jarfile="${treecster.src}" index="off">
<fileset dir="${basedir}" casesensitive="true">
<include name="${src}/**"/>
<include name="${lib}/**"/>
<include name="${doc}/**"/>
<include name="${examples}/**"/>
<include name="build.*"/>
<include name="COPYING"/>
</fileset>
</jar>
</target>
<target name="javadoc" depends="compile">
<delete dir="${doc}" quiet="true"/>
<mkdir dir="${doc}"/>
<javadoc
destdir="${doc}"
author="true"
version="true"
use="true"
maxmemory="256M"
private="on"
source="1.6"
breakiterator="true"
useexternalfile="true"
linksource="true"
packagenames="*"
>
<classpath>
<path refid="tools.classpath" />
<pathelement location="${treecster.lib}"/>
</classpath>
<packageset dir="${src}">
<include name="**"/>
</packageset>
<doctitle><![CDATA[<h1>Treecster API</h1>]]></doctitle>
<bottom><![CDATA[<i>Ver. ${app.version}. Built on ${time.long}. Copyright © APP Design, Inc. All Rights Reserved.</i>]]></bottom>
</javadoc>
</target>
<target name="test" depends="compile" description="Run tests">
<junit
printsummary = "withOutAndErr"
haltonfailure = "yes"
fork = "yes"
dir = "${basedir}"
filtertrace = "yes"
newenvironment = "yes"
>
<classpath>
<path refid="tools.classpath" />
<pathelement location="${treecster.lib}"/>
</classpath>
<jvmarg value="-Dlog4j.configuration=file:${basedir}/log4j.properties"/>
<formatter type="plain"/>
<test name="com.treecster.junit.Test" todir="${basedir}"/>
</junit>
</target>
</project>