forked from archiver-appliance/epicsarchiverap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
436 lines (409 loc) · 17.1 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
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
<?xml version="1.0" encoding="UTF-8"?>
<!-- ======================================================================
Apr 11, 2011 3:57:12 PM
epicsarchiverap
The EPICS archiver appliance
mshankar
====================================================================== -->
<project name="epicsarchiverap" default="wars">
<description>The build file for the EPICS archiver appliance.</description>
<property environment="env"/>
<property name="ver" value="0.0.1"/>
<property name="src" location="src/main"/>
<property name="classes" location="bin/"/>
<property name="stage" location="stage/"/>
<property name="lib" location="lib/"/>
<property name="docs" location="docs/"/>
<property name="wardest" location="../"/>
<property name="dist" location="../"/>
<property name="test.dir" location="src/test"/>
<property name="tomcathome" location="${env.TOMCAT_HOME}"/>
<condition property="log4jprops" value="-Dlog4j.configuration=log4j.properties.debug" else="-Dlog4j.configuration=log4j.properties">
<istrue value="${verboselogging}"/>
</condition>
<!-- Determine the site from the environment variable ARCHAPPL_SITEID. If this is not set, we assume the unit tests environment -->
<condition property="archapplsite" value="${env.ARCHAPPL_SITEID}" else="tests">
<isset property="env.ARCHAPPL_SITEID"/>
</condition>
<!-- Version consists of two parts - one is the version from the build.xml itself and the other is a BUILDS_ALL_TIME that typically comes from the Jenkins Version Number plugin -->
<!-- If env.BUILDS_ALL_TIME is not set, we use a timestamp -->
<tstamp>
<format property="build_date_time" pattern="dd-MMMM-yyyy'T'HH-mm-ss"/>
</tstamp>
<condition property="version" value="${ver}_${env.BUILDS_ALL_TIME}" else="${ver}_SNAPSHOT_${build_date_time}">
<isset property="env.BUILDS_ALL_TIME"/>
</condition>
<available file="src/sitespecific/${archapplsite}/build.xml" property="site_has_site_specific_build_xml">
</available>
<echo>Building the archiver appliance for the site ${archapplsite}</echo>
<target name="wars" depends="clean, retrieval_war, engine_war, etl_war, mgmt_war, generate_release_notes">
<tar destfile="${wardest}/archappl_v${version}.tar.gz" basedir="${wardest}" compression="gzip" includes="mgmt.war engine.war etl.war retrieval.war">
<tarfileset dir="${docs}/samples" filemode="755">
<include name="quickstart.sh"/>
</tarfileset>
<tarfileset dir=".">
<include name="LICENSE"/>
<include name="NOTICE"/>
<include name="*License.txt"/>
<include name="RELEASE_NOTES"/>
</tarfileset>
<tarfileset dir="${docs}/samples" filemode="755" prefix="install_scripts">
<include name="sampleStartup.sh"/>
<include name="deployMultipleTomcats.py"/>
<include name="addMysqlConnPool.py"/>
<include name="single_machine_install.sh"/>
</tarfileset>
<tarfileset dir="${docs}/samples/site_specific_content" prefix="sample_site_specific_content">
<include name="template_changes.html"/>
</tarfileset>
<tarfileset dir="${docs}/samples/site_specific_content/img" prefix="sample_site_specific_content/img">
<include name="*.png"/>
</tarfileset>
<tarfileset dir="${src}/org/epics/archiverappliance/config/persistence" prefix="install_scripts" >
<include name="*.sql"/>
</tarfileset>
</tar>
</target>
<target name="retrieval_war" depends="compile, stage, sitespecificbuild">
<copy todir="${classes}">
<fileset dir="src/sitespecific/${archapplsite}/classpathfiles">
</fileset>
</copy>
<war destfile="${wardest}/retrieval.war" webxml="${src}/org/epics/archiverappliance/retrieval/WEB-INF/web.xml">
<zipfileset dir="${stage}/org/epics/archiverappliance/staticcontent" prefix="ui/comm"/>
<zipfileset dir="${stage}/org/epics/archiverappliance/retrieval/staticcontent" prefix="ui" followsymlinks="no"/>
<classes dir="${classes}"/>
<lib dir="${lib}">
<include name="*.jar"/>
<exclude name="servlet-api.jar"/>
</lib>
</war>
</target>
<target name="engine_war" depends="compile, stage, sitespecificbuild">
<copy todir="${classes}">
<fileset dir="src/sitespecific/${archapplsite}/classpathfiles">
</fileset>
</copy>
<war destfile="${wardest}/engine.war" webxml="${src}/org/epics/archiverappliance/engine/WEB-INF/web.xml">
<zipfileset dir="${stage}/org/epics/archiverappliance/staticcontent" prefix="ui/comm"/>
<zipfileset dir="${lib}/native/linux-x86" prefix="WEB-INF/lib/native/linux-x86" includes="caRepeater" filemode="755"/>
<zipfileset dir="${lib}/native/linux-x86_64" prefix="WEB-INF/lib/native/linux-x86_64" includes="caRepeater" filemode="755"/>
<zipfileset dir="${lib}/native" prefix="WEB-INF/lib/native" includes="**/*.so"/>
<classes dir="${classes}"/>
<lib dir="${lib}">
<include name="*.jar"/>
<exclude name="servlet-api.jar"/>
</lib>
</war>
</target>
<target name="etl_war" depends="compile, stage, sitespecificbuild">
<copy todir="${classes}">
<fileset dir="src/sitespecific/${archapplsite}/classpathfiles">
</fileset>
</copy>
<war destfile="${wardest}/etl.war" webxml="${src}/org/epics/archiverappliance/etl/WEB-INF/web.xml">
<zipfileset dir="${stage}/org/epics/archiverappliance/staticcontent" prefix="ui/comm"/>
<classes dir="${classes}"/>
<lib dir="${lib}">
<include name="*.jar"/>
<exclude name="servlet-api.jar"/>
</lib>
</war>
</target>
<target name="mgmt_war" depends="compile, stage, sitespecificbuild, javadoc">
<copy todir="${classes}">
<fileset dir="src/sitespecific/${archapplsite}/classpathfiles">
</fileset>
</copy>
<war destfile="${wardest}/mgmt.war" webxml="${src}/org/epics/archiverappliance/mgmt/WEB-INF/web.xml">
<zipfileset dir="${stage}/org/epics/archiverappliance/mgmt/staticcontent" prefix="ui" followsymlinks="no"/>
<zipfileset dir="${stage}/org/epics/archiverappliance/staticcontent" prefix="ui/comm"/>
<zipfileset dir="${src}/org/epics/archiverappliance/config/persistence" prefix="install" includes="*.sql"/>
<zipfileset dir="docs" prefix="ui/help"/>
<zipfileset dir="docs/samples" prefix="install" includes="deployMultipleTomcats.py"/>
<zipfileset dir="src/main/org/epics/archiverappliance/common/scripts" prefix="install/pbutils" filemode="755"/>
<classes dir="${classes}"/>
<lib dir="${lib}">
<include name="*.jar"/>
<exclude name="servlet-api.jar"/>
</lib>
</war>
</target>
<target name="sitespecificbuild" if="site_has_site_specific_build_xml" depends="stage">
<echo message="Calling site specific build for site ${archapplsite}"></echo>
<ant dir="src/sitespecific/${archapplsite}" inheritall="true"></ant>
</target>
<target name="generate_release_notes">
<exec executable="git" output="RELEASE_NOTES">
<arg value="log"/>
<arg value="--oneline"/>
<arg value="master"/>
</exec>
</target>
<target name="stage" depends="compile">
<mkdir dir="${stage}"/>
<copy todir="${stage}/org/epics/archiverappliance/staticcontent">
<fileset dir="${src}/org/epics/archiverappliance/staticcontent" followsymlinks="no"/>
</copy>
<copy todir="${stage}/org/epics/archiverappliance/retrieval/staticcontent">
<fileset dir="${src}/org/epics/archiverappliance/retrieval/staticcontent" followsymlinks="no"/>
</copy>
<!-- Zip up the web based viewer into a file called viewer.zip -->
<zip destfile="${stage}/org/epics/archiverappliance/retrieval/staticcontent/viewer.zip" basedir="svg_viewer">
</zip>
<copy todir="${stage}/org/epics/archiverappliance/mgmt/staticcontent">
<fileset dir="${src}/org/epics/archiverappliance/mgmt/staticcontent" followsymlinks="no"/>
</copy>
<echo file="${stage}/org/epics/archiverappliance/staticcontent/version.txt" append="false">Archiver Appliance Version ${version}
</echo>
</target>
<target name="compile">
<mkdir dir="${classes}"/>
<javac destdir="${classes}" includeantruntime="false" debug="true">
<src path="${src}"/>
<src path="${test.dir}"/>
<classpath>
<pathelement path="${classes}"/>
<fileset dir="lib/test">
<include name="**/*.jar"/>
</fileset>
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${tomcathome}/lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${tomcathome}/bin">
<include name="**/*.jar"/>
</fileset>
</classpath>
</javac>
</target>
<!-- The srconlycompile target exists only to make sure that code in the main subfolder does not include anything in the test subfolder
Periodically run this to make sure developers are honoring this division.
-->
<target name="srconlycompile" depends="clean">
<mkdir dir="${classes}"/>
<javac destdir="${classes}" includeantruntime="false" debug="true">
<src path="${src}"/>
<classpath>
<pathelement path="${classes}"/>
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${tomcathome}/lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${tomcathome}/bin">
<include name="**/*.jar"/>
</fileset>
</classpath>
</javac>
</target>
<target name="clean">
<delete dir="${classes}"/>
<delete dir="${stage}"/>
<delete file="${wardest}/retrieval.war"/>
<delete file="${wardest}/engine.war"/>
<delete file="${wardest}/etl.war"/>
<delete file="${wardest}/mgmt.war"/>
<delete>
<fileset dir="${wardest}" includes="archappl_v*.tar.gz"/>
</delete>
<delete file="RELEASE_NOTES"/>
</target>
<target name="test" depends="wars">
<junit fork="yes" haltonfailure="false" printsummary="on" maxmemory="3584M">
<batchtest fork="yes">
<fileset dir="${test.dir}">
<include name="**/*Test.java" />
<include name="**/Test*.java" />
</fileset>
</batchtest>
<formatter type="xml" usefile="yes" />
<classpath>
<pathelement path="${classes}"/>
<pathelement path="."/>
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${tomcathome}/lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${tomcathome}/bin">
<include name="**/*.jar"/>
</fileset>
<fileset dir="lib/test">
<include name="**/*.jar"/>
</fileset>
</classpath>
<assertions>
<enable/>
</assertions>
<jvmarg value="-Dlog4j.configuration=log4j.properties"/>
<env key="ARCHAPPL_SHORT_TERM_FOLDER" path="./sts"/>
<env key="ARCHAPPL_MEDIUM_TERM_FOLDER" path="./mts"/>
<env key="ARCHAPPL_LONG_TERM_FOLDER" path="./lts"/>
</junit>
</target>
<target name="singletest" depends="compile" description="Runs the test you specify on the command line with -Dtest=. For example, ant -Dtest=DBRTypeTest singletest">
<junit fork="yes" haltonfailure="yes" printsummary="on" showoutput="yes" maxmemory="4096M">
<batchtest fork="yes">
<fileset dir="${test.dir}">
<include name="**/${test}.java"/>
</fileset>
</batchtest>
<formatter type="plain" usefile="no" />
<classpath>
<pathelement path="${classes}"/>
<pathelement path="."/>
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${tomcathome}/lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${tomcathome}/bin">
<include name="**/*.jar"/>
</fileset>
<fileset dir="lib/test">
<include name="**/*.jar"/>
</fileset>
</classpath>
<assertions>
<enable/>
</assertions>
<jvmarg value="${log4jprops}"/>
<env key="ARCHAPPL_SHORT_TERM_FOLDER" path="./sts"/>
<env key="ARCHAPPL_MEDIUM_TERM_FOLDER" path="./mts"/>
<env key="ARCHAPPL_LONG_TERM_FOLDER" path="./lts"/>
</junit>
</target>
<target name="debug_singletest" depends="compile" description="Runs the test you specify on the command line and stops it so that we can attach from a remote eclipse plugin">
<junit fork="yes" haltonfailure="yes" printsummary="on" showoutput="yes" maxmemory="4096M">
<batchtest fork="yes">
<fileset dir="${test.dir}">
<include name="**/${test}.java"/>
</fileset>
</batchtest>
<formatter type="plain" usefile="no" />
<classpath>
<pathelement path="${classes}"/>
<pathelement path="."/>
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${tomcathome}/lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${tomcathome}/bin">
<include name="**/*.jar"/>
</fileset>
<fileset dir="lib/test">
<include name="**/*.jar"/>
</fileset>
</classpath>
<assertions>
<enable/>
</assertions>
<jvmarg value="${log4jprops}"/>
<jvmarg value="-Xdebug"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=17667,server=y,suspend=y"/>
</junit>
</target>
<target name="javadoc" depends="compile">
<delete failonerror="false">
<fileset dir="docs/api">
</fileset>
</delete>
<mkdir dir="docs/api"/>
<!-- Generate a properties file that contains the mappings of the paths to BPLActions -->
<java classname="org.epics.archiverappliance.mgmt.BPLServlet" output="docs/api/mgmtpathmappings.txt">
<classpath>
<pathelement path="${classes}"/>
<pathelement path="."/>
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${tomcathome}/lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${tomcathome}/bin">
<include name="**/*.jar"/>
</fileset>
<fileset dir="lib/test">
<include name="**/*.jar"/>
</fileset>
</classpath>
</java>
<javadoc sourcepath="src/main"
destdir="docs/api"
author="true"
version="true"
use="true"
linkoffline="http://docs.oracle.com/javase/7/docs/api http://docs.oracle.com/javase/7/docs/api/package-list">
<classpath>
<pathelement path="${classes}"/>
<fileset dir="lib/test">
<include name="**/*.jar"/>
</fileset>
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${tomcathome}/lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${tomcathome}/bin">
<include name="**/*.jar"/>
</fileset>
</classpath>
<taglet name="org.epics.archiverappliance.taglets.BPLActionTaglet" path="lib/test/BPLTaglets.jar">
</taglet>
<taglet name="org.epics.archiverappliance.taglets.BPLActionParamTaglet">
</taglet>
<taglet name="org.epics.archiverappliance.taglets.BPLActionEndTaglet">
</taglet>
</javadoc>
<copy file="LICENSE" todir="docs"></copy>
<copy file="src/main/edu/stanford/slac/archiverappliance/PB/EPICSEvent.proto" todir="docs"></copy>
<!-- Generate the scriptables from the javadoc taglet processing -->
<java classname="org.epics.archiverappliance.common.taglets.ProcessMgmtScriptables">
<classpath>
<pathelement path="${classes}"/>
<pathelement path="."/>
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${tomcathome}/lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${tomcathome}/bin">
<include name="**/*.jar"/>
</fileset>
<fileset dir="lib/test">
<include name="**/*.jar"/>
</fileset>
</classpath>
</java>
</target>
<target name="sync_staticcontent_headers_footers" depends="compile">
<!-- Syncs the headers, footers etc in the mgmt/ui/*.html files.
These elements are copied from index.html to the other files.
Please remember to check in after running this.
-->
<java classname="org.epics.archiverappliance.mgmt.bpl.SyncStaticContentHeadersFooters">
<arg value="./src/main/org/epics/archiverappliance/mgmt/staticcontent/index.html"/>
<arg value="./src/main/org/epics/archiverappliance/mgmt/staticcontent/"/>
<classpath>
<pathelement path="${classes}"/>
<pathelement path="."/>
<fileset dir="lib/test">
<include name="**/*.jar"/>
</fileset>
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
</classpath>
</java>
</target>
</project>