<project name="Hierarchy" default="build" basedir=".">
<description>
Builds Hierarchy.
</description>
<defaultexcludes add="**/.git/**"/>
<defaultexcludes add="**/.gitignore"/>
<defaultexcludes add="**/.data"/>
<defaultexcludes add="**/*.odt"/>
<defaultexcludes add="**/images/**"/>
<defaultexcludes add="**/vector/**"/>
<defaultexcludes add="**/mockups/**"/>
<defaultexcludes add="**/dist/**"/>
<property name="src" location="src"/>
<property name="doc" location="javadoc"/>
<property name="build" location="classes"/>
<property name="dist" location="dist"/>
<property name="lib" location="lib"/>
<property name="compile.debug" value="true"/>
<property name="app.vendor" value="White Magic Software, Ltd."/>
<property name="app.name" value="Hierarchy"/>
<property name="app.archive" value="hierarchy"/>
<property name="app.jar" value="${lib}/${app.archive}.jar"/>
<property name="app.common" value="com.whitemagicsoftware.hierarchy"/>
<property name="app.main" value="${app.common}.app.Hierarchy"/>
<property name="app.version" value="build.properties"/>
<property name="build.sysclasspath" value="last"/>
<property file="${app.version}"/>
<path id="lib.classpath">
<fileset dir="${lib}">
<include name="**/*.jar"/>
</fileset>
</path>
<target name="version">
<echo>Build version: ${v.major}.${v.minor}.${v.build}</echo>
</target>
<target name="init">
<tstamp/>
<mkdir dir="${build}"/>
</target>
<target name="compile" depends="clean,init">
<javac srcdir="${src}"
destdir="${build}"
debug="${compile.debug}"
deprecation="true">
<compilerarg value="-Xlint"/>
<classpath refid="lib.classpath"/>
</javac>
<antcall target="version.build"/>
</target>
<target name="build" depends="compile">
<mkdir dir="${lib}"/>
<manifestclasspath property="lib.manifest" jarfile="${app.jar}">
<classpath refid="lib.classpath"/>
</manifestclasspath>
<tstamp>
<format property="TODAY" pattern="dd-MMM-yyyy"/>
</tstamp>
<jar destfile="${app.jar}" basedir="${build}">
<manifest>
<attribute name="Main-Class" value="${app.main}"/>
<attribute name="Class-Path" value="${lib.manifest}"/>
<section name="${app.common}">
<attribute
name="Implementation-Title"
value="${app.name}"/>
<attribute
name="Implementation-Version"
value="${v.major}.${v.minor}.${v.build} ${TODAY}"/>
<attribute
name="Implementation-Vendor"
value="${app.vendor}"/>
</section>
</manifest>
</jar>
</target>
<target name="api" depends="doc"/>
<target name="javadoc" depends="doc"/>
<target name="doc">
<mkdir dir="${doc}"/>
<javadoc destdir="${doc}"
sourcepath="${src}"
defaultexcludes="yes"
access="protected"
author="true"
windowtitle="${app.vendor}: ClassAnalyzer API">
<excludepackage name="${app.common}.test"/>
<excludepackage name="org.apache"/>
<excludepackage name="prefuse"/>
<classpath refid="lib.classpath"/>
<link href="http://java.sun.com/j2se/1.5.0/docs/api/"/>
<link href="http://jakarta.apache.org/bcel/apidocs/"/>
<link href="http://prefuse.org/doc/api/"/>
<link href="http://jopt-simple.sourceforge.net/apidocs/"/>
</javadoc>
</target>
<target name="dist" depends="clean">
<mkdir dir="${dist}"/>
<zip destfile="${dist}/${app.archive}-${v.major}.${v.minor}.${v.build}.zip">
<zipfileset
dir="."
prefix="${app.archive}-${v.major}.${v.minor}.${v.build}"/>
</zip>
</target>
<target name="clean">
<delete dir="${build}"/>
<delete dir="${dist}"/>
<delete dir="${doc}"/>
</target>
<target name="version.build">
<propertyfile file="${app.version}">
<entry key="v.build" type="int" operation="+" value="1" pattern="00"/>
</propertyfile>
</target>
<target name="version.minor">
<propertyfile file="${app.version}">
<entry key="v.minor" type="int" operation="+" value="1" pattern="00"/>
<entry key="v.build" type="int" value="0" pattern="00"/>
</propertyfile>
</target>
<target name="version.major">
<propertyfile file="${app.version}">
<entry key="v.major" type="int" operation="+" value="1" pattern="00"/>
<entry key="v.minor" type="int" value="0" pattern="00"/>
<entry key="v.build" type="int" value="0" pattern="00"/>
</propertyfile>
</target>
</project>