Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

75 lines (65 sloc) 3.169 kb
<?xml version="1.0"?>
<project name="pythagoras" default="compile" basedir="." xmlns:artifact="urn:maven-artifact-ant">
<property name="src.dir" location="src/main/java"/>
<property name="tsrc.dir" location="src/test/java"/>
<property name="target.dir" location="target"/>
<property name="classes.dir" location="${target.dir}/classes"/>
<property name="tclasses.dir" location="${target.dir}/test-classes"/>
<property name="ooo-build.vers" value="2.9"/>
<ant antfile="etc/bootstrap.xml"/>
<import file="${user.home}/.m2/ooo-build/${ooo-build.vers}/ooo-build.xml"/>
<target name="-prepare" depends="-init-ooo">
<mkdir dir="${target.dir}"/>
<mavendep pom="pom.xml"/>
<mavendep pom="pom.xml" id="test" scope="test"/>
<path id="test.classpath">
<path refid="test.path"/>
<pathelement location="${classes.dir}"/>
<pathelement location="${tclasses.dir}"/>
</path>
</target>
<target name="clean" description="Deletes all build results.">
<delete dir="${target.dir}"/>
</target>
<target name="compile" depends="-prepare" description="Compiles the code.">
<mkdir dir="${classes.dir}"/>
<ooojavac srcdir="${src.dir}" destdir="${classes.dir}" classpathref="pom.xml.path">
<exclude name="pythagoras/gwt/**"/>
</ooojavac>
<mkdir dir="${tclasses.dir}"/>
<ooojavac srcdir="${tsrc.dir}" destdir="${tclasses.dir}" classpathref="test.classpath"/>
</target>
<target name="javadoc" depends="-prepare" description="Builds the Java documentation">
<mkdir dir="${target.dir}/docs"/>
<javadoc sourcepath="${src.dir}" destdir="${target.dir}/docs"
additionalparam="-breakiterator" classpathref="pom.xml.path">
<link href="http://download.oracle.com/javase/6/docs/api/"/>
</javadoc>
</target>
<target name="test" depends="compile" description="Runs the unit tests.">
<taskdef name="unit" classpathref="test.path"
classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"/>
<mkdir dir="${target.dir}/test-reports"/>
<unit printsummary="off" haltonfailure="yes" fork="${junit.fork}">
<classpath refid="test.classpath"/>
<formatter type="brief" usefile="false"/>
<formatter type="xml"/>
<batchtest todir="${target.dir}/test-reports">
<fileset dir="${tsrc.dir}" includes="**/*Test.java"/>
</batchtest>
</unit>
</target>
<target name="package" depends="test" description="Compiles code and builds jar file.">
<jar destfile="${target.dir}/${ant.project.name}.jar">
<fileset dir="${classes.dir}" includes="**"/>
<fileset dir="${src.dir}" includes="**"/> <!-- include source for GWT -->
</jar>
</target>
<target name="install" depends="package" description="Installs to local Maven repository.">
<maveninstall file="${target.dir}/${ant.project.name}.jar" pom="pom.xml"/>
</target>
<target name="deploy" depends="package,javadoc" description="Deploys to remote Maven repository.">
<mavendeploy file="${target.dir}/${ant.project.name}.jar" pom="pom.xml"
srcdir="${src.dir}" docdir="${target.dir}/docs"/>
</target>
</project>
Jump to Line
Something went wrong with that request. Please try again.