109 lines
4.6 KiB
XML
109 lines
4.6 KiB
XML
<?xml version="1.0"?>
|
|
<project name="depot" default="compile" basedir="." xmlns:artifact="urn:maven-artifact-ant">
|
|
<!-- project metadata -->
|
|
<property name="src.dir" value="src/main/java"/>
|
|
<property name="test.dir" value="src/test/java"/>
|
|
<property name="deploy.dir" value="dist"/>
|
|
<property name="classes.dir" value="${deploy.dir}/classes"/>
|
|
<property name="tclasses.dir" value="${deploy.dir}/test-classes"/>
|
|
<property name="javadoc.dir" value="${deploy.dir}/docs"/>
|
|
|
|
<property name="ooo-build.vers" value="2.9"/>
|
|
<ant antfile="bootstrap.xml"/>
|
|
<import file="${user.home}/.m2/ooo-build/${ooo-build.vers}/ooo-build.xml"/>
|
|
|
|
<target name="-prepare" depends="-init-contrib">
|
|
<mkdir dir="${deploy.dir}"/>
|
|
<mavendep pom="pom.xml" scope="compile"/>
|
|
<mavendep pom="pom.xml" id="test" scope="test"/>
|
|
<path id="built.path">
|
|
<path refid="test.path"/>
|
|
<pathelement location="${classes.dir}"/>
|
|
<pathelement location="${tclasses.dir}"/>
|
|
</path>
|
|
</target>
|
|
|
|
<target name="genrecord" depends="-prepare"
|
|
description="Generates fields for persistent record classes.">
|
|
<taskdef name="grecord" classname="com.samskivert.depot.tools.GenRecordTask"
|
|
classpathref="built.path"/>
|
|
<!-- make sure the record class files are all compiled -->
|
|
<ooojavac destdir="${classes.dir}" classpathref="built.path" srcdir="${src.dir}"
|
|
version="1.5">
|
|
<include name="**/*Record.java"/>
|
|
</ooojavac>
|
|
<ooojavac destdir="${tclasses.dir}" classpathref="built.path" srcdir="${test.dir}"
|
|
version="1.5">
|
|
<include name="**/*Record.java"/>
|
|
</ooojavac>
|
|
<!-- now update the source files -->
|
|
<grecord classpathref="built.path">
|
|
<fileset dir="${src.dir}" includes="**/*Record.java"/>
|
|
<fileset dir="${test.dir}" includes="**/*Record.java"/>
|
|
</grecord>
|
|
</target>
|
|
|
|
<target name="clean" description="Cleans out build results.">
|
|
<delete dir="${deploy.dir}"/>
|
|
</target>
|
|
|
|
<target name="compile" depends="-prepare" description="Compiles the code.">
|
|
<mkdir dir="${classes.dir}"/>
|
|
<copy todir="${classes.dir}">
|
|
<fileset dir="src/main/resources" includes="**/*.tmpl"/>
|
|
</copy>
|
|
<ooojavac srcdir="${src.dir}" destdir="${classes.dir}" classpathref="pom.xml.path"
|
|
version="1.5"/>
|
|
|
|
<mkdir dir="${tclasses.dir}"/>
|
|
<ooojavac srcdir="${test.dir}" destdir="${tclasses.dir}" classpathref="built.path"
|
|
version="1.5"/>
|
|
</target>
|
|
|
|
<target name="javadoc" depends="-prepare" description="Generates javadoc documentation.">
|
|
<mkdir dir="${javadoc.dir}"/>
|
|
<tstamp><format property="year" pattern="yyyy" /></tstamp>
|
|
<javadoc windowtitle="${ant.project.name} API" doctitle="${ant.project.name} API"
|
|
access="public" overview="src/main/javadoc/overview.html" destdir="${javadoc.dir}"
|
|
additionalparam="-breakiterator">
|
|
<packageset dir="${src.dir}">
|
|
<exclude name="**/impl/**"/>
|
|
</packageset>
|
|
<bottom>Copyright © 2006-${year} Michael Bayne, et al. All Rights Reserved.</bottom>
|
|
<classpath refid="built.path"/>
|
|
<link href="http://download.oracle.com/javase/1.5.0/docs/api/"/>
|
|
<link href="http://samskivert.github.com/samskivert/apidocs/"/>
|
|
</javadoc>
|
|
</target>
|
|
|
|
<target name="tests" depends="compile" description="Runs the unit tests.">
|
|
<!-- allows passing -Dtest=NamePrefix to restrict to subset of tests -->
|
|
<property name="test" value=""/>
|
|
<taskdef name="unit" classpathref="test.path"
|
|
classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"/>
|
|
<mkdir dir="${deploy.dir}/test-reports"/>
|
|
<unit printsummary="off" haltonfailure="yes" fork="${junit.fork}">
|
|
<classpath refid="built.path"/>
|
|
<sysproperty key="com.samskivert.depot.debug" value="${debug}"/>
|
|
<formatter type="brief" usefile="false"/>
|
|
<formatter type="xml"/>
|
|
<batchtest todir="${deploy.dir}/test-reports">
|
|
<fileset dir="${test.dir}" includes="**/${test}*Test.java"/>
|
|
</batchtest>
|
|
</unit>
|
|
</target>
|
|
|
|
<target name="package" depends="compile" description="Compiles code and builds jar file.">
|
|
<jar destfile="${deploy.dir}/${ant.project.name}.jar" basedir="${classes.dir}"/>
|
|
</target>
|
|
|
|
<target name="install" depends="package" description="Installs to local Maven repo.">
|
|
<maveninstall file="${deploy.dir}/${ant.project.name}.jar" pom="pom.xml"/>
|
|
</target>
|
|
|
|
<target name="deploy" depends="package,tests,javadoc" description="Deploys to remote Maven repo.">
|
|
<mavendeploy file="${deploy.dir}/${ant.project.name}.jar" pom="pom.xml"
|
|
srcdir="${src.dir}" docdir="${javadoc.dir}"/>
|
|
</target>
|
|
</project>
|