source: trunk/JavaCommons/build.xml @ 280

Last change on this file since 280 was 280, checked in by sherbold, 12 years ago
  • build script now evaluate code coverage with EMMA
  • Property svn:mime-type set to text/plain
File size: 18.1 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
99        <!-- Emma Configuration -->
100        <property name="coverage.location" value="coverage" />
101        <property name="coverage.instrumented" value="inst" />
102        <property name="coverage.instrumented.javahelperlib" value="${coverage.instrumented}/javahelperlib" />
103        <property name="coverage.instrumented.eventbenchcore" value="${coverage.instrumented}/eventbenchcore" />
104        <path id="emma.classpath">
105                <pathelement location="lib-test/emma.jar" />
106                <pathelement location="lib-test/emma_ant.jar" />
107        </path>
108
109        <taskdef resource="emma_ant.properties" classpathref="emma.classpath" />
110
111        <!-- JUnit Test General Properties -->
112        <property name="test.location.results" value="test-results" />
113        <property name="test.location.data" value="testdata" />
114        <property name="test.location.output" value="testoutput" />
115        <path id="JUnit.classpath">
116                <pathelement location="lib-test/junit-4.10.jar" />
117                <pathelement location="lib-test/junit-addons-1.4.jar" />
118        </path>
119
120        <!-- JUnit Test EventBenchCore Properties -->
121        <property name="test.location.eventbenchcore" value="${build.location}/eventbenchcore-test" />
122        <property name="EventBenchCoreTest.location" value="../EventBenchCoreTest" />
123        <property name="test.eventbenchcore.main-class" value="de.ugoe.cs.eventbench.TestAll" />
124        <property name="test.eventbenchcore.results" value="${test.location.results}/eventbenchcore" />
125        <path id="EventBenchCoreJUnitCompile.classpath">
126                <pathelement location="${test.location.eventbenchcore}" />
127                <!--<pathelement location="${coverage.instrumented.eventbenchcore}" /> -->
128                <path refid="EventBenchCore.classpath" />
129                <path refid="JUnit.classpath" />
130        </path>
131        <path id="EventBenchCoreJUnitExecute.classpath">
132                        <pathelement location="${coverage.instrumented.eventbenchcore}" />
133                        <path refid="EventBenchCoreJUnitCompile.classpath" />
134                        <path refid="emma.classpath" />
135                </path>
136
137        <!-- JUnit Test JavaHelperLib Properties -->
138        <property name="test.location.javahelperlib" value="${build.location}/javahelperlib-test" />
139        <property name="JavaHelperLibTest.location" value="../JavaHelperLibTest" />
140        <property name="test.javahelperlib.main-class" value="de.ugoe.cs.util.TestAll" />
141        <property name="test.javahelperlib.results" value="${test.location.results}/javahelperlib" />
142        <path id="JavaHelperLibJUnitCompile.classpath">
143                <pathelement location="${test.location.javahelperlib}" />
144                <path refid="JavaHelperLib.classpath" />
145                <path refid="JUnit.classpath" />
146        </path>
147        <path id="JavaHelperLibJUnitExecute.classpath">
148                <pathelement location="${coverage.instrumented.javahelperlib}" />
149                <path refid="JavaHelperLibJUnitCompile.classpath" />
150                <path refid="emma.classpath" />
151        </path>
152
153
154
155        <!-- Initialization Targets -->
156        <target name="init.build">
157                <mkdir dir="${build.location}" />
158        </target>
159        <target name="init.dist">
160                <mkdir dir="${dist.location}" />
161                <mkdir dir="${dist.location.main}" />
162                <mkdir dir="${dist.location.jfcmonitor}" />
163        </target>
164        <target name="init.downloads">
165                <mkdir dir="${downloads.location}" />
166        </target>
167        <target name="init.javadoc">
168                <mkdir dir="${javadoc.location}" />
169        </target>
170        <target depends="init.build" name="init.eventbenchconsole">
171                <mkdir dir="${build.location.eventbenchconsole}" />
172        </target>
173        <target depends="init.build" name="init.eventbenchcore">
174                <mkdir dir="${build.location.eventbenchcore}" />
175        </target>
176        <target depends="init.build" name="init.javahelperlib">
177                <mkdir dir="${build.location.javahelperlib}" />
178        </target>
179        <target depends="init.build" name="init.jfcmonitor">
180                <mkdir dir="${build.location.jfcmonitor}" />
181        </target>
182        <target depends="init.build" name="init.junit">
183                <mkdir dir="${test.location.results}" />
184                <mkdir dir="${test.location.data}" />
185                <mkdir dir="${test.location.output}" />
186        </target>
187        <target depends="init.junit" name="init.eventbenchcore-test">
188                <mkdir dir="${test.location.eventbenchcore}" />
189        </target>
190        <target depends="init.junit" name="init.javahelperlib-test">
191                <mkdir dir="${test.location.javahelperlib}" />
192                <copy includeemptydirs="true" todir="${test.location.data}">
193                        <fileset dir="${JavaHelperLibTest.location}/testdata" />
194                </copy>
195        </target>
196        <target name="init.emma">
197                <mkdir dir="${coverage.instrumented}" />
198                <mkdir dir="${coverage.location}" />
199        </target>
200
201        <!-- Clean-up Targets -->
202        <target name="clean.build">
203                <delete dir="${build.location}" />
204        </target>
205        <target name="clean.dist">
206                <delete dir="${dist.location}" />
207        </target>
208        <target name="clean.javadoc">
209                <delete dir="${javadoc.location}" />
210        </target>
211        <target name="clean.junit">
212                <delete dir="${test.location.results}" />
213                <delete dir="${test.location.data}" />
214                <delete dir="${test.location.output}" />
215        </target>
216        <target name="clean.emma">
217                <delete dir="${coverage.instrumented}" />
218                <delete dir="${coverage.location}" />
219        </target>
220        <target depends="clean.build,clean.dist,clean.javadoc,clean.junit"
221                name="clean.all" />
222
223        <!-- Build Targets -->
224        <target
225                depends="build.javahelperlib,build.eventbenchcore,build.eventbenchconsole,build.jfcmonitor"
226                name="build" />
227        <target depends="init.eventbenchconsole" name="build.eventbenchconsole">
228                <javac debug="true" debuglevel="${debuglevel}"
229                        destdir="${build.location.eventbenchconsole}" source="${source}"
230                        target="${target}" includeantruntime="false">
231                        <src path="${EventBenchConsole.location}/src" />
232                        <classpath refid="EventBenchConsole.classpath" />
233                </javac>
234        </target>
235        <target depends="init.eventbenchcore" name="build.eventbenchcore">
236                <javac debug="true" debuglevel="${debuglevel}"
237                        destdir="${build.location.eventbenchcore}" source="${source}" target="${target}"
238                        includeantruntime="false">
239                        <src path="${EventBenchCore.location}/src" />
240                        <classpath refid="EventBenchCore.classpath" />
241                </javac>
242        </target>
243        <target depends="init.javahelperlib" name="build.javahelperlib">
244                <javac debug="true" debuglevel="${debuglevel}" destdir="${build.location.javahelperlib}"
245                        source="${source}" target="${target}" includeantruntime="false">
246                        <src path="${JavaHelperLib.location}/src" />
247                        <classpath refid="JavaHelperLib.classpath" />
248                </javac>
249        </target>
250        <target depends="init.jfcmonitor" name="build.jfcmonitor">
251                <javac debug="true" debuglevel="${debuglevel}" destdir="${build.location.jfcmonitor}"
252                        source="${source}" target="${target}" includeantruntime="false">
253                        <src path="${JFCMonitor.location}/src" />
254                        <classpath refid="JFCMonitor.classpath" />
255                </javac>
256        </target>
257
258        <!-- Distribution Targets -->
259        <target depends="build,init.dist,javadoc" name="dist">
260                <!-- dist of main components, i.e., the console -->
261                <pathconvert property="dist.libs" pathsep=" ">
262                        <mapper>
263                                <chainedmapper>
264                                        <flattenmapper />
265                                        <globmapper from="*" to="lib/*" />
266                                </chainedmapper>
267                        </mapper>
268                        <path>
269                                <fileset dir="lib">
270                                        <include name="**/*.jar" />
271                                </fileset>
272                        </path>
273                </pathconvert>
274                <property name="dist.classpath"
275                        value="${dist.libs} ${JavaHelperLib.jarname} ${EventBenchCore.jarname}"></property>
276                <jar destfile="${dist.location.main}/${EventBenchConsole.jarname}"
277                        basedir="${build.location.eventbenchconsole}">
278                        <manifest>
279                                <attribute name="Built-By" value="${user.name}" />
280                                <attribute name="Main-Class" value="de.ugoe.cs.eventbench.Runner" />
281                                <attribute name="Class-Path" value="${dist.classpath}" />
282                        </manifest>
283                </jar>
284                <jar destfile="${dist.location.main}/${EventBenchCore.jarname}"
285                        basedir="${build.location.eventbenchcore}">
286                        <manifest>
287                                <attribute name="Built-By" value="${user.name}" />
288                        </manifest>
289                </jar>
290                <jar destfile="${dist.location.main}/${JavaHelperLib.jarname}"
291                        basedir="${build.location.javahelperlib}">
292                        <manifest>
293                                <attribute name="Built-By" value="${user.name}" />
294                                <attribute name="Class-Path" value="${dist.classpath}" />
295                        </manifest>
296                </jar>
297                <copy includeemptydirs="false" todir="${dist.location.main}/lib">
298                        <fileset dir="lib" />
299                </copy>
300                <copy todir="${dist.location.main}/misc">
301                        <fileset dir="${EventBenchConsole.location}/misc" />
302                </copy>
303                <copy todir="${dist.location.main}/rules">
304                        <fileset dir="${EventBenchConsole.location}/rules" />
305                </copy>
306
307                <!-- dist of JFCMonitor -->
308                <jar destfile="${dist.location.jfcmonitor}/${JFCMonitor.jarname}"
309                        basedir="${build.location.jfcmonitor}">
310                        <manifest>
311                                <attribute name="Built-By" value="${user.name}" />
312                                <attribute name="Main-Class" value="de.ugoe.cs.eventbench.jfcmonitor.Runner" />
313                                <attribute name="Class-Path" value="${JavaHelperLib.jarname}" />
314                        </manifest>
315                </jar>
316
317                <!-- copy Javadoc to dist -->
318                <copy includeemptydirs="false" todir="${dist.location.javadoc}">
319                        <fileset dir="${javadoc.location}" />
320                </copy>
321        </target>
322
323
324        <target depends="init.downloads,dist" name="createDownloads">
325                <zip destfile="${downloads.location}/eventbench-complete.zip">
326                        <fileset dir="${dist.location}" />
327                </zip>
328                <zip destfile="${downloads.location}/eventbench-console.zip">
329                        <fileset dir="${dist.location.main}" />
330                </zip>
331                <zip destfile="${downloads.location}/eventbench-jfcmonitor.zip">
332                        <fileset dir="${dist.location.jfcmonitor}" />
333                </zip>
334                <zip destfile="${downloads.location}/eventbench-javadoc.zip">
335                        <fileset dir="${dist.location.javadoc}" />
336                </zip>
337        </target>
338
339        <!-- Javadoc Targets -->
340        <target depends="init.javadoc" name="javadoc"
341                description="o Create Javadocs (Requires Javadoc 1.4+)">
342                <javadoc destdir="${javadoc.location}"
343                        additionalparam="-J-Dorg.apache.commons.attributes.javadoc.CATaglet.sources=${basedir}">
344                        <classpath refid="JavaHelperLib.classpath" />
345                        <classpath refid="EventBenchCore.classpath" />
346                        <classpath refid="EventBenchConsole.classpath" />
347                        <classpath refid="JFCMonitor.classpath" />
348                        <link href="http://download.oracle.com/javase/6/docs/api/" />
349                        <fileset dir="${JavaHelperLib.location}/src" includes="**/*.java" />
350                        <fileset dir="${EventBenchCore.location}/src" includes="**/*.java" />
351                        <fileset dir="${EventBenchConsole.location}/src" includes="**/*.java" />
352                        <fileset dir="${JFCMonitor.location}/src" includes="**/*.java" />
353                </javadoc>
354        </target>
355
356        <!-- JUnit Targets -->
357        <target depends="init.eventbenchcore-test, emma.instrument.eventbenchcore"
358                name="build.eventbenchcore-test">
359                <javac debug="true" debuglevel="${debuglevel}" destdir="${test.location.eventbenchcore}"
360                        source="${source}" target="${target}" includeantruntime="false">
361                        <src path="${EventBenchCoreTest.location}/src" />
362                        <classpath refid="EventBenchCoreJUnitCompile.classpath" />
363                </javac>
364        </target>
365        <target depends="init.javahelperlib-test, emma.instrument.javahelperlib"
366                name="build.javahelperlib-test">
367                <javac debug="true" debuglevel="${debuglevel}" destdir="${test.location.javahelperlib}"
368                        source="${source}" target="${target}" includeantruntime="false">
369                        <src path="${JavaHelperLibTest.location}/src" />
370                        <classpath refid="JavaHelperLibJUnitCompile.classpath" />
371                </javac>
372        </target>
373
374        <target depends="emma.instrument.eventbenchcore,build.eventbenchcore-test"
375                name="junit.eventbenchcore">
376                <junit fork="on" printsummary="yes" haltonfailure="no">
377                        <classpath refid="EventBenchCoreJUnitExecute.classpath" />
378                        <test name="${test.eventbenchcore.main-class}" haltonfailure="no"
379                                outfile="${test.eventbenchcore.results}">
380                                <formatter type="xml" />
381                        </test>
382                        <jvmarg
383                                                        value="-Demma.coverage.out.file=${coverage.location}/eventbenchcore.emma" />
384                                                <jvmarg value="-Demma.coverage.out.merge=true" />
385                </junit>
386        </target>
387        <target depends="emma.instrument.javahelperlib,build.javahelperlib-test"
388                name="junit.javahelperlib">
389                <junit fork="on" printsummary="yes" haltonfailure="no">
390                        <classpath refid="JavaHelperLibJUnitExecute.classpath" />
391                        <test name="${test.javahelperlib.main-class}" haltonfailure="no"
392                                outfile="${test.javahelperlib.results}">
393                                <formatter type="xml" />
394                        </test>
395                        <jvmarg
396                                value="-Demma.coverage.out.file=${coverage.location}/javahelperlib.emma" />
397                        <jvmarg value="-Demma.coverage.out.merge=true" />
398                </junit>
399        </target>
400
401        <target depends="junit.javahelperlib,junit.eventbenchcore" name="junit" />
402
403        <!-- Emma Targets -->
404        <target depends="build.javahelperlib, init.emma" name="emma.instrument.javahelperlib">
405                <emma enabled="true">
406                        <instr instrpath="${build.location.javahelperlib}" destdir="${coverage.instrumented.javahelperlib}"
407                                metadatafile="${coverage.location}/javahelperlib.emma" merge="true" />
408                </emma>
409        </target>
410        <target depends="build.eventbenchcore, init.emma" name="emma.instrument.eventbenchcore">
411                <emma enabled="true">
412                        <instr instrpath="${build.location.eventbenchcore}" destdir="${coverage.instrumented.eventbenchcore}"
413                                metadatafile="${coverage.location}/eventbenchcore.emma" merge="true" />
414                </emma>
415        </target>
416        <target depends="junit" name="emma.report">
417                <emma enabled="true">
418                        <report sourcepath="${JavaHelperLib.location}">
419                                <fileset dir="${coverage.location}">
420                                        <include name="*.emma" />
421                                </fileset>
422                                <xml outfile="${coverage.location}/coverage.xml" depth="method" />
423                        </report>
424                </emma>
425        </target>
426</project>
Note: See TracBrowser for help on using the repository browser.