-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
117 lines (98 loc) · 3.72 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<!--
From Ant Tutorial
http://ant.apache.org/manual/tutorial-HelloWorldWithAnt.html
-->
<project name="odutils" basedir="." default="jar">
<property name="src.dir" value="./src"/>
<property name="test.src.dir" value="./src/test/java"/>
<property name="lib.dir" value="./lib"/>
<property name="build.dir" value="build"/>
<property name="main.build.dir" value="build"/>
<property name="test.build.dir" value="build/test"/>
<property name="classes.dir" value="${build.dir}/classes"/>
<property name="jar.dir" value="${build.dir}/jar"/>
<property name="lib.dir" value="lib"/>
<path id="classpath">
<dirset dir="${classes.dir}" />
<fileset dir="${lib.dir}">
<include name="*.jar" />
<include name="**/*.jar" />
</fileset>
</path>
<path id="classpath.test">
<pathelement location="lib/junit/junit-4.12.jar"/>
<pathelement location="lib/junit/hamcrest-core-1.3.jar"/>
<pathelement location="${classes.dir}"/>
<pathelement location="${test.build.dir}"/>
</path>
<target name="checkdata">
<condition property="dir.exists">
<available file="orekit-data" type="dir" />
</condition>
</target>
<target name="getdata" depends="checkdata">
<antcall target="getdataImpl" />
</target>
<target name="getdataImpl" unless="dir.exists">
<get skipexisting="true" src="https://gitlab.orekit.org/orekit/orekit-data/-/archive/master/orekit-data-master.zip" dest="orekit-data.zip" verbose="on">
<header name="Accept" value="*/*" />
<header name="Accept-Encoding" value="gzip, deflate, br" />
<header name="Host" value="gitlab.orekit.org" />
</get>
<unzip src="orekit-data.zip" dest="./"/>
<move file="orekit-data-master" tofile="orekit-data" />
</target>
<target name="clean">
<delete dir="${build.dir}"/>
<delete dir="doc"/>
</target>
<target name="compile">
<mkdir dir="${build.dir}"/>
<mkdir dir="${classes.dir}"/>
<pathconvert property="classpathProp" refid="classpath"/>
<javac includeantruntime="false" srcdir="${src.dir}" destdir="${classes.dir}" target="1.8" source="1.8" debug="true" compiler="modern">
<classpath refid="classpath"/>
</javac>
</target>
<target name="jar" depends="compile">
<mkdir dir="${jar.dir}"/>
<jar destfile="${jar.dir}/${ant.project.name}.jar" basedir="${classes.dir}"
compress="true" duplicate="preserve">
<fileset dir="." includes="${data.dir}/**,images/**"/>
</jar>
</target>
<target name="docs">
<mkdir dir="doc/api"/>
<javadoc
defaultexcludes="yes"
destdir="doc/api"
author="true"
version="true"
use="true"
windowtitle="odutils">
<packageset dir="${src.dir}" defaultexcludes="yes">
<include name="org/**"/>
</packageset>
</javadoc>
</target>
<target name="clean-build" depends="clean,jar"/>
<target name="test-compile" depends="compile">
<mkdir dir="${test.build.dir}"/>
<javac srcdir="${test.src.dir}" destdir="${test.build.dir}" includeantruntime="false">
<classpath refid="classpath.test"/>
</javac>
</target>
<target name="test" depends="test-compile">
<junit printsummary="on" haltonfailure="yes" fork="true">
<classpath>
<path refid="classpath.test"/>
<pathelement location="${test.build.dir}"/>
</classpath>
<formatter type="brief" usefile="false" />
<batchtest>
<fileset dir="${test.src.dir}" includes="**/*Test.java" />
<fileset dir="${test.src.dir}" includes="**/*Tests.java" />
</batchtest>
</junit>
</target>
</project>