source: trunk/JavaCommons/build.xml @ 282

Last change on this file since 282 was 282, checked in by sherbold, 12 years ago
  • Property svn:mime-type set to text/plain
File size: 20.5 KB
Line 
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<project basedir="." default="dist" name="EventBench">
3        <!-- General Properties -->
4        <property environment="env" />
5        <property name="build.location" value="bin" />
6        <property name="dist.location" value="dist" />
7        <property name="javadoc.location" value="javadoc" />
8        <property name="downloads.location" value="downloads" />
9        <property name="debuglevel" value="source,lines,vars" />
10        <property name="target" value="1.6" />
11        <property name="source" value="1.6" />
12
13        <!-- Distribution Properties -->
14        <property name="dist.location.main" value="${dist.location}/console" />
15        <property name="dist.location.jfcmonitor" value="${dist.location}/jfcmonitor" />
16        <property name="dist.location.javadoc" value="${dist.location}/javadoc" />
17
18        <!-- EventBenchConsole Properties -->
19        <property name="build.location.eventbenchconsole" value="${build.location}/eventbenchconsole" />
20        <property name="EventBenchConsole.jarname" value="eventbenchconsole.jar" />
21        <property name="EventBenchConsole.location" value="../EventBenchConsole" />
22        <path id="EventBenchConsole.classpath">
23                <pathelement location="${build.location.eventbenchconsole}" />
24                <pathelement location="lib/collections-generic-4.01.jar" />
25                <pathelement location="lib/jdom.jar" />
26                <pathelement location="lib/colt-1.2.0.jar" />
27                <pathelement location="lib/concurrent-1.3.4.jar" />
28                <pathelement location="lib/j3d-core-1.3.1.jar" />
29                <pathelement location="lib/jung-3d-2.0.1.jar" />
30                <pathelement location="lib/jung-3d-demos-2.0.1.jar" />
31                <pathelement location="lib/jung-algorithms-2.0.1.jar" />
32                <pathelement location="lib/jung-api-2.0.1.jar" />
33                <pathelement location="lib/jung-graph-impl-2.0.1.jar" />
34                <pathelement location="lib/jung-io-2.0.1.jar" />
35                <pathelement location="lib/jung-jai-2.0.1.jar" />
36                <pathelement location="lib/jung-jai-samples-2.0.1.jar" />
37                <pathelement location="lib/jung-samples-2.0.1.jar" />
38                <pathelement location="lib/jung-visualization-2.0.1.jar" />
39                <pathelement location="lib/stax-api-1.0.1.jar" />
40                <pathelement location="lib/vecmath-1.3.1.jar" />
41                <pathelement location="lib/wstx-asl-3.2.6.jar" />
42                <pathelement location="lib/commons-codec-1.5.jar" />
43                <pathelement location="lib/org.eclipse.core.commands_3.6.0.I20110111-0800.jar" />
44                <pathelement location="lib/org.eclipse.equinox.common_3.6.0.v20110523.jar" />
45                <pathelement location="lib/org.eclipse.jface_3.7.0.I20110522-1430.jar" />
46                <pathelement location="lib/org.eclipse.osgi_3.7.0.v20110613.jar" />
47                <pathelement location="lib/org.eclipse.swt.win32.win32.x86_3.7.0.v3735b.jar" />
48                <pathelement location="lib/org.eclipse.ui.forms_3.5.100.v20110425.jar" />
49                <pathelement location="lib/org.eclipse.ui.workbench_3.7.0.I20110519-0100.jar" />
50                <pathelement location="lib/gui-model-core.jar" />
51                <pathelement location="lib/log4j-1.2.16.jar" />
52                <pathelement location="lib/jopt-simple-3.3.jar" />
53                <path refid="JavaHelperLib.classpath" />
54                <path refid="EventBenchCore.classpath" />
55        </path>
56
57        <!-- EventBenchCore Properties -->
58        <property name="build.location.eventbenchcore" value="${build.location}/eventbenchcore" />
59        <property name="EventBenchCore.jarname" value="eventbenchcore.jar" />
60        <property name="EventBenchCore.location" value="../EventBenchCore" />
61        <path id="EventBenchCore.classpath">
62                <pathelement location="${build.location.eventbenchcore}" />
63                <pathelement location="lib/Jama-1.0.2.jar" />
64                <pathelement location="lib/colt-1.2.0.jar" />
65                <pathelement location="lib/concurrent-1.3.4.jar" />
66                <pathelement location="lib/j3d-core-1.3.1.jar" />
67                <pathelement location="lib/jung-3d-2.0.1.jar" />
68                <pathelement location="lib/jung-3d-demos-2.0.1.jar" />
69                <pathelement location="lib/jung-algorithms-2.0.1.jar" />
70                <pathelement location="lib/jung-api-2.0.1.jar" />
71                <pathelement location="lib/jung-graph-impl-2.0.1.jar" />
72                <pathelement location="lib/jung-io-2.0.1.jar" />
73                <pathelement location="lib/jung-jai-2.0.1.jar" />
74                <pathelement location="lib/jung-jai-samples-2.0.1.jar" />
75                <pathelement location="lib/jung-samples-2.0.1.jar" />
76                <pathelement location="lib/jung-visualization-2.0.1.jar" />
77                <pathelement location="lib/stax-api-1.0.1.jar" />
78                <pathelement location="lib/vecmath-1.3.1.jar" />
79                <pathelement location="lib/wstx-asl-3.2.6.jar" />
80                <pathelement location="lib/commons-codec-1.5.jar" />
81                <pathelement location="lib/collections-generic-4.01.jar" />
82                <path refid="JavaHelperLib.classpath" />
83        </path>
84
85        <!-- JavaHelperLib Properties -->
86        <property name="build.location.javahelperlib" value="${build.location}/javahelperlib" />
87        <property name="JavaHelperLib.jarname" value="javahelperlib.jar" />
88        <property name="JavaHelperLib.location" value="../JavaHelperLib" />
89        <path id="JavaHelperLib.classpath">
90                <pathelement location="${build.location.javahelperlib}" />
91        </path>
92
93        <!-- JFCMonitor Properties -->
94        <property name="build.location.jfcmonitor" value="${build.location}/jfcmonitor" />
95        <property name="JFCMonitor.jarname" value="jfcmonitor.jar" />
96        <property name="JFCMonitor.location" value="../JFCMonitor" />
97        <path id="JFCMonitor.classpath">
98                <pathelement location="${build.location.jfcmonitor}" />
99        </path>
100
101        <!-- Emma Configuration -->
102        <property name="coverage.location" value="coverage" />
103        <property name="coverage.instrumented" value="inst" />
104        <property name="coverage.instrumented.javahelperlib" value="${coverage.instrumented}/javahelperlib" />
105        <property name="coverage.instrumented.eventbenchcore" value="${coverage.instrumented}/eventbenchcore" />
106        <path id="emma.classpath">
107                <pathelement location="lib-test/emma.jar" />
108                <pathelement location="lib-test/emma_ant.jar" />
109        </path>
110
111        <taskdef resource="emma_ant.properties" classpathref="emma.classpath" />
112
113        <!-- JUnit Test General Properties -->
114        <property name="test.location.results" value="test-results" />
115        <property name="test.location.data" value="testdata" />
116        <property name="test.location.output" value="testoutput" />
117        <path id="JUnit.classpath">
118                <pathelement location="lib-test/junit-4.10.jar" />
119                <pathelement location="lib-test/junit-addons-1.4.jar" />
120        </path>
121
122        <!-- JUnit Test EventBenchCore Properties -->
123        <property name="test.location.eventbenchcore" value="${build.location}/eventbenchcore-test" />
124        <property name="EventBenchCoreTest.location" value="../EventBenchCoreTest" />
125        <property name="test.eventbenchcore.main-class" value="de.ugoe.cs.eventbench.TestAll" />
126        <property name="test.eventbenchcore.results" value="${test.location.results}/eventbenchcore" />
127        <path id="EventBenchCoreJUnitCompile.classpath">
128                <pathelement location="${test.location.eventbenchcore}" />
129                <!--<pathelement location="${coverage.instrumented.eventbenchcore}" /> -->
130                <path refid="EventBenchCore.classpath" />
131                <path refid="JUnit.classpath" />
132        </path>
133        <path id="EventBenchCoreJUnitExecute.classpath">
134                <pathelement location="${coverage.instrumented.eventbenchcore}" />
135                <path refid="EventBenchCoreJUnitCompile.classpath" />
136                <path refid="emma.classpath" />
137        </path>
138
139        <!-- JUnit Test JavaHelperLib Properties -->
140        <property name="test.location.javahelperlib" value="${build.location}/javahelperlib-test" />
141        <property name="JavaHelperLibTest.location" value="../JavaHelperLibTest" />
142        <property name="test.javahelperlib.main-class" value="de.ugoe.cs.util.TestAll" />
143        <property name="test.javahelperlib.results" value="${test.location.results}/javahelperlib" />
144        <path id="JavaHelperLibJUnitCompile.classpath">
145                <pathelement location="${test.location.javahelperlib}" />
146                <path refid="JavaHelperLib.classpath" />
147                <path refid="JUnit.classpath" />
148        </path>
149        <path id="JavaHelperLibJUnitExecute.classpath">
150                <pathelement location="${coverage.instrumented.javahelperlib}" />
151                <path refid="JavaHelperLibJUnitCompile.classpath" />
152                <path refid="emma.classpath" />
153        </path>
154
155        <!-- FindBugs Properties -->
156        <property name="findbugs.results.location" value="findbugs" />
157        <path id="findbugs.classpath">
158                <pathelement location="lib-test/findbugs-ant.jar" />
159        </path>
160        <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask"
161                classpathref="findbugs.classpath" />
162
163        <!-- Initialization Targets -->
164        <target name="init.build">
165                <mkdir dir="${build.location}" />
166        </target>
167        <target name="init.dist">
168                <mkdir dir="${dist.location}" />
169                <mkdir dir="${dist.location.main}" />
170                <mkdir dir="${dist.location.jfcmonitor}" />
171        </target>
172        <target name="init.downloads">
173                <mkdir dir="${downloads.location}" />
174        </target>
175        <target name="init.javadoc">
176                <mkdir dir="${javadoc.location}" />
177        </target>
178        <target depends="init.build" name="init.eventbenchconsole">
179                <mkdir dir="${build.location.eventbenchconsole}" />
180        </target>
181        <target depends="init.build" name="init.eventbenchcore">
182                <mkdir dir="${build.location.eventbenchcore}" />
183        </target>
184        <target depends="init.build" name="init.javahelperlib">
185                <mkdir dir="${build.location.javahelperlib}" />
186        </target>
187        <target depends="init.build" name="init.jfcmonitor">
188                <mkdir dir="${build.location.jfcmonitor}" />
189        </target>
190        <target depends="init.build" name="init.junit">
191                <mkdir dir="${test.location.results}" />
192                <mkdir dir="${test.location.data}" />
193                <mkdir dir="${test.location.output}" />
194        </target>
195        <target depends="init.junit" name="init.eventbenchcore-test">
196                <mkdir dir="${test.location.eventbenchcore}" />
197        </target>
198        <target depends="init.junit" name="init.javahelperlib-test">
199                <mkdir dir="${test.location.javahelperlib}" />
200                <copy includeemptydirs="true" todir="${test.location.data}">
201                        <fileset dir="${JavaHelperLibTest.location}/testdata" />
202                </copy>
203        </target>
204        <target name="init.emma">
205                <mkdir dir="${coverage.instrumented}" />
206                <mkdir dir="${coverage.location}" />
207        </target>
208        <target name="init.findbugs">
209                <mkdir dir="${findbugs.results.location}" />
210        </target>
211
212        <!-- Clean-up Targets -->
213        <target name="clean.build">
214                <delete dir="${build.location}" />
215        </target>
216        <target name="clean.dist">
217                <delete dir="${dist.location}" />
218        </target>
219        <target name="clean.javadoc">
220                <delete dir="${javadoc.location}" />
221        </target>
222        <target name="clean.junit">
223                <delete dir="${test.location.results}" />
224                <delete dir="${test.location.data}" />
225                <delete dir="${test.location.output}" />
226        </target>
227        <target name="clean.emma">
228                <delete dir="${coverage.instrumented}" />
229        </target>
230        <target name="clean.findbugs">
231                <delete dir="${findbugs.results.location}" />
232        </target>
233        <target depends="clean.build,clean.dist,clean.javadoc,clean.junit,clean.emma,clean.findbugs"
234                name="clean.all" />
235
236        <!-- Build Targets -->
237        <target
238                depends="build.javahelperlib,build.eventbenchcore,build.eventbenchconsole,build.jfcmonitor"
239                name="build" />
240        <target depends="init.eventbenchconsole" name="build.eventbenchconsole">
241                <javac debug="true" debuglevel="${debuglevel}"
242                        destdir="${build.location.eventbenchconsole}" source="${source}"
243                        target="${target}" includeantruntime="false">
244                        <src path="${EventBenchConsole.location}/src" />
245                        <classpath refid="EventBenchConsole.classpath" />
246                </javac>
247        </target>
248        <target depends="init.eventbenchcore" name="build.eventbenchcore">
249                <javac debug="true" debuglevel="${debuglevel}"
250                        destdir="${build.location.eventbenchcore}" source="${source}" target="${target}"
251                        includeantruntime="false">
252                        <src path="${EventBenchCore.location}/src" />
253                        <classpath refid="EventBenchCore.classpath" />
254                </javac>
255        </target>
256        <target depends="init.javahelperlib" name="build.javahelperlib">
257                <javac debug="true" debuglevel="${debuglevel}" destdir="${build.location.javahelperlib}"
258                        source="${source}" target="${target}" includeantruntime="false">
259                        <src path="${JavaHelperLib.location}/src" />
260                        <classpath refid="JavaHelperLib.classpath" />
261                </javac>
262        </target>
263        <target depends="init.jfcmonitor" name="build.jfcmonitor">
264                <javac debug="true" debuglevel="${debuglevel}" destdir="${build.location.jfcmonitor}"
265                        source="${source}" target="${target}" includeantruntime="false">
266                        <src path="${JFCMonitor.location}/src" />
267                        <classpath refid="JFCMonitor.classpath" />
268                </javac>
269        </target>
270
271        <!-- Distribution Targets -->
272        <target depends="build,init.dist,javadoc" name="dist">
273                <!-- dist of main components, i.e., the console -->
274                <pathconvert property="dist.libs" pathsep=" ">
275                        <mapper>
276                                <chainedmapper>
277                                        <flattenmapper />
278                                        <globmapper from="*" to="lib/*" />
279                                </chainedmapper>
280                        </mapper>
281                        <path>
282                                <fileset dir="lib">
283                                        <include name="**/*.jar" />
284                                </fileset>
285                        </path>
286                </pathconvert>
287                <property name="dist.classpath"
288                        value="${dist.libs} ${JavaHelperLib.jarname} ${EventBenchCore.jarname}"></property>
289                <jar destfile="${dist.location.main}/${EventBenchConsole.jarname}"
290                        basedir="${build.location.eventbenchconsole}">
291                        <manifest>
292                                <attribute name="Built-By" value="${user.name}" />
293                                <attribute name="Main-Class" value="de.ugoe.cs.eventbench.Runner" />
294                                <attribute name="Class-Path" value="${dist.classpath}" />
295                        </manifest>
296                </jar>
297                <jar destfile="${dist.location.main}/${EventBenchCore.jarname}"
298                        basedir="${build.location.eventbenchcore}">
299                        <manifest>
300                                <attribute name="Built-By" value="${user.name}" />
301                        </manifest>
302                </jar>
303                <jar destfile="${dist.location.main}/${JavaHelperLib.jarname}"
304                        basedir="${build.location.javahelperlib}">
305                        <manifest>
306                                <attribute name="Built-By" value="${user.name}" />
307                                <attribute name="Class-Path" value="${dist.classpath}" />
308                        </manifest>
309                </jar>
310                <copy includeemptydirs="false" todir="${dist.location.main}/lib">
311                        <fileset dir="lib" />
312                </copy>
313                <copy todir="${dist.location.main}/misc">
314                        <fileset dir="${EventBenchConsole.location}/misc" />
315                </copy>
316                <copy todir="${dist.location.main}/rules">
317                        <fileset dir="${EventBenchConsole.location}/rules" />
318                </copy>
319
320                <!-- dist of JFCMonitor -->
321                <jar destfile="${dist.location.jfcmonitor}/${JFCMonitor.jarname}"
322                        basedir="${build.location.jfcmonitor}">
323                        <manifest>
324                                <attribute name="Built-By" value="${user.name}" />
325                                <attribute name="Main-Class" value="de.ugoe.cs.eventbench.jfcmonitor.Runner" />
326                                <attribute name="Class-Path" value="${JavaHelperLib.jarname}" />
327                        </manifest>
328                </jar>
329
330                <!-- copy Javadoc to dist -->
331                <copy includeemptydirs="false" todir="${dist.location.javadoc}">
332                        <fileset dir="${javadoc.location}" />
333                </copy>
334        </target>
335
336
337        <target depends="init.downloads,dist" name="createDownloads">
338                <zip destfile="${downloads.location}/eventbench-complete.zip">
339                        <fileset dir="${dist.location}" />
340                </zip>
341                <zip destfile="${downloads.location}/eventbench-console.zip">
342                        <fileset dir="${dist.location.main}" />
343                </zip>
344                <zip destfile="${downloads.location}/eventbench-jfcmonitor.zip">
345                        <fileset dir="${dist.location.jfcmonitor}" />
346                </zip>
347                <zip destfile="${downloads.location}/eventbench-javadoc.zip">
348                        <fileset dir="${dist.location.javadoc}" />
349                </zip>
350        </target>
351
352        <!-- Javadoc Targets -->
353        <target depends="init.javadoc" name="javadoc"
354                description="o Create Javadocs (Requires Javadoc 1.4+)">
355                <javadoc destdir="${javadoc.location}"
356                        additionalparam="-J-Dorg.apache.commons.attributes.javadoc.CATaglet.sources=${basedir}">
357                        <classpath refid="JavaHelperLib.classpath" />
358                        <classpath refid="EventBenchCore.classpath" />
359                        <classpath refid="EventBenchConsole.classpath" />
360                        <classpath refid="JFCMonitor.classpath" />
361                        <link href="http://download.oracle.com/javase/6/docs/api/" />
362                        <fileset dir="${JavaHelperLib.location}/src" includes="**/*.java" />
363                        <fileset dir="${EventBenchCore.location}/src" includes="**/*.java" />
364                        <fileset dir="${EventBenchConsole.location}/src" includes="**/*.java" />
365                        <fileset dir="${JFCMonitor.location}/src" includes="**/*.java" />
366                </javadoc>
367        </target>
368
369        <!-- JUnit Targets -->
370        <target depends="init.eventbenchcore-test, emma.instrument.eventbenchcore"
371                name="build.eventbenchcore-test">
372                <javac debug="true" debuglevel="${debuglevel}" destdir="${test.location.eventbenchcore}"
373                        source="${source}" target="${target}" includeantruntime="false">
374                        <src path="${EventBenchCoreTest.location}/src" />
375                        <classpath refid="EventBenchCoreJUnitCompile.classpath" />
376                </javac>
377        </target>
378        <target depends="init.javahelperlib-test, emma.instrument.javahelperlib"
379                name="build.javahelperlib-test">
380                <javac debug="true" debuglevel="${debuglevel}" destdir="${test.location.javahelperlib}"
381                        source="${source}" target="${target}" includeantruntime="false">
382                        <src path="${JavaHelperLibTest.location}/src" />
383                        <classpath refid="JavaHelperLibJUnitCompile.classpath" />
384                </javac>
385        </target>
386
387        <target depends="emma.instrument.eventbenchcore,build.eventbenchcore-test"
388                name="junit.eventbenchcore">
389                <junit fork="on" printsummary="yes" haltonfailure="no">
390                        <classpath refid="EventBenchCoreJUnitExecute.classpath" />
391                        <test name="${test.eventbenchcore.main-class}" haltonfailure="no"
392                                outfile="${test.eventbenchcore.results}">
393                                <formatter type="xml" />
394                        </test>
395                        <jvmarg
396                                value="-Demma.coverage.out.file=${coverage.location}/eventbenchcore.emma" />
397                        <jvmarg value="-Demma.coverage.out.merge=true" />
398                </junit>
399        </target>
400        <target depends="emma.instrument.javahelperlib,build.javahelperlib-test"
401                name="junit.javahelperlib">
402                <junit fork="on" printsummary="yes" haltonfailure="no">
403                        <classpath refid="JavaHelperLibJUnitExecute.classpath" />
404                        <test name="${test.javahelperlib.main-class}" haltonfailure="no"
405                                outfile="${test.javahelperlib.results}">
406                                <formatter type="xml" />
407                        </test>
408                        <jvmarg
409                                value="-Demma.coverage.out.file=${coverage.location}/javahelperlib.emma" />
410                        <jvmarg value="-Demma.coverage.out.merge=true" />
411                </junit>
412        </target>
413
414        <target depends="junit.javahelperlib,junit.eventbenchcore" name="junit" />
415
416        <!-- Emma Targets -->
417        <target depends="build.javahelperlib, init.emma" name="emma.instrument.javahelperlib">
418                <emma enabled="true">
419                        <instr instrpath="${build.location.javahelperlib}" destdir="${coverage.instrumented.javahelperlib}"
420                                metadatafile="${coverage.location}/javahelperlib.emma" merge="true" />
421                </emma>
422        </target>
423        <target depends="build.eventbenchcore, init.emma" name="emma.instrument.eventbenchcore">
424                <emma enabled="true">
425                        <instr instrpath="${build.location.eventbenchcore}" destdir="${coverage.instrumented.eventbenchcore}"
426                                metadatafile="${coverage.location}/eventbenchcore.emma" merge="true" />
427                </emma>
428        </target>
429        <target depends="junit" name="emma.report">
430                <emma enabled="true">
431                        <report sourcepath="${JavaHelperLib.location}">
432                                <fileset dir="${coverage.location}">
433                                        <include name="*.emma" />
434                                </fileset>
435                                <xml outfile="${coverage.location}/coverage.xml" depth="method" />
436                        </report>
437                </emma>
438        </target>
439
440        <!-- FindBugs Targets -->
441        <target depends="dist" name="findbugs.javahelperlib">
442                <mkdir dir="${findbugs.results.location}" />
443                <findbugs home="lib-test" output="xml"
444                        outputFile="${findbugs.results.location}/findbugs-javahelperlib.xml">
445                        <auxClasspath refid="JavaHelperLib.classpath" />
446                        <sourcePath path="${JavaHelperLib.location}" />
447                        <class location="${dist.location.main}/${JavaHelperLib.jarname}" />
448                </findbugs>
449        </target>
450        <target depends="dist" name="findbugs.eventbenchcore">
451                <mkdir dir="${findbugs.results.location}" />
452                <findbugs home="lib-test" output="xml"
453                        outputFile="${findbugs.results.location}/findbugs-eventbenchcore.xml">
454                        <auxClasspath refid="EventBenchCore.classpath" />
455                        <sourcePath path="${EventBenchCore.location}" />
456                        <class location="${dist.location.main}/${EventBenchCore.jarname}" />
457                </findbugs>
458        </target>
459        <target depends="dist" name="findbugs.eventbenchconsole">
460                <mkdir dir="${findbugs.results.location}" />
461                <findbugs home="lib-test" output="xml"
462                        outputFile="${findbugs.results.location}/findbugs-eventbenchconsole.xml">
463                        <auxClasspath refid="EventBenchConsole.classpath" />
464                        <sourcePath path="${EventBenchConsole.location}" />
465                        <class location="${dist.location.main}/${EventBenchConsole.jarname}" />
466                </findbugs>
467        </target>
468        <target depends="dist" name="findbugs.jfcmonitor">
469                <mkdir dir="${findbugs.results.location}" />
470                <findbugs home="lib-test" output="xml"
471                        outputFile="${findbugs.results.location}/findbugs-jfcmonitor.xml">
472                        <auxClasspath refid="JFCMonitor.classpath" />
473                        <sourcePath path="${JFCMonitor.location}" />
474                        <class location="${dist.location.jfcmonitor}/${JFCMonitor.jarname}" />
475                </findbugs>
476        </target>
477        <target depends="findbugs.javahelperlib,findbugs.eventbenchcore,findbugs.eventbenchconsole,findbugs.jfcmonitor" name="findbugs" />
478</project>
Note: See TracBrowser for help on using the repository browser.