-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildEclipse.xml
executable file
·398 lines (360 loc) · 20.1 KB
/
buildEclipse.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
<?xml version="1.0" encoding="UTF-8"?>
<!-- JFD DON'T DELETE edited by JFD -->
<!-- added memory setting for Java and Junit testing -->
<project name="wattos" default="jar" basedir=".">
<description>Builds, tests, and runs the project Wattos.</description>
<echo>Starting Ant with updated build file</echo>
<property file="wattos.properties" />
<!-- Added for for functionality. Requires an ant-contrib.jar in classpath. -->
<!-- Fedora 9:
<taskdef classpath="/usr/share/java/ant-contrib.jar" resource="net/sf/antcontrib/antlib.xml" />
-->
<!-- macOS: -->
<taskdef classpath="/Users/jd/workspace/wattos/lib/ant-contrib.jar" resource="net/sf/antcontrib/antlib.xml" />
<!-- systems where ant-contrib installs properly: -->
<taskdef resource="net/sf/antcontrib/antlib.xml" />
<!-- Set the below to development 0 or production 1-->
<property name="isProduction" value="0" />
<target name="init" description="init">
<if>
<equals arg1="${isProduction}" arg2="1" />
<then>
<echo message="Now in environment for production." />
<property name="servlet.web.machine" value="${servlet.web.machine.prod}" />
<property name="servlet.web.user" value="${servlet.web.user.prod}" />
<property name="servlet.web.dir" value="${servlet.web.dir.prod}" />
<property name="servlet.web.port" value="${servlet.web.port.prod}" />
<property name="home.web.machine" value="${home.web.machine.prod}" />
<property name="home.web.machine.looped" value="${home.web.machine.looped.prod}" />
<property name="home.web.port" value="${home.web.port.prod}" />
<property name="home.web.dir" value="${home.web.dir.prod}" />
<property name="home.web.user" value="${home.web.user.prod}" />
</then>
<else>
<echo message="Now in environment for development." />
<property name="servlet.web.machine" value="${servlet.web.machine.dev}" />
<property name="servlet.web.user" value="${servlet.web.user.dev}" />
<property name="servlet.web.dir" value="${servlet.web.dir.dev}" />
<property name="servlet.web.port" value="${servlet.web.port.dev}" />
<property name="home.web.machine" value="${home.web.machine.dev}" />
<property name="home.web.machine.looped" value="${home.web.machine.looped.dev}" />
<property name="home.web.port" value="${home.web.port.dev}" />
<property name="home.web.dir" value="${home.web.dir.dev}" />
<property name="home.web.user" value="${home.web.user.dev}" />
</else>
</if>
<echo message="servlet.web.machine : ${servlet.web.machine}" />
<echo message="servlet.web.user : ${servlet.web.user}" />
<echo message="servlet.web.dir : ${servlet.web.dir}" />
<echo message="servlet.web.port : ${servlet.web.port}" />
<echo message="home.web.machine : ${home.web.machine}" />
<echo message="home.web.port : ${home.web.port}" />
<echo message="home.web.dir : ${home.web.dir}" />
<echo message="home.web.user : ${home.web.user}" />
<echo message="home.web.machine.looped: ${home.web.machine.looped}" />
<property name="home.web.url" value="${home.web.machine}/${ant.project.name}" />
<property name="home.web.usermachine" value="${home.web.user}@${home.web.machine}" />
</target>
<!-- Is done automatically by ant build but can be used externally.
NB the debug settings.
-->
<target name="compile" description="compile" depends="init">
<mkdir dir="${build.dir}" />
<javac srcdir="${src.dir}" destdir="${build.dir}" debug="on" debuglevel="lines,vars,source">
<classpath>
<path path="${javac.classpath}" />
</classpath>
</javac>
<copy todir="${build.dir}">
<fileset dir="${src.dir}" includes="**/*.H" /> <!--For Wattos/Soup/Data/TOPOLOGY.H-->
<fileset dir="${src.dir}" includes="**/*.csv" />
<fileset dir="${src.dir}" includes="**/*.str" />
</copy>
</target>
<target name="clean" description="clean class files" depends="init">
<delete dir="${build.dir}" />
</target>
<target name="-init-macrodef-junit">
<macrodef name="junit" uri="http://www.netbeans.org/ns/web-project/2">
<attribute name="includes" default="**/*Test.java" />
<sequential>
<junit showoutput="true" fork="true" maxmemory="256m" dir="tmp_dir" failureproperty="tests.failed" errorproperty="tests.failed" jvm="${platform.java}">
<batchtest todir="${build.dir}">
<fileset dir="${test.test.dir}" includes="@{includes}" />
</batchtest>
<classpath>
<path path="${run.test.classpath}" />
</classpath>
<syspropertyset>
<propertyref prefix="test-sys-prop." />
<mapper type="glob" from="test-sys-prop.*" to="*" />
</syspropertyset>
<formatter type="brief" usefile="false" />
<formatter type="xml" />
</junit>
</sequential>
</macrodef>
</target>
<target name="-init-macrodef-java">
<macrodef name="java" uri="http://www.netbeans.org/ns/web-project/1">
<attribute name="classname" default="${main.class}" />
<attribute name="args" default="${application.args}" />
<element name="customize" optional="true" />
<sequential>
<java fork="true" maxmemory="256m" dir="tmp_dir" classname="@{classname}" jvm="${platform.java}">
<jvmarg line="${runmain.jvmargs}" />
<classpath>
<path path="${build.dir}:${javac.classpath}:${j2ee.platform.classpath}" />
</classpath>
<syspropertyset>
<propertyref prefix="run-sys-prop." />
<mapper type="glob" from="run-sys-prop.*" to="*" />
</syspropertyset>
<customize />
<arg line="@{args}" />
</java>
</sequential>
</macrodef>
</target>
<!--
====================
JAR BUILDING SECTION
====================
Use:
for resigning all jars. They need to be the same for WebApps such as Sjors.
-->
<target name="jar" depends="init,compile" description="Build JAR.">
<jar destfile="${jar.name}" basedir="${build.dir}" />
<!--
<signjar
alias="business"
storepass="secret"
keypass="test123"
keystore="${keystore}">
<fileset dir="lib"
includes="Wattos.jar" />
</signjar>
-->
</target>
<target name="jarsign" depends="init" description="Resign all jars">
<signjar alias="business" storepass="secret" keypass="test123" keystore="${keystore}">
<fileset dir="lib" includes="**.jar" excludes="JFlex.jar ant-contrib.jar" />
</signjar>
</target>
<!--
====================
MACRO FILE EXECUTION.
====================
<for list="FilterSTAR.wcf" param="fn">
<for list="ReadEntryMmCIF.wcf" param="fn">
<for list="CheckSurplus.wcf" param="fn">
<for list="WriteSQLDump.wcf" param="fn">
<for list="AddMissingAtoms.wcf" param="fn">
<for list="WriteEntryPDB.wcf" param="fn">
<for list="CheckAssignment.wcf" param="fn">
<for list="CheckAtomNomenclature.wcf" param="fn">
<for list="CalcDistConstrViolation.wcf" param="fn">
<for list="CalcDihConstrViolation.wcf" param="fn">
<for list="ReadEntryMmCIF.wcf" param="fn">
<for list="WriteEntryXplor.wcf" param="fn">
<for list="CalcDistConstrViolation.wcf,CalcDistance.wcf,CheckAssignment.wcf,CheckCompleteness.wcf,CheckSurplus.wcf,FilterSTAR.wcf,GetCoplanarBases.wcf,GetHydrogenBonds.wcf,ReadEntryPDB.wcf,QuitBeforeBegun.wcf,SetAtomNomenclatureToIUPAC.wcf,ShowClassification.wcf,Sleep.wcf,WriteEntryXplor.wcf" param="fn">
<replace file="${tmp.local.dir}/@{fn}.log" token="ERROR" value="ERROR" summary="true"/>
-->
<target name="macro_tests" depends="init" description="">
<echo message="Running in: ${test_data.local.dir}" />
<echo message="Output to : ${tmp.local.dir}" />
<!-- <echo message="classpath: ${build.dir}:${javac.classpath}:${j2ee.platform.classpath}"/>
-->
<for list="CheckCompleteness.wcf" param="fn">
<sequential>
<echo message="Executing macro: ${macros.local.dir}/@{fn}" />
<java jvm="${platform.java}" fork="true" failonerror="false" resultproperty="result" maxmemory="512m" classname="Wattos.CloneWars.UserInterface" dir="${test_data.local.dir}" input="${macros.local.dir}/@{fn}" output="${tmp.local.dir}/@{fn}.log" timeout="240000">
<!-- FAILS IN IDE <jvmarg line="-DWATTOSSCRIPT=${wattos.root}/${macros.local.dir}/@{fn}"/> -->
<arg line="-at -verbosity 9" />
<classpath>
<path path="${build.dir}:${javac.classpath}:${j2ee.platform.classpath}" />
</classpath>
</java>
<loadfile property="error_list" srcFile="${tmp.local.dir}/@{fn}.log">
<filterchain>
<linecontainsregexp>
<regexp pattern="(^ERROR)|(^Exception in thread)|(^\tat )" />
</linecontainsregexp>
</filterchain>
</loadfile>
<antcall target="report_errors" />
<echo />
<echo />
<echo message="Log file:" />
<!--
<loadfile property="contentLogFile"
srcFile="${tmp.local.dir}/@{fn}.log"/>
<echo message="${contentLogFile}"/>
-->
</sequential>
</for>
</target>
<target name="report_errors" if="error_list">
<echo message="${error_list}" />
</target>
<!--
======================
JAVADOC SECTION
======================
Can't use "linksource" as there's a bug http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4511110
trying with javadoc 1.5 as set in wattos.properties: platform.javadoc
-->
<target name="javadoc" depends="init,javadoc-build,javadoc-copy" description="Build Javadoc and copy some extra files from the src to doc dir" />
<target name="javadoc-build">
<mkdir dir="${dist.javadoc.dir}" />
<javadoc additionalparam="" access="private" author="true" breakiterator="true" destdir="${dist.javadoc.dir}" doctitle="Wattos" nodeprecated="false" nodeprecatedlist="false" noindex="false" nonavbar="false" notree="false" overview="${src.dir}/${ant.project.name}/overview.html" source="1.5" sourcepath="src" splitindex="true" use="true" useexternalfile="false" version="false" Windowtitle="${ant.project.name}">
<classpath>
<path path="${javac.classpath}" />
</classpath>
<packageset dir="${src.dir}" includes="*/**" />
</javadoc>
</target>
<!-- A couple of items should be moved along with the newly generated html -->
<target name="javadoc-copy" depends="init">
<copy todir="${dist.javadoc.dir}">
<fileset dir="${src.dir}" includes="**/*.gif **/*.str **/*.xls **/*.html **/*.csv" excludes="**/package.html" />
</copy>
</target>
<!-- Installation of production site jars including Wattos -->
<target name="install-jars" depends="jar">
<echo message="Installing Wattos jar(s) to production site: ${install.dir}" />
<scp todir="${servlet.web.user}@${servlet.web.machine}:${install.dir}" keyfile="${servlet.web.keyfile}" knownhosts="${servlet.web.knownhosts}" passphrase="${servlet.web.passphrase}" verbose="true">
<fileset dir="${lib.local.dir}" includes="Wattos.jar" />
</scp>
</target>
<!-- Installation of production site scripts -->
<target name="install-scripts">
<copy todir="${install.dir}/scripts" verbose="true">
<fileset dir="scripts" includes="*" />
</copy>
</target>
<!-- Installation of production site python code -->
<target name="install-python">
<copy todir="${install.dir}/python" verbose="true">
<fileset dir="python" includes="**" />
</copy>
</target>
<!--
======================
HOME SECTION
======================
-->
<target name="home" depends="init,jar,home-cp,home-doc-cp" description="Creates the Wattos home page with javadoc files." />
<target name="home-clean" depends="init" description="Fails to create new dirs so disabled until debugged.">
<input message="Sure you want to delete the Wattos webserver directory: ${home.web.dir}" validargs="y,n" addproperty="do.delete" />
<condition property="do.abort">
<equals arg1="n" arg2="${do.delete}" />
</condition>
<fail if="do.abort">Build aborted by user.</fail>
<sshexec host="${home.web.machine.looped}" username="${home.web.user}" keyfile="${home.web.keyfile}" knownhosts="${home.web.knownhosts}" passphrase="${home.web.passphrase}" command="\rm -rf ${home.web.dir}/*;mkdir ${home.web.dir}/doc;mkdir ${home.web.dir}/scripts;mkdir ${home.web.dir}/lib;mkdir ${home.web.dir}/macros">
</sshexec>
</target>
<target name="home-cp" depends="init">
<scp todir="${home.web.user}@${home.web.machine.looped}:${home.web.dir}" port="${home.web.port}" keyfile="${home.web.keyfile}" knownhosts="${home.web.knownhosts}" passphrase="${home.web.passphrase}" verbose="true">
<fileset dir="${home.local.dir}" />
</scp>
</target>
<target name="home-doc-cp" depends="init" description="takes a long time (3:29) to send these many files.">
<scp todir="${home.web.user}@${home.web.machine.looped}:${home.web.dir}/${doc.web.dir}" port="${home.web.port}" keyfile="${home.web.keyfile}" knownhosts="${home.web.knownhosts}" passphrase="${home.web.passphrase}">
<fileset dir="${doc.local.dir}" />
</scp>
</target>
<!--
======================
SERVLET SECTION
======================
-->
<target name="servlet-wattos-new-install" depends="init">
<echo message="Ensure that the tomcat and apache are already setup. As well as the production staging area." />
<copy todir="${wattos.production.local.dir}/WEB-INF/classes">
<fileset dir="build" />
</copy>
<!-- The Wattos code changes every now and then so it needs to be included live. Every now and then.
ISN'T THIS EXACTLY THE SAME AS THE ABOVE?
<copy todir="${wattos.production.local.dir}/WEB-INF/classes">
<fileset dir="${WS}/wattos/build"/>
</copy>
-->
<zip destfile="${wattos.war.file}">
<fileset dir="${wattos.production.local.dir}" />
</zip>
<echo message="toDir: ${servlet.web.user}@${servlet.web.machine}:${servlet.web.dir}"/>
<echo message="with port = ${servlet.web.port} and knownhosts=${servlet.web.knownhosts} passphrase=${servlet.web.passphrase} keyfile=${servlet.web.keyfile} "/>
<scp todir="${servlet.web.user}@${servlet.web.machine}:${servlet.web.dir}" keyfile="${servlet.web.keyfile}"
knownhosts="${servlet.web.knownhosts}" passphrase="${servlet.web.passphrase}" verbose="true" >
<fileset file="${wattos.war.file}" />
</scp>
</target>
<target name="servlet-install" depends="init,jar,servlet-jar-cp,servlet-resources-cp" description="Publishes the Wattos jar. Manual restart of server still needed.">
<echo message="Make sure the following two remote directories are open for writing:" />
<echo message="${servlet.web.usermachine}:${servlet.web.dir}/${servlet.lib.dir}" />
<echo message="${servlet.web.usermachine}:${servlet.web.dir}/${servlet.resource.remote.dir}" />
</target>
<target name="servlet-jar-cp" depends="init">
<echo message="Installing Wattos jar(s) to servlet engine: ${servlet.web.usermachine}:${servlet.web.dir}/${servlet.lib.dir}" />
<scp todir="${servlet.web.usermachine}:${servlet.web.dir}/${servlet.lib.dir}" port="${servlet.web.port}" keyfile="${servlet.web.keyfile}" knownhosts="${servlet.web.knownhosts}" passphrase="${servlet.web.passphrase}" verbose="true">
<fileset dir="${lib.local.dir}" includes="Wattos.jar" />
</scp>
</target>
<target name="servlet-resources-cp" depends="init">
<echo message="Installing giffies and html to servlet engine: ${servlet.web.usermachine}:${servlet.web.dir}/${servlet.resource.remote.dir}" />
<scp todir="${servlet.web.usermachine}:${servlet.web.dir}/${servlet.resource.remote.dir}" port="${servlet.web.port}" keyfile="${servlet.web.keyfile}" knownhosts="${servlet.web.knownhosts}" passphrase="${servlet.web.passphrase}" verbose="true">
<fileset dir="${servlet.resource.local.dir}" excludes=".svn" />
</scp>
</target>
<!--
====================
PROFILE EXECUTION.
====================
Failed to work with redirecting the output.
output="${tmp.local.dir}/${fn}.log"
-->
<target name="profile-wattos" depends="init" description="">
<property name="fn" value="FilterSTAR.wcf" />
<echo message="Executing macro: ${macros.local.dir}/${fn}" />
<java jvm="${platform.java}" fork="true" failonerror="false" resultproperty="result" maxmemory="512m" classname="Wattos.CloneWars.UserInterface" dir="${test_data.local.dir}" input="${macros.local.dir}/${fn}" timeout="960000">
<arg line="-at" />
<jvmarg line="${profile.jvmarg}" />
<classpath>
<path path="${build.dir}:${javac.classpath}:${j2ee.platform.classpath}" />
</classpath>
</java>
</target>
<!--
Found that after checkout to Windows there were extra eols but fixed with the below.
Default is based on the platform on which you are running this task.
For Unix platforms, the default is "lf".
For DOS based systems (including Windows), the default is "crlf".
For Mac OS, the default is "cr".
-->
<target name="fixcrlf" description="Change the end-of-line string to single cr like under Linux" depends="init">
<property name="dir_todo" value="scripts" />
<echo message="Starting to fixcrlf on dir: ${dir_todo}" />
<fixcrlf srcDir="${dir_todo}" eol="lf" />
</target>
<!--Dimitri's STAR parser now with line by line processing instead of character at
a time for semi colon delimited values-->
<taskdef name="jflex" classname="JFlex.anttask.JFlexTask" classpath="${lib.local.dir}/JFlex.jar" />
<target name="star_scanner" description="generate scanner class" depends="init">
<jflex file="${src.dir}/Wattos/Star/star.flex" verbose="on" />
</target>
<!--
rm -f ParseException.java SimpleCharStream.java Token.java TokenMgrError.java
rm -f AmberParser.java AmberParserConstants.java AmberParserTokenManager.java
-->
<target name="parserAmber" depends="init" description="JavaCC compiler compiler Amber">
<echo message="JavaCC compiler compiler Amber" />
<delete verbose="true">
<fileset dir="${src.dir}/Wattos/Converters/Amber" includes="ParseException.java SimpleCharStream.java Token.java TokenMgrError.java AmberParser.java AmberParserConstants.java AmberParserTokenManager.java" />
</delete>
<java jvm="${platform.java}" fork="true" failonerror="true" classname="javacc" dir="${src.dir}/Wattos/Converters/Amber" timeout="9600">
<arg line="AmberParserAll.jj" />
<jvmarg line="-classpath C:\Docume~1\JURGEN~1.000\workspace\wattos\lib\javacc.jar" />
</java>
</target>
</project>