-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.xml
More file actions
482 lines (406 loc) · 16.1 KB
/
build.xml
File metadata and controls
482 lines (406 loc) · 16.1 KB
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
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
<project name="CIKNOW" basedir="." default="deploy-ciknow-assembler">
<property file="build.properties"/>
<property environment="env"/>
<property name="app.name" value="${context}"/>
<property name="app.path" value="/${app.name}"/>
<property name="app.version" value="1.0"/>
<property name="build" value="${basedir}/build"/>
<property name="dist" value="${basedir}/dist"/>
<property name="docs" value="${basedir}/docs"/>
<property name="src" value="${basedir}/src"/>
<property name="test" value="${basedir}/test"/>
<property name="web" value="${basedir}/web"/>
<property name="manager.url" value="http://127.0.0.1:8080/manager"/>
<tstamp>
<format property="start.timestamp" pattern="MM/dd/yyyy HH:mm:ss" />
</tstamp>
<path id="compile.classpath">
<fileset dir="${env.CATALINA_HOME}/bin">
<include name="*.jar"/>
</fileset>
<pathelement location="${env.CATALINA_HOME}/lib"/>
<fileset dir="${env.CATALINA_HOME}/lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${web}/WEB-INF/lib">
<include name="**/*.jar"/>
</fileset>
</path>
<path id="classpath">
<path refid="compile.classpath"/>
<pathelement location="${build}/WEB-INF/classes"/>
</path>
<taskdef resource="org/apache/catalina/ant/catalina.tasks"
classpathref="compile.classpath"/>
<property name="compile.debug" value="true"/>
<property name="compile.deprecation" value="false"/>
<property name="compile.optimize" value="true"/>
<target name="clean" description="Delete old build and dist directories">
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
<target name="prepare">
<echo>${start.timestamp}</echo>
<mkdir dir="${build}"/>
<copy todir="${build}">
<fileset dir="${web}"/>
</copy>
</target>
<target name="compile" depends="prepare"
description="Compile Java sources and make web application">
<javac srcdir="${src}"
destdir="${build}/WEB-INF/classes"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
optimize="${compile.optimize}"
classpathref="compile.classpath">
</javac>
<javac srcdir="${test}"
destdir="${build}/WEB-INF/classes"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
optimize="${compile.optimize}"
classpathref="compile.classpath">
</javac>
<copy todir="${build}/WEB-INF/classes">
<fileset dir="${src}" excludes="**/*.java"/>
</copy>
</target>
<target name="deploy-ciknow-assembler" depends="clean, compile"
description="Copy ciknow server components to ciknow-assembler">
<copy toDir="${ciknow.assembler.dir}/build">
<fileset dir="${build}" excludes="**/*Test.class"/>
</copy>
</target>
<target name="deploy-ciknowmgr-assembler" depends="clean, compile"
description="Copy ciknow server components to ciknow-assembler">
<!-- For publishing _ciknow.war -->
<copy toDir="${ciknowmgr.assembler.dir}/build/WEB-INF/template/temp" overwrite="true">
<fileset dir="${build}" excludes="**/*Test.class"/>
</copy>
<copy toDir="${ciknowmgr.assembler.dir}/build/WEB-INF/template/server">
<fileset dir="${build}" excludes="**/*Test.class"/>
</copy>
</target>
<target name="dev_restart" description="--> restart project">
<reload url="${manager.url}"
username="${manager.username}"
password="${manager.password}"
path="/${context}"/>
</target>
<target name="dev-list"
description="List installed applications on servlet container">
<list url="${manager.url}"
username="${manager.username}"
password="${manager.password}"/>
</target>
<!-- testing -->
<target name="testEdgeDao" depends="compile">
<java classname="ciknow.dao.hibernate.EdgeHibernateDao"
fork="true"
maxmemory="1000m"
failonerror="true">
<classpath refid="classpath"/>
</java>
</target>
<target name="testNodeDao" depends="compile">
<java classname="ciknow.dao.hibernate.NodeHibernateDao"
fork="true"
maxmemory="1000m"
failonerror="true">
<classpath refid="classpath"/>
</java>
</target>
<!-- - - - - - - - - - - - - - - - - -
target: runNetworkAnalytics
- - - - - - - - - - - - - - - - - -->
<target name="runNetworkAnalytics">
<java classname="ciknow.graph.metrics.NetworkAnalytics">
<classpath refid="classpath"/>
</java>
</target>
<!-- - - - - - - - - - - - - - - - - -
target: runNetworkAnalyticsRO
- - - - - - - - - - - - - - - - - -->
<target name="runNetworkAnalyticsRO">
<java classname="ciknow.ro.NetworkAnalyticsRO">
<classpath refid="classpath"/>
</java>
</target>
<!-- - - - - - - - - - - - - - - - - -
target: runEdgeRO
- - - - - - - - - - - - - - - - - -->
<target name="runSLReader">
<java classname="ciknow.io.secondlife.SecondLifeReaderUtil"
fork="true"
jvm="/opt/jdk1.6.0_03/bin/java"
failonerror="true"
maxmemory="6000m">
<classpath refid="classpath"/>
</java>
</target>
<target name="runSLConverter">
<java classname="ciknow.io.secondlife.Converter"
fork="true"
jvm="/opt/jdk1.6.0_03/bin/java"
failonerror="true"
maxmemory="4096m">
<classpath refid="classpath"/>
</java>
</target>
<target name="runSLComponentFinder2">
<java classname="ciknow.io.secondlife.ComponentFinder2"
fork="true"
jvm="/opt/jdk1.6.0_03/bin/java"
failonerror="true"
maxmemory="6000m">
<classpath refid="classpath"/>
</java>
</target>
<target name="runSLReverter">
<java classname="ciknow.io.secondlife.Reverter"
fork="true"
jvm="/opt/jdk1.6.0_03/bin/java"
failonerror="true"
maxmemory="4096m">
<classpath refid="classpath"/>
</java>
</target>
<!-- - - - - - - - - - - - - - - - - -
target: runNodeTaggingHibernateDao
- - - - - - - - - - - - - - - - - -->
<target name="runNodeTaggingHibernateDao">
<java classname="ciknow.dao.hibernate.NodeTaggingHibernateDao">
<classpath refid="classpath"/>
</java>
</target>
<target name="runContactWriter">
<java classname="ciknow.survey.io.ContactWriter"
fork="true"
jvm="/opt/jdk1.6.0_03/bin/java"
failonerror="true"
maxmemory="6000m">
<classpath refid="classpath"/>
<arg line="/home/ciknow/data/users.txt"/>
</java>
</target>
<target name="runContactReader">
<java classname="ciknow.survey.io.ContactReader"
fork="true"
jvm="/opt/jdk1.6.0_03/bin/java"
failonerror="true"
maxmemory="6000m">
<classpath refid="classpath"/>
<arg line="/home/ciknow/data/users.txt"/>
</java>
</target>
<target name="runQuestionWriter">
<java classname="ciknow.survey.io.QuestionWriter"
fork="true"
jvm="/opt/jdk1.6.0_03/bin/java"
failonerror="true"
maxmemory="6000m">
<classpath refid="classpath"/>
<arg line="/home/ciknow/data/question.txt 2"/>
</java>
</target>
<target name="runQuestionReader">
<java classname="ciknow.survey.io.QuestionReader"
fork="true"
jvm="/opt/jdk1.6.0_03/bin/java"
failonerror="true"
maxmemory="6000m">
<classpath refid="classpath"/>
<arg line="/home/ciknow/data/question.txt"/>
</java>
</target>
<target name="runNodeDataWriter" depends="compile">
<java classname="ciknow.io.NodeDataWriter"
fork="false"
failonerror="true"
maxmemory="1024m">
<classpath refid="classpath"/>
<arg line=""/>
</java>
</target>
<target name="runNodeDataReader">
<java classname="ciknow.io.NodeDataReader"
fork="false"
failonerror="true"
maxmemory="1024m">
<classpath refid="classpath"/>
</java>
</target>
<target name="runEdgeDataWriter" depends="compile">
<java classname="ciknow.io.EdgeDataWriter"
fork="true"
failonerror="true"
maxmemory="1024m">
<classpath refid="classpath"/>
<arg line=""/>
</java>
</target>
<target name="runDLQuestionReader">
<java classname="ciknow.survey.io.DLQuestionReader"
fork="true"
jvm="/opt/jdk1.6.0_03/bin/java"
failonerror="true"
maxmemory="6000m">
<classpath refid="classpath"/>
<arg line="/home/ciknow/data/Un.txt"/>
</java>
</target>
<target name="runLocalNetwork">
<java classname="ciknow.vis.LocalNetwork"
fork="true"
jvm="/opt/jdk1.6.0_03/bin/java"
failonerror="true"
maxmemory="6000m">
<classpath refid="classpath"/>
</java>
</target>
<target name="runEdgeRO">
<java classname="ciknow.ro.EdgeRO"
fork="true"
jvm="/opt/jdk1.6.0_03/bin/java"
failonerror="true"
maxmemory="6000m">
<classpath refid="classpath"/>
<arg line="d.PAuthorship.PCitation 1 Authorship -1 1"/>
</java>
</target>
<!-- ############################### RECOMMENDER ############################### -->
<target name="runEdgeWeightUpdator" depends="compile">
<java classname="ciknow.util.GeneralUtil"
fork="true"
maxmemory="1000m"
failonerror="true">
<classpath refid="classpath"/>
</java>
</target>
<target name="runDistanceCalculator" depends="compile">
<java classname="ciknow.recommend.calculate.DistanceCalculator"
fork="true"
maxmemory="1000m"
failonerror="true">
<classpath refid="classpath"/>
</java>
</target>
<target name="runMetricCalculator" depends="compile">
<java classname="ciknow.recommend.calculate.MetricCalculator"
fork="true"
maxmemory="1000m"
failonerror="true">
<classpath refid="classpath"/>
</java>
</target>
<target name="runGeodesicCalculator" depends="compile">
<java classname="ciknow.recommend.calculate.GeodesicCalculator"
fork="true"
maxmemory="1000m"
failonerror="true">
<classpath refid="classpath"/>
</java>
</target>
<target name="runRecommender" depends="compile">
<java classname="ciknow.recommend.service.RecommenderServiceImpl"
fork="true"
maxmemory="1000m"
failonerror="true">
<classpath refid="classpath"/>
</java>
</target>
<!-- ######################### data import/export ####################### -->
<target name="graphmlReader" depends="compile">
<replace file="${build}/WEB-INF/classes/applicationContext-datasource.xml"
token="_ciknow" value="${context}"/>
<java classname="ciknow.io.GraphmlReader"
fork="true"
maxmemory="1500m"
failonerror="true">
<classpath refid="classpath"/>
<arg line="${export.dir} ${context}"/>
</java>
<replace file="${build}/WEB-INF/classes/applicationContext-datasource.xml"
token="${context}" value="_ciknow"/>
</target>
<target name="graphmlWriter" depends="compile">
<replace file="${build}/WEB-INF/classes/applicationContext-datasource.xml"
token="_ciknow" value="${context}"/>
<java classname="ciknow.io.GraphmlWriter"
fork="true"
maxmemory="1532m"
failonerror="true">
<classpath refid="classpath"/>
<arg line="${export.dir} ${context}"/>
</java>
<replace file="${build}/WEB-INF/classes/applicationContext-datasource.xml"
token="${context}" value="_ciknow"/>
</target>
<target name="runPerceivedChoice2MultipleRelationalChoice" depends="compile">
<replace file="${build}/WEB-INF/classes/applicationContext-datasource.xml"
token="_ciknow" value="${context}"/>
<java classname="ciknow.io.temp.PerceivedChoice2MultipleRelationalChoice"
fork="true"
maxmemory="1500m"
failonerror="true">
<classpath refid="classpath"/>
<!--arg line="${export.dir}/filename.txt shortName"/-->
<arg line="${export.dir}/futurecol.txt futurecol_derived"/>
</java>
<replace file="${build}/WEB-INF/classes/applicationContext-datasource.xml"
token="${context}" value="_ciknow"/>
</target>
<target name="tunning_recommender" depends="compile">
<java classname="ciknow.tunning.RecommenderServiceTest"
fork="true"
maxmemory="2560m"
failonerror="true">
<classpath refid="classpath"/>
</java>
</target>
<target name="copyPagesWithDynamicGroup" depends="compile">
<replace file="${build}/WEB-INF/classes/applicationContext-datasource.xml"
token="_ciknow" value="${context}"/>
<java classname="ciknow.tmp.PageCopyWithDynamicGroup"
fork="true"
maxmemory="256m"
failonerror="true">
<classpath refid="classpath"/>
<arg line="1 COPY C:/Users/gyao/git/ciknow/web/groups.txt"/>
</java>
<replace file="${build}/WEB-INF/classes/applicationContext-datasource.xml"
token="${context}" value="_ciknow"/>
</target>
<!-- ############################### JAR ############################### -->
<path id="weblib.classpath">
<fileset dir="${build}/WEB-INF/lib">
<include name="**/*.jar"/>
</fileset>
</path>
<!--
Create jar file to run in command line
This is a request from Koehly, Laura (NIH/NHGRI) [E] koehlyl@mail.nih.gov
Note:
1, The applicationContext-security.xml should be commented out in Beans.init() before jaring
2, The created ciknow.jar should be place in the same directory as WEB-INF
3, To run: java -jar ciknow.jar questionId1 questionId2 ...
4, Exported data file is edgeData.txt in the current directory (where you run the program)
!!!!! this approach was dropped. the code left here is just to document the knowledge learned in the process !!!!
-->
<target name="jar_ciknow" depends="compile">
<manifestclasspath property="jar.classpath"
jarfile="${build}/ciknow.jar">
<classpath refid="weblib.classpath" />
</manifestclasspath>
<jar destfile="${build}/ciknow.jar">
<fileset dir="${build}/WEB-INF/classes">
<exclude name="**/*Test.class"/>
</fileset>
<manifest>
<attribute name="Main-Class" value="ciknow.io.EdgeDataWriter"/>
<attribute name="Class-Path" value="${jar.classpath}" />
</manifest>
</jar>
</target>
</project>