build.xml 8.27 KB
Newer Older
1 2
<?xml version="1.0" encoding="UTF-8"?>

3
<project name="orekit" default="jar" basedir=".">
4

5
  <property name="project.version"         value="9.3-SNAPSHOT" />
6

7 8 9 10 11
  <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" />
12

13 14 15 16 17
  <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" />
18

19 20
  <property name="lib.dir"                 location="lib"                    />

21
  <property name="hipparchus.version"       value="1.4"                                            />
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
  <property name="hipparchus.core.jar"      value="hipparchus-core-${hipparchus.version}.jar"      />
  <property name="hipparchus.geometry.jar"  value="hipparchus-geometry-${hipparchus.version}.jar"  />
  <property name="hipparchus.ode.jar"       value="hipparchus-ode-${hipparchus.version}.jar"       />
  <property name="hipparchus.fitting.jar"   value="hipparchus-fitting-${hipparchus.version}.jar"   />
  <property name="hipparchus.optim.jar"     value="hipparchus-optim-${hipparchus.version}.jar"     />
  <property name="hipparchus.filtering.jar" value="hipparchus-filtering-${hipparchus.version}.jar" />
  <property name="hipparchus.stat.jar"      value="hipparchus-stat-${hipparchus.version}.jar"      />
  <property name="hipparchus.maven.path"    value="org/hipparchus"                                 />
  <property name="junit.version"            value="4.12"                                           />
  <property name="junit.jar"                value="junit-${junit.version}.jar"                     />
  <property name="junit.maven.path"         value="junit/junit"                                    />
  <property name="hamcrest.version"         value="1.3"                                            />
  <property name="hamcrest.core.jar"        value="hamcrest-core-${hamcrest.version}.jar"          />
  <property name="hamcrest.maven.path"      value="org/hamcrest"                                   />
  <property name="maven.repository"         value="http://repo1.maven.org/maven2"                  />
37

Luc Maisonobe's avatar
Luc Maisonobe committed
38
  <property name="copyright"               value="2002-2019 CS Syst&#232;mes d&#039;Information" />
39

40
  <available file="${lib.dir}/${hipparchus.core.jar}" property="libs.present" />
41

42 43
  <target name="clean" description="Clean the build directory">
    <delete dir="${build.dir}"/>
44 45 46
  </target>

  <target name="clean-lib" description="Clean the lib directory">
47
    <delete dir="${lib.dir}"/>
Luc Maisonobe's avatar
Luc Maisonobe committed
48
  </target>
49 50

  <target name="clean-all" depends="clean,clean-lib"
51
          description="Clean the build and lib directories">
52 53
  </target>

54
  <target name="get-libs" description="Get libraries" unless="libs.present">
55 56 57 58 59
    <!-- 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}"/>
60
    <get src="${maven.repository}/${hipparchus.maven.path}/hipparchus-core/${hipparchus.version}/${hipparchus.core.jar}"
61
         dest="${lib.dir}/${hipparchus.core.jar}"/>
62
    <get src="${maven.repository}/${hipparchus.maven.path}/hipparchus-geometry/${hipparchus.version}/${hipparchus.geometry.jar}"
63
         dest="${lib.dir}/${hipparchus.geometry.jar}"/>
64
    <get src="${maven.repository}/${hipparchus.maven.path}/hipparchus-ode/${hipparchus.version}/${hipparchus.ode.jar}"
65
         dest="${lib.dir}/${hipparchus.ode.jar}"/>
66
    <get src="${maven.repository}/${hipparchus.maven.path}/hipparchus-fitting/${hipparchus.version}/${hipparchus.fitting.jar}"
67
         dest="${lib.dir}/${hipparchus.fitting.jar}"/>
68
    <get src="${maven.repository}/${hipparchus.maven.path}/hipparchus-optim/${hipparchus.version}/${hipparchus.optim.jar}"
69
         dest="${lib.dir}/${hipparchus.optim.jar}"/>
70 71
    <get src="${maven.repository}/${hipparchus.maven.path}/hipparchus-filtering/${hipparchus.version}/${hipparchus.filtering.jar}"
         dest="${lib.dir}/${hipparchus.filtering.jar}"/>
72
    <get src="${maven.repository}/${hipparchus.maven.path}/hipparchus-stat/${hipparchus.version}/${hipparchus.stat.jar}"
Luc Maisonobe's avatar
Luc Maisonobe committed
73
         dest="${lib.dir}/${hipparchus.stat.jar}"/>
