<?xml version="1.0"?>
<!--
$Rev$
$Date$
$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>
<path id="tools.classpath">
<pathelement location="${junit.lib}"/>
<pathelement location="${lang.lib}"/>
<pathelement location="${yaml.lib}"/>
</path>
<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}"/>
<javac
destdir ="${build}"
includeAntRuntime ="no"
debug ="${debug}"
optimize ="${optimize}"
>
<classpath>
<path refid="tools.classpath" />
</classpath>
<!-- <compilerarg value="-Xlint"/> -->
<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>
<metainf dir="${basedir}">
<include name="COPYING"/>
</metainf>
<fileset dir="${build}" casesensitive="true">
<include name="com/**"/>
<exclude name="**/test/**"/>
</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">
<delete dir="${doc}" quiet="true"/>
<mkdir dir="${doc}"/>
<!--Set private to "off" to ignore private elements-->
<javadoc
destdir="${doc}"
author="true"
version="true"
use="true"
maxmemory="256M"
private="off"
source="1.7"
breakiterator="true"
useexternalfile="true"
linksource="true"
packagenames="*"
overview="${src}/overview.html"
>
<classpath>
<path refid="tools.classpath" />
<pathelement location="${treecster.lib}"/>
</classpath>
<packageset dir="${src}">
<include name="**"/>
<exclude name="**/test/**"/>
</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>
<link href="http://docs.oracle.com/javase/7/docs/api/"/>
<link href="http://commons.apache.org/proper/commons-lang/javadocs/api-2.6/"/>
<link href="http://snakeyamlrepo.appspot.com/releases/1.10/site/apidocs/"/>
</javadoc>
</target>
<target name="test" depends="compile" description="Run tests">
<junit
printsummary = "off"
haltonfailure = "yes"
fork = "yes"
dir = "${basedir}"
filtertrace = "yes"
newenvironment = "yes"
logfailedtests = "yes"
showoutput = "yes"
>
<classpath>
<path refid="tools.classpath" />
<pathelement location="${build}"/>
</classpath>
<formatter type="plain" usefile="true"/>
<test name="com.treecster.test.YAMLTest" todir="${basedir}"/>
</junit>
</target>
</project>