<project name="vitforjava" default="dist" basedir=".">
<!-- set global properties for this build -->
<property name="project.name" value="VI Toolkit for Java" />
<property name="project.unixname" value="vitforjava" />
<property name="project.dotnotation" value="net.sf.vitoolkitforjava" />
<property name="project.slashnotation" value="net/sf/vitforjava" />
<property name="author" value="Schley Andrew Kutz <sakutz@gmail.com>" />
<property name="vendor" value="${author}" />
<property name="version" value="0.1.2" />
<property name="src" location="src" />
<property name="test" location="test" />
<property name="build" location="build" />
<property name="dist" location="dist" />
<property name="conf" location="conf" />
<property name="doc" location="doc" />
<property name="lib" location="lib" />
<target name="init" depends="clean">
<!-- Create the time stamp -->
<tstamp />
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}" />
</target>
<target name="compile" depends="init" description="compile the source ">
<!-- Compile the java code from ${src} into ${build} -->
<javac srcdir="${src}" destdir="${build}">
<classpath>
<fileset dir="lib">
<include name="**/*.jar" />
</fileset>
</classpath>
</javac>
</target>
<target name="dist" depends="compile" description="generate the distribution">
<!-- Set it up so we can create the manifest Classpath property -->
<property name="jar-all" location="lib" />
<fileset id="jars" dir="${jar-all}">
<include name="*.jar" />
</fileset>
<path id="cp">
<fileset refid="jars" />
</path>
<pathconvert property="classpath" refid="cp" pathsep=" " dirsep="/">
<map from="${jar-all}" to="lib" />
</pathconvert>
<manifest file="${conf}/MANIFEST.MF">
<attribute name="Built-By" value="${author}" />
<section name="${project.slashnotation}">
<attribute name="Specification-Title" value="${project.name}" />
<attribute name="Specification-Version" value="${version}" />
<attribute name="Specification-Vendor" value="${vendor}" />
<attribute name="Implementation-Title" value="${project.dotnotation}" />
<attribute name="Implementation-Version" value="${version}" />
<attribute name="Implementation-Vendor" value="${vendor}" />
<attribute name="Class-Path" value="${classpath}" />
<attribute name="Sealed" value="true" />
</section>
</manifest>
<!-- ***************************** src ***************************** -->
<!-- Create the javadocs -->
<javadoc sourcepath="${src}" destdir="${doc}" excludepackagenames="${project.dotnotation}.templateapplication">
<classpath>
<fileset dir="lib">
<include name="**/*.jar" />
</fileset>
</classpath>
</javadoc>
<!-- Sync the project (minus some dirs) to the dist src tree -->
<sync todir="${dist}/${project.unixname}-src-${version}">
<fileset dir="${basedir}" excludes="bin/ build/ dist/ conf/unitTests.properties" />
</sync>
<!-- Tar the dist src tree -->
<tar destfile="${dist}/${project.unixname}-src-${version}.tar.gz" basedir="${dist}" compression="gzip" includes="${project.unixname}-src-${version}/**" />
<!-- ***************************** src ***************************** -->
<!-- ***************************** bin ***************************** -->
<!-- Sync the lib directory to the dist bin tree -->
<sync todir="${dist}/${project.unixname}-bin-${version}/lib">
<fileset dir="lib/" />
</sync>
<!-- Sync the javadocs to the dist bin tree -->
<sync todir="${dist}/${project.unixname}-bin-${version}/doc">
<fileset dir="${doc}" />
</sync>
<!-- Jar up the project's built output -->
<jar jarfile="${dist}/${project.unixname}-bin-${version}/${project.unixname}-${version}.jar" basedir="${build}" manifest="${conf}/MANIFEST.MF" />
<!-- Tar the dist bin tree -->
<tar destfile="${dist}/${project.unixname}-bin-${version}.tar.gz" basedir="${dist}" compression="gzip" includes="${project.unixname}-bin-${version}/**" />
<!-- ***************************** bin ***************************** -->
</target>
<target name="clean" description="clean up">
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build}" />
<delete dir="${dist}" />
<delete dir="${doc}" />
</target>
</project>