74 75 76 77
    <get src="${maven.repository}/${junit.maven.path}/${junit.version}/${junit.jar}"
         dest="${lib.dir}/${junit.jar}"/>
    <get src="${maven.repository}/${hamcrest.maven.path}/hamcrest-core/${hamcrest.version}/${hamcrest.core.jar}"
         dest="${lib.dir}/${hamcrest.core.jar}"/>
78 79
  </target>

80
  <target name="compile" depends="get-libs" description="Compile the code">
81
    <mkdir dir="${main.classes.dir}"/>
82
    <javac srcdir="${main.src.dir}" destdir="${main.classes.dir}" includeantruntime="false"
Luc Maisonobe's avatar
Luc Maisonobe committed
83
           classpath="${lib.dir}/${hipparchus.core.jar}:${lib.dir}/${hipparchus.geometry.jar}:${lib.dir}/${hipparchus.ode.jar}:${lib.dir}/${hipparchus.fitting.jar}:${lib.dir}/${hipparchus.optim.jar}:${lib.dir}/${hipparchus.stat.jar}"
84
           deprecation="true" target="1.8" source="1.8">
85 86 87 88 89 90
    </javac>
    <copy todir="${main.classes.dir}">
      <fileset dir="${main.resources.dir}"/>
    </copy>
  </target>

91
  <target name="compile-tests" depends="compile" description="Compile the test code" >
92
    <mkdir dir="${test.classes.dir}"/>
93
    <javac srcdir="${test.src.dir}" destdir="${test.classes.dir}" includeantruntime="false"
94
    	   classpath="${main.classes.dir}:${lib.dir}/${junit.jar}:${lib.dir}/${hamcrest.core.jar}:${lib.dir}/${hipparchus.core.jar}:${lib.dir}/${hipparchus.geometry.jar}:${lib.dir}/${hipparchus.ode.jar}:${lib.dir}/${hipparchus.fitting.jar}:${lib.dir}/${hipparchus.optim.jar}:${lib.dir}/${hipparchus.filtering.jar}:${lib.dir}/${hipparchus.stat.jar}"
95
    	   deprecation="true" target="1.8" source="1.8">
96 97 98 99 100 101
    </javac>
    <copy todir="${test.classes.dir}">
      <fileset dir="${test.resources.dir}"/>
    </copy>
  </target>

102
  <target name="test" depends="compile-tests" description="Run the tests">
103
    <mkdir dir="${tests.reports}"/>
104
    <junit fork="yes" haltonerror="yes" haltonfailure="yes">
105
      <classpath>
Luc Maisonobe's avatar
Luc Maisonobe committed
106 107 108 109 110 111 112 113
        <pathelement location="${main.classes.dir}"                   />
        <pathelement location="${test.classes.dir}"                   />
        <pathelement location="${lib.dir}/${hipparchus.core.jar}"     />
      	<pathelement location="${lib.dir}/${hipparchus.geometry.jar}" />
      	<pathelement location="${lib.dir}/${hipparchus.ode.jar}"      />
      	<pathelement location="${lib.dir}/${hipparchus.fitting.jar}"  />
      	<pathelement location="${lib.dir}/${hipparchus.optim.jar}"    />
      	<pathelement location="${lib.dir}/${hipparchus.stat.jar}"     />
114 115
      	<pathelement location="${lib.dir}/${junit.jar}"               />
      	<pathelement location="${lib.dir}/${hamcrest.core.jar}"       />
116
      </classpath>
117
      <formatter type="plain" usefile="false"/>
118 119
      <batchtest todir="${tests.reports}">
        <fileset dir="${test.src.dir}">
120 121
          <include name="**/*Test.java"/>
          <exclude name="**/*Abstract*.java"/>
122 123 124 125 126 127
        </fileset>
      </batchtest>
    </junit>
  </target>

  <target name="jar" depends="compile,test" description="create the jar file">
128
    <jar jarfile="${build.dir}/${ant.project.name}-${project.version}.jar"
129
         basedir="${main.classes.dir}"/>
130 131 132 133 134 135 136 137
  </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="&lt;i&gt;Copyright &#169; ${copyright}. All Rights Reserved.&lt;/i&gt;">
138
      <link href="http://docs.oracle.com/javase/8/docs/api/"/>
Luc Maisonobe's avatar
Luc Maisonobe committed
139
      <link href="https://www.hipparchus.org/apidocs/"/>
140 141 142 143
    </javadoc>
  </target>

</project>