forked from gmantele/vollt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildTAP.xml
237 lines (201 loc) · 11.3 KB
/
buildTAP.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE project>
<project name="tap" basedir="." default="buildLib">
<property name="version" value="2.3" />
<property name="srcDir" value="src" />
<property name="testDir" value="test" />
<property name="libDir" value="lib" />
<property name="compileDir" value="antBuild" />
<property name="junitBuildDir" value="junitBuild" />
<property name="classesDir" value="${compileDir}"/>
<property name="javadocDir" value="javadoc/tap" />
<property name="commonsIOJarName" value="commons-io-2.6.jar" />
<property name="commonsIOJar" value="${libDir}/${commonsIOJarName}" />
<property name="commonsFileUploadJarName" value="commons-fileupload-1.3.3.jar" />
<property name="commonsFileUploadJar" value="${libDir}/${commonsFileUploadJarName}" />
<property name="stilJarName" value="stil_3.3-2.jar" />
<property name="stilJar" value="${libDir}/${stilJarName}" />
<property name="slf4jApiJarName" value="slf4j-api-1.7.25.jar" />
<property name="slf4jApiJar" value="${libDir}/${slf4jApiJarName}" />
<property name="jsonJarName" value="json-20180813.jar" />
<property name="jsonJar" value="${libDir}/${jsonJarName}" />
<property name="sqliteJarName" value="sqlite-jdbc-3.16.1.jar" />
<property name="sqliteJar" value="${libDir}/${sqliteJarName}" />
<property name="h2JarName" value="h2-1.4.193.jar" />
<property name="h2Jar" value="${libDir}/${h2JarName}" />
<property name="jtsJarName" value="jts-core-1.14.0.jar" />
<property name="jtsJar" value="${libDir}/${jtsJarName}" />
<property name="spatial4jJarName" value="spatial4j-0.6.jar" />
<property name="spatial4jJar" value="${libDir}/${spatial4jJarName}" />
<property name="astroh2JarName" value="astroh2-0.3.jar" />
<property name="astroh2Jar" value="${libDir}/${astroh2JarName}" />
<property name="tapPath" value="tap/**,adql/**,uws/**,cds/**" />
<property name="jsonPath" value="org/json/**" />
<property name="extLibsPath" value="org/slf4j/**,org/apache/commons/fileupload/**,org/apache/commons/io/**,nom/tam/**,org/apache/tools/bzip2/**,edu/jhu/**,gov/fnal/eag/healpix/**,uk/ac/**" />
<property name="licensePath" value="COPYING.LESSER" />
<property name="includesList" value="${tapPath},${jsonPath},${extLibsPath}" />
<property name="jarDest" value="." />
<property name="libJarFileWithSTIL" value="${jarDest}/tap_${version}_withSTIL.jar" />
<property name="libJarFile" value="${jarDest}/tap_${version}.jar" />
<property name="srcJarFileWithSTIL" value="${jarDest}/tap_src_${version}_withSTIL.jar" />
<property name="srcJarFile" value="${jarDest}/tap_src_${version}.jar" />
<property name="javadocJarFile" value="${jarDest}/tap_javadoc_${version}.jar" />
<property name="testsDir" value="test" />
<property name="adqlJunitReportsDir" value="reports/adql" />
<property name="uwsJunitReportsDir" value="reports/uws" />
<property name="tapJunitReportsDir" value="reports/tap" />
<property name="cdsJunitReportsDir" value="reports/cds" />
<fail message="The property POSTGRES must be set! It provides the path toward a directory or a JAR which contains all classes inside org.postgresql.">
<condition><not><isset property="POSTGRES"/></not></condition>
</fail>
<fail message="The property SERVLET-API must be set! It provides the path toward a directory or a JAR which contains all classes inside javax.servlet.">
<condition><not><isset property="SERVLET-API"/></not></condition>
</fail>
<fail message="The property JUNIT-API must be set! It provides the path toward a directory or a JAR which contains all classes needed to use JUnit.">
<condition><not><isset property="JUNIT-API"/></not></condition>
</fail>
<fail message="The property JNDI-API must be set! It provides the path toward a directory or a JAR which contains all classes needed to use Simple-JNDI.">
<condition><not><isset property="JNDI-API"/></not></condition>
</fail>
<!-- JAVA VERSION COMPATIBILITY -->
<property name="ant.build.javac.source" value="1.7"/>
<property name="ant.build.javac.target" value="1.7"/>
<!-- CLASSPATHS -->
<path id="tap.classpath">
<pathelement location="${commonsIOJar}" />
<pathelement location="${commonsFileUploadJar}" />
<pathelement location="${slf4jApiJar}" />
<pathelement location="${jsonJar}" />
<pathelement location="${stilJar}" />
<pathelement location="${POSTGRES}" />
<pathelement location="${SERVLET-API}" />
</path>
<path id="h2.classpath">
<pathelement location="${h2Jar}" />
<pathelement location="${jtsJar}" />
<pathelement location="${spatial4jJar}" />
<pathelement location="${astroh2Jar}" />
</path>
<path id="junit.class.path">
<pathelement path="${JNDI-API}" />
<pathelement path="${JUNIT-API}" />
<path refid="tap.classpath" />
<pathelement location="bin" />
<path refid="h2.classpath" />
<pathelement location="${sqliteJar}" />
</path>
<echo>TAP LIBRARY VERSION = ${version}</echo>
<!-- BUILD ALL TASK -->
<target name="buildAll" depends="buildLibAndSrc,buildJavadoc"
description="Build three JARs: the library (classes), its sources and its Javadoc. Then, except the JAR, all the compiled javadoc files are deleted." >
<antcall target="cleanJavadocBuild" />
</target>
<target name="cleanAll" depends="clean,cleanJavadoc,cleanJUnitReports" description="Delete all files generated by this ANT file for the set version." />
<!-- JUNIT VALIDATION -->
<target name="cleanJUnitReports" description="Clean the JUnit reports directory of the ADQL, UWS and TAP library ONLY.">
<delete dir="${adqlJunitReportsDir}" failonerror="false" />
<delete dir="${uwsJunitReportsDir}" failonerror="false" />
<delete dir="${tapJunitReportsDir}" failonerror="false" />
<delete dir="${cdsJunitReportsDir}" failonerror="false" />
</target>
<target name="junitValidation" depends="cleanJUnitReports,compileJUnit" description="Executes all JUnit tests before building the library and stop ANT at any error.">
<mkdir dir="${adqlJunitReportsDir}"/>
<mkdir dir="${uwsJunitReportsDir}"/>
<mkdir dir="${tapJunitReportsDir}"/>
<mkdir dir="${cdsJunitReportsDir}"/>
<junit fork="true" errorproperty="testsFailure" failureproperty="testsFailure">
<classpath refid="junit.class.path" />
<classpath>
<pathelement location="${compileDir}" />
<pathelement location="${junitBuildDir}" />
</classpath>
<formatter type="brief" usefile="yes" />
<batchtest todir="${adqlJunitReportsDir}">
<fileset dir="${testsDir}" includes="adql/**/Test*.java" />
</batchtest>
<batchtest todir="${uwsJunitReportsDir}">
<fileset dir="${testsDir}" includes="uws/**/Test*.java" />
</batchtest>
<batchtest todir="${tapJunitReportsDir}">
<fileset dir="${testsDir}" includes="tap/**/Test*.java" />
</batchtest>
<batchtest todir="${cdsJunitReportsDir}">
<fileset dir="${testsDir}" includes="cds/**/Test*.java" />
</batchtest>
</junit>
<delete dir="${junitBuildDir}" failonerror="false" />
<fail if="${testsFailure}" message="Failed JUnit validation for ADQL, UWS or TAP Lib.!" />
</target>
<target name="compileJUnit" depends="compileLib" description="Build all the classes to test the TAP library.">
<mkdir dir="${junitBuildDir}" />
<javac destdir="${junitBuildDir}" includes="${includesList}" includeantruntime="false" encoding="utf8" bootclasspath="${tap.bootclasspath}" debug="true">
<src path="${testDir}" />
<classpath refid="junit.class.path" />
<classpath refid="tap.classpath" />
<classpath>
<pathelement location="${compileDir}" />
</classpath>
</javac>
</target>
<!-- LIB & SOURCES -->
<target name="clean" description="Delete the JARs for the library (classes) and for its sources for the set version.">
<delete file="${libJarFile}" failonerror="false" />
<delete file="${srcJarFile}" failonerror="false" />
<delete dir="${compileDir}" failonerror="false" />
<delete dir="${junitBuildDir}" failonerror="false" />
</target>
<target name="compileLib" depends="clean" description="Build all the classes of the TAP library. This target is particularly usefull because it lets highlighting missing dependencies.">
<mkdir dir="${compileDir}" />
<javac destdir="${compileDir}" srcdir="${srcDir}" includes="${includesList}" includeantruntime="false" encoding="utf8" debug="true">
<classpath refid="tap.classpath" />
</javac>
</target>
<target name="buildLib" depends="compileLib,junitValidation" description="After 'clean', build the library JAR (only classes).">
<echo>Generate the library:</echo>
<jar basedir="${classesDir}" destfile="${libJarFileWithSTIL}" includes="${includesList}">
<zipfileset src="${jsonJar}" excludes="META-INF/*" />
<zipfileset src="${commonsIOJar}" excludes="META-INF/**" />
<zipfileset src="${commonsFileUploadJar}" excludes="META-INF/**" />
<zipfileset src="${stilJar}" excludes="META-INF/*" />
<zipfileset dir="${srcDir}" includes="${licensePath}" />
</jar>
<jar basedir="${classesDir}" destfile="${libJarFile}" includes="${includesList}">
<zipfileset src="${jsonJar}" excludes="META-INF/**" />
<zipfileset src="${commonsIOJar}" excludes="META-INF/**" />
<zipfileset src="${commonsFileUploadJar}" excludes="META-INF/**" />
<zipfileset dir="${srcDir}" includes="${licensePath}" />
</jar>
<delete dir="${compileDir}" failonerror="true" />
</target>
<target name="buildLibAndSrc" depends="buildLib" description="After 'clean' and 'buildLib', build the sources JAR (only .java).">
<jar compress="false" destfile="${srcJarFileWithSTIL}">
<zipfileset dir="${srcDir}" includes="${includesList},${licensePath}" prefix="${srcDir}" />
<zipfileset dir="${libDir}" includes="${jsonJarName}" fullPath="${jsonJar}" />
<zipfileset dir="${libDir}" includes="${commonsIOJarName}" fullPath="${commonsIOJar}" />
<zipfileset dir="${libDir}" includes="${commonsFileUploadJarName}" fullPath="${commonsFileUploadJar}" />
<zipfileset dir="${libDir}" includes="${stilJarName}" fullPath="${stilJar}" />
</jar>
<jar compress="false" destfile="${srcJarFile}">
<zipfileset dir="${srcDir}" includes="${includesList},${licensePath}" prefix="${srcDir}" />
<zipfileset dir="${libDir}" includes="${jsonJarName}" fullPath="${jsonJar}" />
<zipfileset dir="${libDir}" includes="${commonsIOJarName}" fullPath="${commonsIOJar}" />
<zipfileset dir="${libDir}" includes="${commonsFileUploadJarName}" fullPath="${commonsFileUploadJar}" />
</jar>
</target>
<!-- JAVADOC -->
<target name="cleanJavadocBuild" description="Delete the whole generated/compiled Javadoc directory.">
<delete dir="${javadocDir}" failonerror="false" />
</target>
<target name="cleanJavadoc" depends="cleanJavadocBuild" description="Delete the Javadoc JAR AND the whole generated/compiled Javadoc directory.">
<delete file="${jarDest}/${javadocJarFile}" failonerror="false" />
</target>
<target name="compileJavadoc" depends="cleanJavadoc" description="After 'cleanJavadoc', compile the whole Javadoc.">
<javadoc encoding="utf-8" charset="utf-8" docencoding="utf-8" access="protected" author="true" destdir="${javadocDir}" nodeprecated="false" nodeprecatedlist="false" noindex="false" nonavbar="false" notree="false" source="1.7" splitindex="true" use="true" version="true">
<packageset dir="${srcDir}" includes="${includesList}" />
<classpath refid="tap.classpath" />
</javadoc>
</target>
<target name="buildJavadoc" depends="compileJavadoc" description="After 'compileJavadoc', build the Javadoc JAR.">
<jar destfile="${javadocJarFile}" basedir="${javadocDir}" />
</target>
</project>