-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuild.xml
379 lines (326 loc) · 13.9 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
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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
<?xml version="1.0"?>
<!-- Build file for automated server side building of Raddose3D -->
<project name="RADDOSE 3D" default="build" basedir=".">
<!-- Directory path of compiled classes(i.e *.class) -->
<path id="classes">
<pathelement location="bin"/>
</path>
<!-- Get git tree depth -->
<exec executable="git" outputproperty="repository.revision">
<arg value="rev-list" />
<arg value="--count" />
<arg value="HEAD" />
</exec>
<target name="clean">
<delete dir="bin"/>
<delete dir="deploy"/>
</target>
<target name="versionize">
<echo message="Raddose3D git repository age is ${repository.revision}" />
<!-- Write tree depth to Version.java -->
<exec executable="/bin/sed" failonerror="false">
<arg value="-i"/>
<arg value="s/?---?/${repository.revision}/g"/>
<arg value="src/se/raddo/raddose3D/Version.java"/>
</exec>
</target>
<target name="build">
<antcall target="versionize"/>
<!-- Standard compile run, no warnings -->
<mkdir dir="bin"/>
<javac srcdir="src" destdir="bin"
debug="false" includes="**/*.java" includeantruntime="false" source="1.8" target="1.8">
<classpath refid="antlr" />
<classpath refid="math3" />
<classpath refid="testng" />
<classpath refid="mockito" />
<classpath refid="selenium" />
</javac>
</target>
<target name="build-debug">
<antcall target="versionize"/>
<!-- Standard compile run, no warnings -->
<mkdir dir="bin"/>
<javac srcdir="src" destdir="bin"
debug="true" includes="**/*.java" includeantruntime="false">
<classpath refid="antlr" />
<classpath refid="math3" />
<classpath refid="testng" />
<classpath refid="mockito" />
<classpath refid="selenium" />
</javac>
</target>
<target name="build-warn">
<antcall target="versionize"/>
<!-- Compile, do show warnings -->
<mkdir dir="bin"/>
<javac srcdir="src" destdir="bin"
debug="false" includes="**/*.java" includeantruntime="false"
deprecation="true">
<compilerarg value="-Xlint"/>
<classpath refid="antlr" />
<classpath refid="math3" />
<classpath refid="testng" />
<classpath refid="mockito" />
<classpath refid="selenium" />
</javac>
</target>
<target name="build-debug-warn">
<antcall target="versionize"/>
<!-- Compile, do show warnings -->
<mkdir dir="bin"/>
<javac srcdir="src" destdir="bin"
debug="true" includes="**/*.java" includeantruntime="false"
deprecation="true">
<compilerarg value="-Xlint"/>
<classpath refid="antlr" />
<classpath refid="math3" />
<classpath refid="testng" />
<classpath refid="mockito" />
<classpath refid="selenium" />
</javac>
</target>
<target name="jar">
<!-- Get reported Raddose3D revision number -->
<java classname="se.raddo.raddose3D.Version" classpath="bin" failonerror="true" outputproperty="raddose.version"/>
<echo message="Reported Raddose3D version is ${raddose.version}" />
<jar destfile="raddose3d.jar" basedir="bin" excludes="se/raddo/raddose3D/tests/** se/raddo/raddose3D/server/**">
<zipfileset includes="**/*.class" src="lib/antlr-3.4/antlr-3.4-cutdown.jar"/>
<zipfileset includes="**/*.class" src="lib/commons-math3-3.6.1/commons-math3-3.6.1.jar"/>
<zipfileset includes="**/*.class" src="lib/selenium/client-combined-3.14.0.jar"/>
<zipfileset includes="**/*.class" src="lib/selenium/libs/byte-buddy-1.8.15.jar"/>
<zipfileset includes="**/*.class" src="lib/selenium/libs/commons-codec-1.10.jar"/>
<zipfileset includes="**/*.class" src="lib/selenium/libs/commons-exec-1.3.jar"/>
<zipfileset includes="**/*.class" src="lib/selenium/libs/commons-logging-1.2.jar"/>
<zipfileset includes="**/*.class" src="lib/selenium/libs/guava-25.0-jre.jar"/>
<zipfileset includes="**/*.class" src="lib/selenium/libs/httpclient-4.5.5.jar"/>
<zipfileset includes="**/*.class" src="lib/selenium/libs/httpcore-4.4.9.jar"/>
<zipfileset includes="**/*.class" src="lib/selenium/libs/okhttp-3.10.0.jar"/>
<zipfileset includes="**/*.class" src="lib/selenium/libs/okio-1.14.1.jar"/>
<fileset dir=".">
<include name="constants/EnergyCoefsLow.txt" />
<include name="constants/EnergyCoefsMed.txt" />
<include name="constants/EnergyCoefsHigh.txt" />
<include name="constants/MuCalcConstants.txt" />
<include name="constants/low_overvoltage.csv" />
<include name="constants/high_overvoltage.csv" />
<include name="constants/fullelsepa.csv" />
<include name="constants/below_20000/*.csv" />
<include name="constants/above_20000/*.csv" />
<include name="constants/auger_linewidths/*.csv" />
<include name="constants/fl_linewidths/*.csv" />
</fileset>
<manifest>
<attribute name="Main-Class" value="se.raddo.raddose3D.RD3D"/>
<attribute name="Implementation-Vendor" value="E. F. Garman group"/>
<attribute name="Implementation-Title" value="RADDOSE-3D"/>
<attribute name="Implementation-Version" value="${raddose.version}"/>
</manifest>
</jar>
</target>
<target name="jar-osgi">
<!-- Get reported Raddose3D revision number -->
<java classname="se.raddo.raddose3D.Version" classpath="bin" failonerror="true" outputproperty="raddose.version"/>
<echo message="Reported Raddose3D version is ${raddose.version}" />
<jar destfile="raddose3d-osgi.jar" basedir="bin" excludes="se/raddo/raddose3D/tests/** se/raddo/raddose3D/server/**">
<zipfileset includes="**/*.class" src="lib/antlr-3.4/antlr-3.4-cutdown.jar"/>
<fileset dir=".">
<include name="constants/MuCalcConstants.txt" />
<include name="constants/EnergyCoefsLow.txt" />
<include name="constants/EnergyCoefsMed.txt" />
<include name="constants/EnergyCoefsHigh.txt" />
<include name="constants/low_overvoltage.csv" />
<include name="constants/high_overvoltage.csv" />
<include name="constants/fullelsepa.csv" />
<include name="constants/below_20000/*.csv" />
<include name="constants/above_20000/*.csv" />
<include name="constants/auger_linewidths/*.csv" />
<include name="constants/fl_linewidths/*.csv" />
</fileset>
<manifest>
<attribute name="Implementation-Vendor" value="E. F. Garman group"/>
<attribute name="Implementation-Title" value="RADDOSE-3D"/>
<attribute name="Implementation-Version" value="${raddose.version}"/>
<attribute name="Bundle-ManifestVersion" value="2"/>
<attribute name="Bundle-SymbolicName" value="se.raddo.raddose3D; singleton:=true"/>
<attribute name="Bundle-Version" value="${raddose.version}"/>
<attribute name="Bundle-Name" value="RADDOSE 3D"/>
<attribute name="Bundle-Description" value="time- and space-resolved modelling of dose in macromolecular crystallography"/>
<attribute name="Bundle-DocURL" value="http://raddo.se/"/>
<attribute name="Bundle-Copyright" value="E. F. Garman group"/>
<attribute name="Import-Package" value="org.apache.commons.math3.analysis.function;version=3.6.1,org.apache.commons.math3.distribution;version=3.6.1"/>
<attribute name="Export-Package" value="se.raddo.raddose3D"/>
</manifest>
</jar>
</target>
<target name="jar-server">
<!-- Get reported Raddose3D revision number -->
<java classname="se.raddo.raddose3D.Version" classpath="bin" failonerror="true" outputproperty="raddose.version"/>
<echo message="Reported Raddose3D version is ${raddose.version}" />
<jar destfile="raddose3d-server.jar" basedir="bin" excludes="se/raddo/raddose3D/tests/**">
<zipfileset includes="**/*.class" src="lib/antlr-3.4/antlr-3.4-cutdown.jar"/>
<zipfileset includes="**/*.class" src="lib/commons-math3-3.6.1/commons-math3-3.6.1.jar"/>
<!-- do not bundle mysql connector. Users have to install platform dependent binary build.
<zipfileset includes="**/*.class" src="lib/mysql-connector-java-5.1.22/mysql-connector-java-5.1.22-bin.jar"/>
-->
<fileset dir=".">
<include name="constants/MuCalcConstants.txt" />
<include name="constants/EnergyCoefsLow.txt" />
<include name="constants/EnergyCoefsMed.txt" />
<include name="constants/EnergyCoefsHigh.txt" />
<include name="constants/low_overvoltage.csv" />
<include name="constants/high_overvoltage.csv" />
<include name="constants/fullelsepa.csv" />
<include name="constants/below_20000/*.csv" />
<include name="constants/above_20000/*.csv" />
<include name="constants/auger_linewidths/*.csv" />
<include name="constants/fl_linewidths/*.csv" />
</fileset>
<manifest>
<attribute name="Main-Class" value="se.raddo.raddose3D.server.RaddoseServer"/>
<attribute name="Implementation-Vendor" value="E. F. Garman group"/>
<attribute name="Implementation-Title" value="RADDOSE-3D Server"/>
<attribute name="Implementation-Version" value="${raddose.version}"/>
</manifest>
</jar>
</target>
<target name="bintray-deploy">
<java classname="se.raddo.raddose3D.Version" classpath="bin" failonerror="true" outputproperty="raddose.version"/>
<echo message="Prepare deployment of version ${raddose.version} to bintray"/>
<copy file="raddose3d.jar" tofile="deploy/v${raddose.version}/raddose3d-${repository.revision}.jar" preservelastmodified="true"/>
<copy file="raddose3d-osgi.jar" tofile="deploy/v${raddose.version}/raddose3d-${repository.revision}-osgi.jar" preservelastmodified="true"/>
<copy file="raddose3d-server.jar" tofile="deploy/v${raddose.version}/raddose3d-${repository.revision}-server.jar" preservelastmodified="true"/>
</target>
<target name="javadoc">
<!-- Create Javadoc documentation in folder doc -->
<tstamp>
<format property="timestamp" pattern="dd.MM.yyyy HH:mm:ss"/>
</tstamp>
<echo message="Source revision is ${repository.revision}" />
<echo message="Time is ${timestamp}" />
<mkdir dir="doc"/>
<javadoc destdir="doc"
author="true"
version="true"
use="true"
windowtitle="Raddose3D">
<fileset dir="src" defaultexcludes="yes">
<include name="**/*.java"/>
<exclude name="**/*Test*.java"/>
</fileset>
<classpath refid="antlr" />
<classpath refid="math3" />
<classpath refid="testng" />
<classpath refid="mockito" />
<bottom><![CDATA[<br/>Documentation for source <em>revision ${repository.revision}, created on ${timestamp}</em>]]></bottom>
</javadoc>
</target>
<!-- Directory for TestNG, checkstyle, PMD and FindBugs reports -->
<property name="report.dir" value="reports"/>
<target name="test">
<mkdir dir="${report.dir}"/>
<testng outputdir="${report.dir}" classpathref="classes" excludedgroups="advanced" haltOnfailure="true">
<xmlfileset dir="." includes="testng.xml"/>
<classpath refid="antlr" />
<classpath refid="math3" />
<classpath refid="mockito" />
</testng>
</target>
<target name="test-all">
<mkdir dir="${report.dir}"/>
<testng outputdir="${report.dir}" classpathref="classes" configFailurePolicy="continue" haltOnfailure="true">
<xmlfileset dir="." includes="testng.xml"/>
<classpath refid="antlr" />
<classpath refid="math3" />
<classpath refid="mockito" />
</testng>
</target>
<target name="checkstyle">
<mkdir dir="${report.dir}"/>
<checkstyle config="lib/checkstyle-5.6/raddose_checks.xml" failOnViolation="false">
<fileset dir="src">
<include name="**/*.java"/>
<exclude name="se/raddo/raddose3D/parser/InputfileLexer.java"/>
<exclude name="se/raddo/raddose3D/parser/InputfileParser.java"/>
<exclude name="se/raddo/raddose3D/tests/**/*"/>
</fileset>
<!-- <formatter type="plain"/> would print to screen -->
<formatter type="xml" toFile="${report.dir}/checkstyle_errors.xml"/>
</checkstyle>
</target>
<target name="pmd">
<mkdir dir="${report.dir}"/>
<taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpathref="pmd.classpath"/>
<pmd shortFilenames="true">
<sourceLanguage name="java" version="1.6"/>
<ruleset>lib/pmd-5.1.1/raddose-ruleset.xml</ruleset>
<formatter type="xml" toFile="${report.dir}/pmd_errors.xml"/>
<fileset dir="src">
<include name="**/*.java"/>
<exclude name="se/raddo/raddose3D/parser/InputfileLexer.java"/>
<exclude name="se/raddo/raddose3D/parser/InputfileParser.java"/>
<exclude name="se/raddo/raddose3D/tests/**/*"/>
</fileset>
</pmd>
</target>
<property name="findbugs.home" value="lib/findbugs-2.0.3" />
<target name="findbugs">
<mkdir dir="${report.dir}"/>
<taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpathref="findbugs.classpath" />
<findbugs home="${findbugs.home}"
output="xml:withMessages"
outputFile="${report.dir}/findbugs.xml"
excludeFilter="${findbugs.home}/raddose-exclusions.xml"
effort="max">
<fileset dir="bin">
<include name="**/*.class"/>
<exclude name="se/raddo/raddose3D/parser/**/*"/>
</fileset>
<auxClasspath path="${basedir}/lib/antlr-3.4/antlr-3.4-cutdown.jar"/>
<auxClasspath path="${basedir}/lib/commons-math3-3.6.1/commons-math3-3.6.1.jar"/>
<auxClasspath path="${basedir}/lib/testng-6.8/testng-6.8.jar"/>
<auxClasspath path="${basedir}/lib/mockito-1.9.5/mockito-all-1.9.5.jar"/>
<auxClasspath path="${basedir}/bin"/>
<sourcePath path="${basedir}/src" />
</findbugs>
</target>
<taskdef resource="testngtasks" classpath="lib/testng-6.8/testng-6.8.jar"/>
<taskdef resource="checkstyletask.properties" classpath="lib/checkstyle-5.6/checkstyle-5.6-all.jar"/>
<path id="math3">
<fileset dir="lib/commons-math3-3.6.1">
<include name="*.jar"/>
</fileset>
</path>
<path id="antlr">
<fileset dir="lib/antlr-3.4">
<include name="*.jar"/>
</fileset>
</path>
<path id="testng">
<fileset dir="lib/testng-6.8">
<include name="*.jar"/>
</fileset>
</path>
<path id="mockito">
<fileset dir="lib/mockito-1.9.5">
<include name="*.jar"/>
</fileset>
</path>
<path id="selenium">
<fileset dir="lib/selenium">
<include name="*.jar"/>
</fileset>
</path>
<path id="pmd.classpath">
<pathelement location="${build}"/>
<fileset dir="lib/pmd-5.1.1">
<include name="*.jar"/>
</fileset>
</path>
<path id="findbugs.classpath">
<pathelement location="${build}"/>
<fileset dir="lib/findbugs-2.0.3/lib">
<include name="*.jar"/>
</fileset>
</path>
</project>