<?xml version="1.0" encoding="UTF-8"?> <project name="orekit" default="jar" basedir="."> <property name="project.version" value="7.1" /> <property name="src.dir" location="src" /> <property name="main.src.dir" value="${src.dir}/main/java" /> <property name="main.resources.dir" value="${src.dir}/main/resources" /> <property name="test.src.dir" value="${src.dir}/test/java" /> <property name="test.resources.dir" value="${src.dir}/test/resources" /> <property name="build.dir" location="build" /> <property name="main.classes.dir" value="${build.dir}/classes" /> <property name="test.classes.dir" value="${build.dir}/test-classes" /> <property name="javadoc.dir" value="${build.dir}/javadoc" /> <property name="tests.reports" value="${build.dir}/test-reports" /> <property name="lib.dir" location="lib" /> <property name="commons-math.version" value="3.6" /> <property name="commons-math.jar" value="commons-math3-${commons-math.version}.jar" /> <property name="commons-math.maven.path" value="org/apache/commons/commons-math3" /> <property name="maven.repository" value="http://repo1.maven.org/maven2" /> <property name="copyright" value="2002-2016 CS Systèmes d'Information" /> <available classname="org.junit.Test" property="junit4.present" /> <available file="${lib.dir}/${commons-math.jar}" property="apache-commons-math.present" /> <target name="clean" description="Clean the build directory"> <delete dir="${build.dir}"/> </target> <target name="clean-lib" description="Clean the lib directory"> <delete dir="${lib.dir}"/> </target> <target name="clean-all" depends="clean,clean-lib" description="Clean the build and lib directories"> </target> <target name="get-apache-commons-math" description="Get Apache commons-math" unless="apache-commons-math.present"> <!-- if you need to set up a proxy to download artifacts, uncomment and edit the following setproxy task --> <!-- <setproxy proxyhost="my-proxy.my-company.com" proxyport="8080" proxyUser="username" proxyPassword="password"/> --> <mkdir dir="${lib.dir}"/> <get src="${maven.repository}/${commons-math.maven.path}/${commons-math.version}/${commons-math.jar}" dest="${lib.dir}/${commons-math.jar}"/> </target> <target name="compile" depends="get-apache-commons-math" description="Compile the code"> <mkdir dir="${main.classes.dir}"/> <javac srcdir="${main.src.dir}" destdir="${main.classes.dir}" classpath="${lib.dir}/${commons-math.jar}" deprecation="true" target="1.6" source="1.6"> </javac> <copy todir="${main.classes.dir}"> <fileset dir="${main.resources.dir}"/> </copy> </target> <target name="compile-tests" depends="compile" description="Compile the test code" if="junit4.present"> <mkdir dir="${test.classes.dir}"/> <javac srcdir="${test.src.dir}" destdir="${test.classes.dir}" classpath="${main.classes.dir}:${lib.dir}/${commons-math.jar}" deprecation="true" target="1.6" source="1.6"> </javac> <copy todir="${test.classes.dir}"> <fileset dir="${test.resources.dir}"/> </copy> </target> <target name="test" depends="compile-tests" if="junit4.present" description="Run the tests"> <mkdir dir="${tests.reports}"/> <junit> <classpath> <pathelement location="${main.classes.dir}" /> <pathelement location="${test.classes.dir}" /> <pathelement location="${lib.dir}/${commons-math.jar}" /> </classpath> <formatter type="brief"/> <batchtest todir="${tests.reports}"> <fileset dir="${test.src.dir}"> <include name="**/*Test*.java"/> <exclude name="**/Abstract*Test*.java"/> </fileset> </batchtest> </junit> </target> <target name="jar" depends="compile,test" description="create the jar file"> <jar jarfile="${build.dir}/${ant.project.name}-${project.version}.jar" basedir="${main.classes.dir}"/> </target> <target name="javadoc" description="create javadoc"> <javadoc sourcepath="${main.src.dir}" destdir="${javadoc.dir}" overview="${main.src.dir}/org/orekit/overview.html" encoding="UTF-8" version="true" use="true" author="true" charset="UTF-8" docencoding="UTF-8" bottom="<i>Copyright © ${copyright}. All Rights Reserved.</i>"> <link href="http://docs.oracle.com/javase/6/docs/api/"/> <link href="http://commons.apache.org/proper/commons-math/javadocs/api-${commons-math.version}/"/> </javadoc> </target> </project>