source: trunk/JavaCommons/build.xml @ 276

Last change on this file since 276 was 276, checked in by sherbold, 13 years ago
  • ant script now copies test data from test projects to allow correct execution of all JUnit tests
  • Property svn:mime-type set to text/plain
File size: 15.6 KB
RevLine 
[221]1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<project basedir="." default="dist" name="EventBench">
[272]3        <!-- General Properties -->
[221]4        <property environment="env" />
5        <property name="build.location" value="bin" />
6        <property name="dist.location" value="dist" />
[272]7        <property name="javadoc.location" value="javadoc" />
8        <property name="debuglevel" value="source,lines,vars" />
9        <property name="target" value="1.6" />
10        <property name="source" value="1.6" />
11
12        <!-- Distribution Properties -->
[266]13        <property name="dist.location.main" value="${dist.location}/console" />
14        <property name="dist.location.jfcmonitor" value="${dist.location}/jfcmonitor" />
[269]15        <property name="dist.location.javadoc" value="${dist.location}/javadoc" />
[272]16
17        <!-- EventBenchConsole Properties -->
18        <property name="build.location.eventbenchconsole" value="${build.location}/eventbenchconsole" />
[221]19        <property name="EventBenchConsole.jarname" value="eventbenchconsole.jar" />
20        <property name="EventBenchConsole.location" value="../EventBenchConsole" />
[272]21        <path id="EventBenchConsole.classpath">
22                <pathelement location="${build.location.eventbenchconsole}" />
23                <pathelement location="lib/collections-generic-4.01.jar" />
24                <pathelement location="lib/jdom.jar" />
[221]25                <pathelement location="lib/colt-1.2.0.jar" />
26                <pathelement location="lib/concurrent-1.3.4.jar" />
27                <pathelement location="lib/j3d-core-1.3.1.jar" />
28                <pathelement location="lib/jung-3d-2.0.1.jar" />
29                <pathelement location="lib/jung-3d-demos-2.0.1.jar" />
30                <pathelement location="lib/jung-algorithms-2.0.1.jar" />
31                <pathelement location="lib/jung-api-2.0.1.jar" />
32                <pathelement location="lib/jung-graph-impl-2.0.1.jar" />
33                <pathelement location="lib/jung-io-2.0.1.jar" />
34                <pathelement location="lib/jung-jai-2.0.1.jar" />
35                <pathelement location="lib/jung-jai-samples-2.0.1.jar" />
36                <pathelement location="lib/jung-samples-2.0.1.jar" />
37                <pathelement location="lib/jung-visualization-2.0.1.jar" />
38                <pathelement location="lib/stax-api-1.0.1.jar" />
39                <pathelement location="lib/vecmath-1.3.1.jar" />
40                <pathelement location="lib/wstx-asl-3.2.6.jar" />
41                <pathelement location="lib/commons-codec-1.5.jar" />
[272]42                <pathelement location="lib/org.eclipse.core.commands_3.6.0.I20110111-0800.jar" />
43                <pathelement location="lib/org.eclipse.equinox.common_3.6.0.v20110523.jar" />
44                <pathelement location="lib/org.eclipse.jface_3.7.0.I20110522-1430.jar" />
45                <pathelement location="lib/org.eclipse.osgi_3.7.0.v20110613.jar" />
46                <pathelement location="lib/org.eclipse.swt.win32.win32.x86_3.7.0.v3735b.jar" />
47                <pathelement location="lib/org.eclipse.ui.forms_3.5.100.v20110425.jar" />
48                <pathelement location="lib/org.eclipse.ui.workbench_3.7.0.I20110519-0100.jar" />
49                <pathelement location="lib/gui-model-core.jar" />
50                <pathelement location="lib/log4j-1.2.16.jar" />
51                <pathelement location="lib/jopt-simple-3.3.jar" />
[221]52                <path refid="JavaHelperLib.classpath" />
[272]53                <path refid="EventBenchCore.classpath" />
[221]54        </path>
[272]55
56        <!-- EventBenchCore Properties -->
57        <property name="build.location.eventbenchcore" value="${build.location}/eventbenchcore" />
58        <property name="EventBenchCore.jarname" value="eventbenchcore.jar" />
59        <property name="EventBenchCore.location" value="../EventBenchCore" />
60        <path id="EventBenchCore.classpath">
61                <pathelement location="${build.location.eventbenchcore}" />
62                <pathelement location="lib/Jama-1.0.2.jar" />
[221]63                <pathelement location="lib/colt-1.2.0.jar" />
64                <pathelement location="lib/concurrent-1.3.4.jar" />
65                <pathelement location="lib/j3d-core-1.3.1.jar" />
66                <pathelement location="lib/jung-3d-2.0.1.jar" />
67                <pathelement location="lib/jung-3d-demos-2.0.1.jar" />
68                <pathelement location="lib/jung-algorithms-2.0.1.jar" />
69                <pathelement location="lib/jung-api-2.0.1.jar" />
70                <pathelement location="lib/jung-graph-impl-2.0.1.jar" />
71                <pathelement location="lib/jung-io-2.0.1.jar" />
72                <pathelement location="lib/jung-jai-2.0.1.jar" />
73                <pathelement location="lib/jung-jai-samples-2.0.1.jar" />
74                <pathelement location="lib/jung-samples-2.0.1.jar" />
75                <pathelement location="lib/jung-visualization-2.0.1.jar" />
76                <pathelement location="lib/stax-api-1.0.1.jar" />
77                <pathelement location="lib/vecmath-1.3.1.jar" />
78                <pathelement location="lib/wstx-asl-3.2.6.jar" />
79                <pathelement location="lib/commons-codec-1.5.jar" />
[272]80                <pathelement location="lib/collections-generic-4.01.jar" />
[221]81                <path refid="JavaHelperLib.classpath" />
82        </path>
[272]83
84        <!-- JavaHelperLib Properties -->
85        <property name="build.location.javahelperlib" value="${build.location}/javahelperlib" />
86        <property name="JavaHelperLib.jarname" value="javahelperlib.jar" />
87        <property name="JavaHelperLib.location" value="../JavaHelperLib" />
88        <path id="JavaHelperLib.classpath">
89                <pathelement location="${build.location.javahelperlib}" />
90        </path>
91
92        <!-- JFCMonitor Properties -->
93        <property name="build.location.jfcmonitor" value="${build.location}/jfcmonitor" />
94        <property name="JFCMonitor.jarname" value="jfcmonitor.jar" />
95        <property name="JFCMonitor.location" value="../JFCMonitor" />
[266]96        <path id="JFCMonitor.classpath" />
[272]97
[275]98        <!-- JUnit Test General Properties -->
99        <property name="test.location.results" value="test-results" />
[276]100        <property name="test.location.data" value="testdata" />
101        <property name="test.location.output" value="testoutput" />
[275]102        <path id="JUnit.classpath">
103                <pathelement location="lib-test/junit-4.10.jar" />
104                <pathelement location="lib-test/junit-addons-1.4.jar" />
105        </path>
106
107        <!-- JUnit Test EventBenchCore Properties -->
108        <property name="test.location.eventbenchcore" value="${build.location}/eventbenchcore-test" />
109        <property name="EventBenchCoreTest.location" value="../EventBenchCoreTest" />
110        <property name="test.eventbenchcore.main-class" value="de.ugoe.cs.eventbench.TestAll" />
111        <property name="test.eventbenchcore.results" value="${test.location.results}/eventbenchcore" />
112        <path id="EventBenchCoreTest.classpath">
113                <pathelement location="${test.location.eventbenchcore}" />
114                <path refid="EventBenchCore.classpath" />
115                <path refid="JUnit.classpath" />
116        </path>
117
118        <!-- JUnit Test JavaHelperLib Properties -->
119        <property name="test.location.javahelperlib" value="${build.location}/javahelperlib-test" />
120        <property name="JavaHelperLibTest.location" value="../JavaHelperLibTest" />
121        <property name="test.javahelperlib.main-class" value="de.ugoe.cs.util.TestAll" />
122        <property name="test.javahelperlib.results" value="${test.location.results}/javahelperlib" />
123        <path id="JavaHelperLibTest.classpath">
124                <pathelement location="${test.location.javahelperlib}" />
125                <path refid="JavaHelperLib.classpath" />
126                <path refid="JUnit.classpath" />
127        </path>
128
[272]129        <!-- Initialization Targets -->
[221]130        <target name="init.build">
131                <mkdir dir="bin" />
132        </target>
133        <target name="init.dist">
[266]134                <mkdir dir="${dist.location}" />
135                <mkdir dir="${dist.location.main}" />
136                <mkdir dir="${dist.location.jfcmonitor}" />
[221]137        </target>
[272]138        <target depends="init.build" name="init.eventbenchconsole">
139                <mkdir dir="${build.location.eventbenchconsole}" />
140        </target>
141        <target depends="init.build" name="init.eventbenchcore">
142                <mkdir dir="${build.location.eventbenchcore}" />
143        </target>
144        <target depends="init.build" name="init.javahelperlib">
145                <mkdir dir="${build.location.javahelperlib}" />
146        </target>
147        <target depends="init.build" name="init.jfcmonitor">
148                <mkdir dir="${build.location.jfcmonitor}" />
149        </target>
150
151        <!-- Clean-up Targets -->
[221]152        <target name="clean.build">
153                <delete dir="${build.location}" />
154        </target>
155        <target name="clean.dist">
156                <delete dir="${dist.location}" />
157        </target>
158        <target name="clean.javadoc">
159                <delete dir="${javadoc.location}" />
160        </target>
161        <target depends="clean.build,clean.dist,clean.javadoc" name="clean.all" />
[272]162
163        <!-- Build Targets -->
[221]164        <target
[266]165                depends="build.javahelperlib,build.eventbenchcore,build.eventbenchconsole,build.jfcmonitor"
[221]166                name="build" />
167        <target depends="init.eventbenchconsole" name="build.eventbenchconsole">
168                <javac debug="true" debuglevel="${debuglevel}"
169                        destdir="${build.location.eventbenchconsole}" source="${source}"
170                        target="${target}" includeantruntime="false">
171                        <src path="${EventBenchConsole.location}/src" />
172                        <classpath refid="EventBenchConsole.classpath" />
173                </javac>
174        </target>
175        <target depends="init.eventbenchcore" name="build.eventbenchcore">
176                <javac debug="true" debuglevel="${debuglevel}"
177                        destdir="${build.location.eventbenchcore}" source="${source}" target="${target}"
178                        includeantruntime="false">
179                        <src path="${EventBenchCore.location}/src" />
180                        <classpath refid="EventBenchCore.classpath" />
181                </javac>
182        </target>
183        <target depends="init.javahelperlib" name="build.javahelperlib">
184                <javac debug="true" debuglevel="${debuglevel}" destdir="${build.location.javahelperlib}"
185                        source="${source}" target="${target}" includeantruntime="false">
186                        <src path="${JavaHelperLib.location}/src" />
187                        <classpath refid="JavaHelperLib.classpath" />
188                </javac>
189        </target>
[266]190        <target depends="init.jfcmonitor" name="build.jfcmonitor">
191                <javac debug="true" debuglevel="${debuglevel}" destdir="${build.location.jfcmonitor}"
192                        source="${source}" target="${target}" includeantruntime="false">
193                        <src path="${JFCMonitor.location}/src" />
194                        <classpath refid="JFCMonitor.classpath" />
195                </javac>
196        </target>
[275]197
[272]198        <!-- Distribution Targets -->
[221]199        <target depends="build,init.dist,javadoc" name="dist">
[266]200                <!-- dist of main components, i.e., the console -->
[221]201                <pathconvert property="dist.libs" pathsep=" ">
202                        <mapper>
203                                <chainedmapper>
204                                        <flattenmapper />
205                                        <globmapper from="*" to="lib/*" />
206                                </chainedmapper>
207                        </mapper>
208                        <path>
209                                <fileset dir="lib">
210                                        <include name="**/*.jar" />
211                                </fileset>
212                        </path>
213                </pathconvert>
214                <property name="dist.classpath"
215                        value="${dist.libs} ${JavaHelperLib.jarname} ${EventBenchCore.jarname}"></property>
[266]216                <jar destfile="${dist.location.main}/${EventBenchConsole.jarname}"
[221]217                        basedir="${build.location.eventbenchconsole}">
218                        <manifest>
219                                <attribute name="Built-By" value="${user.name}" />
220                                <attribute name="Main-Class" value="de.ugoe.cs.eventbench.Runner" />
221                                <attribute name="Class-Path" value="${dist.classpath}" />
222                        </manifest>
223                </jar>
[266]224                <jar destfile="${dist.location.main}/${EventBenchCore.jarname}"
[221]225                        basedir="${build.location.eventbenchcore}">
226                        <manifest>
227                                <attribute name="Built-By" value="${user.name}" />
228                        </manifest>
229                </jar>
[272]230                <jar destfile="${dist.location.main}/${JavaHelperLib.jarname}"
231                        basedir="${build.location.javahelperlib}">
[221]232                        <manifest>
233                                <attribute name="Built-By" value="${user.name}" />
234                                <attribute name="Class-Path" value="${dist.classpath}" />
235                        </manifest>
236                </jar>
[266]237                <copy includeemptydirs="false" todir="${dist.location.main}/lib">
[221]238                        <fileset dir="lib" />
239                </copy>
[266]240                <copy todir="${dist.location.main}/misc">
[221]241                        <fileset dir="${EventBenchConsole.location}/misc" />
242                </copy>
[266]243                <copy todir="${dist.location.main}/rules">
[221]244                        <fileset dir="${EventBenchConsole.location}/rules" />
245                </copy>
[272]246
[266]247                <!-- dist of JFCMonitor -->
[272]248                <jar destfile="${dist.location.jfcmonitor}/${JFCMonitor.jarname}"
249                        basedir="${build.location.jfcmonitor}">
[266]250                        <manifest>
251                                <attribute name="Built-By" value="${user.name}" />
252                                <attribute name="Main-Class" value="de.ugoe.cs.eventbench.jfcmonitor.Runner" />
[269]253                                <attribute name="Class-Path" value="${JavaHelperLib.jarname}" />
[266]254                        </manifest>
255                </jar>
[272]256
[269]257                <!-- copy Javadoc to dist -->
258                <copy includeemptydirs="false" todir="${dist.location.javadoc}">
259                        <fileset dir="${javadoc.location}" />
260                </copy>
[221]261        </target>
[275]262
[272]263        <!-- Javadoc Targets -->
264        <target name="javadoc" description="o Create Javadocs (Requires Javadoc 1.4+)">
[221]265                <mkdir dir="${javadoc.location}/javahelperlib" />
266                <mkdir dir="${javadoc.location}/eventbenchcore" />
267                <mkdir dir="${javadoc.location}/eventbenchconsole" />
[269]268                <mkdir dir="${javadoc.location}/jfcmonitor" />
[221]269                <javadoc destdir="${javadoc.location}/javahelperlib"
270                        additionalparam="-J-Dorg.apache.commons.attributes.javadoc.CATaglet.sources=${basedir}">
271                        <classpath refid="JavaHelperLib.classpath" />
272                        <link href="http://download.oracle.com/javase/6/docs/api/" />
273                        <fileset dir="${JavaHelperLib.location}/src" includes="**/*.java" />
274                </javadoc>
275                <javadoc destdir="${javadoc.location}/eventbenchcore"
276                        additionalparam="-J-Dorg.apache.commons.attributes.javadoc.CATaglet.sources=${basedir}">
277                        <classpath refid="EventBenchCore.classpath" />
278                        <link resolveLink="true" href="${javadoc.location}/javahelperlib/" />
279                        <link href="http://download.oracle.com/javase/6/docs/api/" />
280                        <fileset dir="${EventBenchCore.location}/src" includes="**/*.java" />
281                </javadoc>
282                <javadoc destdir="${javadoc.location}/eventbenchconsole"
283                        additionalparam="-J-Dorg.apache.commons.attributes.javadoc.CATaglet.sources=${basedir}">
284                        <classpath refid="EventBenchConsole.classpath" />
285                        <link resolveLink="true" href="${javadoc.location}/javahelperlib/" />
286                        <link resolveLink="true" href="${javadoc.location}/eventbenchcore/" />
287                        <link href="http://download.oracle.com/javase/6/docs/api/" />
288                        <fileset dir="${EventBenchConsole.location}/src" includes="**/*.java" />
289                </javadoc>
[269]290                <javadoc destdir="${javadoc.location}/jfcmonitor"
291                        additionalparam="-J-Dorg.apache.commons.attributes.javadoc.CATaglet.sources=${basedir}">
292                        <classpath refid="JFCMonitor.classpath" />
293                        <link href="http://download.oracle.com/javase/6/docs/api/" />
294                        <fileset dir="${JFCMonitor.location}/src" includes="**/*.java" />
295                </javadoc>
[221]296        </target>
[275]297
298        <!-- JUnit Targets -->
299        <target depends="init.build" name="init.junit">
300                <mkdir dir="${test.location.results}" />
[276]301                <mkdir dir="${test.location.data}" />
302                <mkdir dir="${test.location.output}" />
[275]303        </target>
304        <target depends="init.junit" name="init.eventbenchcore-test">
305                <mkdir dir="${test.location.eventbenchcore}" />
306        </target>
307        <target depends="init.junit" name="init.javahelperlib-test">
308                <mkdir dir="${test.location.javahelperlib}" />
[276]309                <copy includeemptydirs="true" todir="${test.location.data}">
310                        <fileset dir="${JavaHelperLibTest.location}/testdata" />
311                </copy>
[275]312        </target>
313
314        <target depends="init.eventbenchcore-test" name="build.eventbenchcore-test">
315                <javac debug="true" debuglevel="${debuglevel}" destdir="${test.location.eventbenchcore}"
316                        source="${source}" target="${target}" includeantruntime="false">
317                        <src path="${EventBenchCoreTest.location}/src" />
318                        <classpath refid="EventBenchCoreTest.classpath" />
319                </javac>
320        </target>
321        <target depends="init.javahelperlib-test" name="build.javahelperlib-test">
322                <javac debug="true" debuglevel="${debuglevel}" destdir="${test.location.javahelperlib}"
323                        source="${source}" target="${target}" includeantruntime="false">
324                        <src path="${JavaHelperLibTest.location}/src" />
325                        <classpath refid="JavaHelperLibTest.classpath" />
326                </javac>
327        </target>
328
329        <target depends="build.eventbenchcore,build.eventbenchcore-test"
330                name="junit.eventbenchcore">
331                <junit fork="on" printsummary="yes" haltonfailure="no">
332                        <classpath refid="EventBenchCoreTest.classpath" />
333                        <test name="${test.eventbenchcore.main-class}" haltonfailure="no"
334                                outfile="${test.eventbenchcore.results}">
335                                <formatter type="xml" />
336                        </test>
337                </junit>
338        </target>
339        <target depends="build.javahelperlib,build.javahelperlib-test"
340                name="junit.javahelperlib">
341                <junit fork="on" printsummary="yes" haltonfailure="no">
342                        <classpath refid="JavaHelperLibTest.classpath" />
343                        <test name="${test.javahelperlib.main-class}" haltonfailure="no"
344                                outfile="${test.javahelperlib.results}">
345                                <formatter type="xml" />
346                        </test>
347                </junit>
348        </target>
349       
350        <target depends="junit.eventbenchcore,junit.javahelperlib" name="junit" />
351       
352        <target depends="dist,junit" name="distAndTest" />
[221]353</project>
Note: See TracBrowser for help on using the repository browser.