-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
476 lines (427 loc) · 20.5 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
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
<?xml version="1.0" encoding="UTF-8"?>
<project name="SLAstic" default="build-all" basedir=".">
<!-- Notice, that it is NOT called build.properties: -->
<property file="build.xml.properties" />
<property file="examples.properties" />
<target name="init-version">
<tstamp />
<!-- Names of the slastic runtime libraries that will be created
by the build process: -->
<property name="slastic.version" value="0.5a-SNAPSHOT" />
<property name="dist.slastic.main.jar" value="${slastic.main.packagenamebase}-${slastic.version}.jar" />
<property name="slastic.dist.name" value="${slastic.packagenamebase}-${slastic.version}" />
<property name="dist.slastic.srcBaseName" value="${slastic.dist.name}_${slastic-src.suffix}" />
<property name="dist.slastic.binBaseName" value="${slastic.dist.name}_${slastic-bin.suffix}" />
<property name="dist.slastic.apiBaseName" value="${slastic.dist.name}_${slastic-api.suffix}" />
<!-- BEGIN: The following should eventually be removed -->
<property name="slastic.core.jar" value="${slastic.core.packagenamebase}-${slastic.version}.jar" />
<property name="slastic.simulation.jar" value="${slastic.simulation.packagenamebase}-${slastic.version}.jar" />
<property name="slastic.metamodel.jar" value="${slastic.metamodel.packagenamebase}-${slastic.version}.jar" />
<property name="slastic.plugins.jar" value="${slastic.plugins.packagenamebase}-${slastic.version}.jar" />
<!-- END: To be removed -->
</target>
<target name="update-version" unless="version.noupdate" depends="init-version">
<echo>Updating version string</echo>
<replaceregexp file="src/core/kieker/tools/slastic/common/Version.java" match="VERSION = ".*?"" replace="VERSION = "${slastic.version}-${DSTAMP}"" />
<replaceregexp match="<version>.*?</version>" replace="<version>${slastic.version}-${DSTAMP}</version>">
<fileset dir=".">
<include name="pom_ant_slastic*.xml" />
</fileset>
</replaceregexp>
</target>
<!-- Compile classpaths used for javac and javadoc -->
<target name="init-compile-classpaths">
<path id="slastic.metamodel-compile-classpath">
<fileset dir="${lib.dir}">
<!-- TODO: Make Jar-dependencies explicit -->
<include name="**/*.jar" />
</fileset>
</path>
<path id="slastic.core-compile-classpath">
<fileset dir="${lib.dir}">
<!-- TODO: Make Jar-dependencies explicit -->
<include name="**/*.jar" />
</fileset>
<pathelement location="${build.slastic.metamodel.dir}/" />
</path>
<path id="slastic.plugins-compile-classpath">
<fileset dir="${lib.dir}">
<!-- TODO: Make Jar-dependencies explicit -->
<include name="**/*.jar" />
</fileset>
<pathelement location="${build.slastic.core.dir}/" />
<pathelement location="${build.slastic.metamodel.dir}/" />
<pathelement location="${build.slastic.simulation.dir}/" />
</path>
<path id="slastic.simulation-compile-classpath">
<fileset dir="${lib.dir}">
<!-- TODO: Make Jar-dependencies explicit -->
<include name="**/*.jar" />
</fileset>
<pathelement location="${build.slastic.core.dir}/" />
</path>
<path id="slastic-run-classpath">
<fileset dir="${lib.dir}">
<include name="**/*.jar" />
<!--<exclude name="log4j-*.jar"/>-->
</fileset>
<fileset dir="${dist.dir}">
<include name="${dist.slastic.main.jar}" />
</fileset>
</path>
<path id="slastic.tests-compile-classpath">
<fileset dir="${lib.dir}">
<include name="**/*.jar" />
</fileset>
<fileset dir="${dist.dir}">
<include name="${dist.slastic.main.jar}" />
</fileset>
</path>
<path id="slastic.tests-run-classpath">
<fileset dir="${lib.dir}">
<include name="**/*.jar" />
<!--<exclude name="log4j-*.jar"/>-->
</fileset>
<fileset dir="${dist.dir}">
<include name="${dist.slastic.main.jar}" />
</fileset>
<pathelement location="${build.tests.dir}/" />
</path>
</target>
<target name="build-all" depends="init,build-slastic.main">
</target>
<condition property="no.slastic.framework.properties">
<not>
<available file="${slastic.framework.properties}" />
</not>
</condition>
<target name="init-slastic.framework.properties" if="no.slastic.framework.properties">
<!-- if no slastic.framework.properties, copy example file automatically -->
<echo message="${slastic.framework.properties} not existing.
Creating default file." />
<copy file="${slastic.framework.properties.example}" tofile="${slastic.framework.properties}" />
</target>
<condition property="no.slastic.simulation.properties">
<not>
<available file="${slastic.simulation.properties}" />
</not>
</condition>
<target name="init-slastic.simulation-properties" if="no.slastic.simulation.properties">
<!-- if no slastic.simulation.properties, copy example file automatically -->
<echo message="${slastic.simulation.properties} not existing.
Creating default file." />
<copy file="${slastic.simulation.properties.example}" tofile="${slastic.simulation.properties}" />
</target>
<target name="init" depends="clean,update-version,init-compile-classpaths,init-slastic.framework.properties,init-slastic.simulation-properties">
<!-- Register special aspectJ commands in ant - allow ant to use special AspectJ commands: -->
<taskdef resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties" classpath="${aspectjtoolsjar}" />
<fail message="Critical error: AspectJ library not found
in ${aspectjtoolsjar}.
Check your build.properties.">
<condition>
<not>
<available file="${aspectjtoolsjar}" />
</not>
</condition>
</fail>
<mkdir dir="${build.dir}" />
<mkdir dir="${dist.dir}" />
<mkdir dir="${release.dir}" />
<mkdir dir="${build.tests.dir}" />
<mkdir dir="tmp" />
</target>
<target name="compile-slastic.metamodel" depends="init">
<delete dir="${build.slastic.metamodel.dir}" />
<mkdir dir="${build.slastic.metamodel.dir}" />
<mkdir dir="${build.slastic.metamodel.dir}/META-INF" />
<javac destDir="${build.slastic.metamodel.dir}" source="1.5" srcdir="${src.slastic.metamodel.dir}" debug="true" classpathref="slastic.metamodel-compile-classpath">
<compilerarg value="-Xlint:-path" />
</javac>
<!-- We want to include the sources in this jar -->
<copy todir="${build.slastic.metamodel.dir}/">
<fileset dir="${src.slastic.metamodel.dir}">
<include name="**/*.java" />
</fileset>
</copy>
</target>
<target name="compile-slastic.core" depends="init,compile-slastic.metamodel">
<delete dir="${build.slastic.core.dir}" />
<mkdir dir="${build.slastic.core.dir}" />
<mkdir dir="${build.slastic.core.dir}/META-INF" />
<copy file="${log4j.properties.example}" tofile="${build.slastic.core.dir}/META-INF/slastic.log4j.properties" />
<javac destDir="${build.slastic.core.dir}" source="1.5" srcdir="${src.slastic.core.dir}" debug="true" classpathref="slastic.core-compile-classpath">
<compilerarg value="-Xlint:-path" />
</javac>
<!-- We want to include the sources in this jar -->
<copy todir="${build.slastic.core.dir}/">
<fileset dir="${src.slastic.core.dir}">
<include name="kieker/tools/slastic/core/**/*.java" />
</fileset>
</copy>
</target>
<target name="compile-slastic.plugins" depends="init,compile-slastic.core,compile-slastic.metamodel,compile-slastic.simulation">
<delete dir="${build.slastic.plugins.dir}" />
<mkdir dir="${build.slastic.plugins.dir}" />
<mkdir dir="${build.slastic.plugins.dir}/META-INF" />
<javac destDir="${build.slastic.plugins.dir}" source="1.5" srcdir="${src.slastic.plugins.dir}" debug="true" classpathref="slastic.plugins-compile-classpath">
<compilerarg value="-Xlint:-path" />
</javac>
<!-- We want to include the sources in this jar -->
<copy todir="${build.slastic.plugins.dir}/">
<fileset dir="${src.slastic.plugins.dir}">
<include name="kieker/tools/slastic/plugins/**/*.java" />
</fileset>
</copy>
<copy todir="${build.slastic.plugins.dir}/">
<fileset dir="${src.transformation.dir}/slastic2pcm/">
<include name="*.asm" />
<include name="*.atl" />
</fileset>
</copy>
<copy todir="${build.slastic.plugins.dir}/">
<fileset dir="${src.model.dir}">
<include name="*.ecore" />
</fileset>
</copy>
</target>
<target name="compile-slastic.simulation" depends="init,compile-slastic.core">
<delete dir="${build.slastic.simulation.dir}" />
<mkdir dir="${build.slastic.simulation.dir}" />
<mkdir dir="${build.slastic.simulation.dir}/META-INF" />
<javac destDir="${build.slastic.simulation.dir}" source="1.5" srcdir="${src.slastic.simulation.dir}" debug="true" classpathref="slastic.simulation-compile-classpath">
<compilerarg value="-Xlint:-path" />
</javac>
<!--<copy file="${slastic.simulation.properties}" todir="${build.slastic.simulation.dir}/META-INF"/>-->
<!-- We want to include the sources in this jar -->
<copy todir="${build.slastic.simulation.dir}/">
<fileset dir="${src.slastic.simulation.dir}">
<include name="kieker/tools/slastic/simulation/**/*.java" />
</fileset>
</copy>
</target>
<target name="build-slastic.main" depends="init,compile-slastic.metamodel,compile-slastic.metamodel,compile-slastic.simulation,compile-slastic.plugins">
<jar destfile="${dist.dir}/${dist.slastic.main.jar}">
<fileset dir="${build.slastic.metamodel.dir}" />
<fileset dir="${build.slastic.core.dir}" />
<fileset dir="${build.slastic.simulation.dir}" />
<fileset dir="${build.slastic.plugins.dir}" />
<fileset dir="." includes="LICENSE" />
</jar>
</target>
<target name="javadoc" depends="init" description="Create Javadoc API documentation">
<delete dir="${build.api.dir}" />
<mkdir dir="${build.api.dir}" />
<path id="javadoc-sourcepath">
<dirset dir=".">
<include name="${src.slastic.metamodel.dir}" />
<include name="${src.slastic.core.dir}" />
<include name="${src.slastic.simulation.dir}" />
<include name="${src.slastic.plugins.dir}" />
</dirset>
</path>
<javadoc sourcepathref="javadoc-sourcepath" destdir="${build.api.dir}" packagenames="*" access="public" author="true" version="false" use="true" doctitle="SLAstic Framework, Vers. ${slastic.version}<br/>API Documentation" header="SLAstic ${slastic.version}" footer="SLAstic ${slastic.version}" bottom="Copyright ${year} ${copyright}, <a href="http://slastic.sourceforge.net">http://slastic.sourceforge.net</>">
<classpath refid="slastic.metamodel-compile-classpath" />
<classpath refid="slastic.core-compile-classpath" />
<classpath refid="slastic.simulation-compile-classpath" />
<classpath refid="slastic.plugins-compile-classpath" />
<link href="http://download.oracle.com/javase/6/docs/api/" />
</javadoc>
</target>
<target name="dist-javadoc" depends="init,javadoc" description="Create Javadoc API documentation">
<tar destfile="${release.dir}/${dist.slastic.apiBaseName}.tar" longfile="gnu">
<tarfileset dir="${build.api.dir}" prefix="" defaultexcludes="yes" />
</tar>
<gzip zipfile="${release.dir}/${dist.slastic.apiBaseName}.tar.gz" src="${release.dir}/${dist.slastic.apiBaseName}.tar" />
<!-- tar file no longer needed -->
<delete file="${release.dir}/${dist.slastic.apiBaseName}.tar" />
<zip zipfile="${release.dir}/${dist.slastic.apiBaseName}.zip">
<zipfileset dir="${build.api.dir}" prefix="" defaultexcludes="yes" />
</zip>
</target>
<target name="dist-slastic-sources" depends="init">
<patternset id="dist_src_files-nonbinmode">
<include name="bin/*.bat" />
<include name="META-INF/*" />
<include name="src/**/*.java" />
<include name="src/**/META-INF/*" />
<include name="src-gen/**/*.java" />
<include name="test/**/*.java" />
<include name="test/META-INF/*" />
<include name="lib/**" />
<include name="${eclipse-classpath.sample}" />
<include name="${eclipse-project.sample}" />
<include name="build.xml" />
<include name="build.xml.properties" />
<include name="plugin.xml" />
<include name="plugin.properties" />
<include name="build.properties" />
<include name="LICENSE" />
</patternset>
<patternset id="dist_src_files-binmode">
<include name="bin/*.sh" />
</patternset>
<tar destfile="${release.dir}/${dist.slastic.srcBaseName}.tar" longfile="gnu">
<tarfileset dir="." prefix="${slastic.dist.name}" defaultexcludes="yes">
<patternset refid="dist_src_files-nonbinmode" />
</tarfileset>
<tarfileset dir="." prefix="${slastic.dist.name}" filemode="755" defaultexcludes="yes">
<patternset refid="dist_src_files-binmode" />
</tarfileset>
</tar>
<gzip zipfile="${release.dir}/${dist.slastic.srcBaseName}.tar.gz" src="${release.dir}/${dist.slastic.srcBaseName}.tar" />
<!-- tar file no longer needed -->
<delete file="${release.dir}/${dist.slastic.srcBaseName}.tar" />
<zip zipfile="${release.dir}/${dist.slastic.srcBaseName}.zip">
<zipfileset dir="." prefix="${slastic.dist.name}" defaultexcludes="yes">
<patternset refid="dist_src_files-nonbinmode" />
</zipfileset>
<zipfileset dir="." prefix="${slastic.dist.name}" filemode="755" defaultexcludes="yes">
<patternset refid="dist_src_files-binmode" />
</zipfileset>
</zip>
</target>
<target name="dist-slastic-binaries" depends="build-all">
<patternset id="dist_bin_files-nonbinmode">
<include name="bin/log4j.properties" />
<include name="bin/*.bat" />
<include name="dist/*.jar" />
<include name="META-INF/*" />
<!-- a file META-INF/kieker.monitoring.properties will be during packaging -->
<include name="lib/*" />
<include name="LICENSE" />
<include name="${src.example.dummy.dir}/README" />
<include name="${src.example.dummy.dir}/lib/" />
<include name="${src.example.dummy.dir}/slastic.framework.properties" />
<include name="${src.example.kieker.dir}/README" />
<include name="${src.example.kieker.dir}/lib/" />
<include name="${src.example.kieker.dir}/kieker-monitoring-logs/*.zip" />
<include name="${src.example.kieker.dir}/slastic.framework.properties" />
<include name="${src.example.eucalyptus.dir}/README" />
<include name="${src.example.eucalyptus.dir}/lib/" />
<include name="${src.example.eucalyptus.dir}/kieker-monitoring-logs/*.zip" />
<include name="${src.example.eucalyptus.dir}/slastic.framework.properties" />
<include name="${src.example.eucalyptus.dir}/slastic.framework.eucalyptus.properties" />
<include name="${src.rscripts.performancelogger.dir}/*.r" />
<exclude name="**/.gitignore" />
</patternset>
<patternset id="dist_bin_files-binmode">
<include name="bin/*.sh" />
<include name="${src.example.dummy.dir}/bin/*.sh" />
<include name="${src.example.kieker.dir}/bin/*.sh" />
<include name="${src.example.eucalyptus.dir}/bin/*.sh" />
</patternset>
<tar destfile="${release.dir}/${dist.slastic.binBaseName}.tar" longfile="gnu">
<tarfileset dir="." prefix="${slastic.dist.name}" defaultexcludes="yes">
<patternset refid="dist_bin_files-nonbinmode" />
</tarfileset>
<tarfileset dir="." prefix="${slastic.dist.name}" filemode="755" defaultexcludes="yes">
<patternset refid="dist_bin_files-binmode" />
</tarfileset>
</tar>
<gzip zipfile="${release.dir}/${dist.slastic.binBaseName}.tar.gz" src="${release.dir}/${dist.slastic.binBaseName}.tar" />
<!-- tar file no longer needed -->
<delete file="${release.dir}/${dist.slastic.binBaseName}.tar" />
<zip zipfile="${release.dir}/${dist.slastic.binBaseName}.zip">
<zipfileset dir="." prefix="${slastic.dist.name}" defaultexcludes="yes">
<patternset refid="dist_bin_files-nonbinmode" />
</zipfileset>
<zipfileset dir="." prefix="${slastic.dist.name}" filemode="755" defaultexcludes="yes">
<patternset refid="dist_bin_files-binmode" />
</zipfileset>
</zip>
</target>
<target name="release" depends="build-all,dist-slastic-sources,dist-slastic-binaries,dist-javadoc">
<echo message="Sourceforge release instructions can be found at:" />
<echo message="https://sourceforge.net/apps/trac/sourceforge/wiki/Release files for download#Createoreditarelease" />
</target>
<target name="run-SLAsticStarter-simulation" depends="build-slastic.main">
<java dir="." fork="true" classname="kieker.tools.slastic.plugins.starter.SLAsticStarter" classpathref="slastic-run-classpath" maxmemory="1024m">
<jvmarg value="-Dlog4j.configuration=META-INF/slastic.log4j.properties" />
<!-- included in the slastic.core jar -->
<jvmarg value="-Dkieker.monitoring.configuration=${slastic.simulation-kieker.monitoring.properties}" />
<arg line="--start-framework META-INF/slastic.framework.properties" />
<arg line="--start-simulation META-INF/slastic.simulation.properties" />
</java>
</target>
<target name="run-SLAsticStarter" depends="build-slastic.main">
<java dir="." fork="true" classname="kieker.tools.slastic.plugins.starter.SLAsticStarter" classpathref="slastic-run-classpath" maxmemory="1024m">
<jvmarg value="-Dlog4j.configuration=META-INF/slastic.log4j.properties" />
<!-- included in the slastic.core jar -->
<jvmarg value="-Dkieker.monitoring.configuration=${slastic.simulation-kieker.monitoring.properties}" />
<arg line="--start-framework META-INF/slastic.framework.properties" />
</java>
</target>
<target name="run-rTest" depends="build-slastic.main">
<copy file="${tests.log4j.properties}" tofile="${build.dir}/tests.log4j.properties" />
<java dir="." fork="true" classname="kieker.tools.slastic.plugins.util.REngineFacade" classpathref="slastic-run-classpath" maxmemory="1024m">
<jvmarg value="-Djava.library.path=lib/" />
<jvmarg value="-Dlog4j.configuration=META-INF/slastic.log4j.properties" />
<!-- included in the slastic.core jar -->
<jvmarg value="-Dkieker.monitoring.configuration=${slastic.simulation-kieker.monitoring.properties}" />
<arg line="--start-framework META-INF/slastic.framework.properties" />
<classpath>
<pathelement location="${dist.dir}/${slastic.plugins.jar}" />
<pathelement location="${dist.dir}/${slastic.simulation.jar}" />
</classpath>
</java>
<delete file="${build.tests.dir}/log4j.properties" />
</target>
<condition property="no.log4j.properties.tests">
<not>
<available file="${tests.log4j.properties}" />
</not>
</condition>
<target name="compile-tests" depends="build-slastic.main">
<javac source="1.5" destDir="${build.tests.dir}" classpathref="slastic.tests-compile-classpath" srcdir="tests/">
</javac>
</target>
<taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask" />
<target name="run-tests-junit" depends="compile-tests">
<delete dir="${tests.junit-results.dir}" />
<mkdir dir="${tests.junit-results.dir}" />
<junit printsummary="yes" haltonfailure="no">
<classpath refid="slastic.tests-run-classpath" />
<formatter type="xml" />
<batchtest fork="yes" todir="${tests.junit-results.dir}">
<fileset dir="${build.tests.dir}/">
<include name="**/junit/**/*Test*.class" />
<exclude name="**/junit/**/Abstract*Test*.class" />
<exclude name="**/*$*.class" />
</fileset>
</batchtest>
</junit>
<antcall target="test.junit.report" />
</target>
<target name="test.junit.report" depends="">
<junitreport todir="${tests.junit-results.dir}">
<fileset dir="${tests.junit-results.dir}">
<include name="TEST-*.xml" />
</fileset>
<report format="frames" todir="${tests.junit-results.dir}" />
</junitreport>
<echo message="To see the test report, open ${tests.junit-results.dir}/index.html in your Web browser." />
</target>
<target name="run-tests-loadTimeWeaving-bookstoreDifferentRecordTypes" depends="compile-tests">
<copy file="${tests.log4j.properties}" tofile="${build.dir}/tests.log4j.properties" />
<copy file="${aop.xml.ltwtests}" tofile="${build.tests.dir}/META-INF/aop.xml" />
<java dir="." fork="true" classname="kieker.tools.slastic.tests.bookstoreDifferentRecordTypes.Bookstore" classpathref="slastic.tests-run-classpath">
<jvmarg value="-Dkieker.monitoring.configuration=${tests.kieker.monitoring.properties}" />
<jvmarg value="-Dkieker.monitoring.storeInJavaIoTmpdir=${tests.storeInJavaIoTmpdir}" />
<jvmarg value="-Dkieker.monitoring.customStoragePath=${tests.logdata.storagepath}" />
<jvmarg value="-javaagent:${aspectjweaverjar}" />
<!--<jvmarg value="-Dlog4j.configuration=${build.dir}/tests.log4j.properties"/>-->
<jvmarg value="-Dorg.aspectj.weaver.showWeaveInfo=true" />
<jvmarg value="-Daj.weaving.verbose=true" />
<classpath>
<pathelement location="${dist.dir}/${slastic.core.jar}" />
<pathelement location="${dist.dir}/${slastic.plugins.jar}" />
</classpath>
</java>
</target>
<target name="clean">
<!-- <delete dir="tmp"/>-->
<delete dir="${release.dir}" />
<delete dir="${dist.dir}" />
<delete dir="${build.dir}" />
</target>
</project>