source: trunk/JavaCommons/build.xml @ 275

Last change on this file since 275 was 275, checked in by sherbold, 12 years ago
  • ant script now has task to execute JUnit tests
  • Property svn:mime-type set to text/plain
File size: 15.3 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="debuglevel" value="source,lines,vars" />
9        <property name="target" value="1.6" />
10        <property name="source" value="1.6" />
11
12        <!-- Distribution Properties -->
13        <property name="dist.location.main" value="${dist.location}/console" />
14        <property name="dist.location.jfcmonitor" value="${dist.location}/jfcmonitor" />
15        <property name="dist.location.javadoc" value="${dist.location}/javadoc" />
16
17        <!-- EventBenchConsole Properties -->
18        <property name="build.location.eventbenchconsole" value="${build.location}/eventbenchconsole" />
19        <property name="EventBenchConsole.jarname" value="eventbenchconsole.jar" />
20        <property name="EventBenchConsole.location" value="../EventBenchConsole" />
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" />
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" />
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" />
52                <path refid="JavaHelperLib.classpath" />
53                <path refid="EventBenchCore.classpath" />
54        </path>
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" />
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" />
80                <pathelement location="lib/collections-generic-4.01.jar" />
81                <path refid="JavaHelperLib.classpath" />
82        </path>
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" />
96        <path id="JFCMonitor.classpath" />
97
98        <!-- JUnit Test General Properties -->
99
100        <property name="test.location.results" value="test-results" />
101        <path id="JUnit.classpath">
102                <pathelement location="lib-test/junit-4.10.jar" />
103                <pathelement location="lib-test/junit-addons-1.4.jar" />
104        </path>
105
106        <!-- JUnit Test EventBenchCore Properties -->
107        <property name="test.location.eventbenchcore" value="${build.location}/eventbenchcore-test" />
108        <property name="EventBenchCoreTest.location" value="../EventBenchCoreTest" />
109        <property name="test.eventbenchcore.main-class" value="de.ugoe.cs.eventbench.TestAll" />
110        <property name="test.eventbenchcore.results" value="${test.location.results}/eventbenchcore" />
111        <path id="EventBenchCoreTest.classpath">
112                <pathelement location="${test.location.eventbenchcore}" />
113                <path refid="EventBenchCore.classpath" />
114                <path refid="JUnit.classpath" />
115        </path>
116
117        <!-- JUnit Test JavaHelperLib Properties -->
118        <property name="test.location.javahelperlib" value="${build.location}/javahelperlib-test" />
119        <property name="JavaHelperLibTest.location" value="../JavaHelperLibTest" />
120        <property name="test.javahelperlib.main-class" value="de.ugoe.cs.util.TestAll" />
121        <property name="test.javahelperlib.results" value="${test.location.results}/javahelperlib" />
122        <path id="JavaHelperLibTest.classpath">
123                <pathelement location="${test.location.javahelperlib}" />
124                <path refid="JavaHelperLib.classpath" />
125                <path refid="JUnit.classpath" />
126        </path>
127
128        <!-- Initialization Targets -->
129        <target name="init.build">
130                <mkdir dir="bin" />
131        </target>
132        <target name="init.dist">
133                <mkdir dir="${dist.location}" />
134                <mkdir dir="${dist.location.main}" />
135                <mkdir dir="${dist.location.jfcmonitor}" />
136        </target>
137        <target depends="init.build" name="init.eventbenchconsole">
138                <mkdir dir="${build.location.eventbenchconsole}" />
139        </target>
140        <target depends="init.build" name="init.eventbenchcore">
141                <mkdir dir="${build.location.eventbenchcore}" />
142        </target>
143        <target depends="init.build" name="init.javahelperlib">
144                <mkdir dir="${build.location.javahelperlib}" />
145        </target>
146        <target depends="init.build" name="init.jfcmonitor">
147                <mkdir dir="${build.location.jfcmonitor}" />
148        </target>
149
150        <!-- Clean-up Targets -->
151        <target name="clean.build">
152                <delete dir="${build.location}" />
153        </target>
154        <target name="clean.dist">
155                <delete dir="${dist.location}" />
156        </target>
157        <target name="clean.javadoc">
158                <delete dir="${javadoc.location}" />
159        </target>
160        <target depends="clean.build,clean.dist,clean.javadoc" name="clean.all" />
161
162        <!-- Build Targets -->
163        <target
164                depends="build.javahelperlib,build.eventbenchcore,build.eventbenchconsole,build.jfcmonitor"
165                name="build" />
166        <target depends="init.eventbenchconsole" name="build.eventbenchconsole">
167                <javac debug="true" debuglevel="${debuglevel}"
168                        destdir="${build.location.eventbenchconsole}" source="${source}"
169                        target="${target}" includeantruntime="false">
170                        <src path="${EventBenchConsole.location}/src" />
171                        <classpath refid="EventBenchConsole.classpath" />
172                </javac>
173        </target>
174        <target depends="init.eventbenchcore" name="build.eventbenchcore">
175                <javac debug="true" debuglevel="${debuglevel}"
176                        destdir="${build.location.eventbenchcore}" source="${source}" target="${target}"
177                        includeantruntime="false">
178                        <src path="${EventBenchCore.location}/src" />
179                        <classpath refid="EventBenchCore.classpath" />
180                </javac>
181        </target>
182        <target depends="init.javahelperlib" name="build.javahelperlib">
183                <javac debug="true" debuglevel="${debuglevel}" destdir="${build.location.javahelperlib}"
184                        source="${source}" target="${target}" includeantruntime="false">
185                        <src path="${JavaHelperLib.location}/src" />
186                        <classpath refid="JavaHelperLib.classpath" />
187                </javac>
188        </target>
189        <target depends="init.jfcmonitor" name="build.jfcmonitor">
190                <javac debug="true" debuglevel="${debuglevel}" destdir="${build.location.jfcmonitor}"
191                        source="${source}" target="${target}" includeantruntime="false">
192                        <src path="${JFCMonitor.location}/src" />
193                        <classpath refid="JFCMonitor.classpath" />
194                </javac>
195        </target>
196
197        <!-- Distribution Targets -->
198        <target depends="build,init.dist,javadoc" name="dist">
199                <!-- dist of main components, i.e., the console -->
200                <pathconvert property="dist.libs" pathsep=" ">
201                        <mapper>
202                                <chainedmapper>
203                                        <flattenmapper />
204                                        <globmapper from="*" to="lib/*" />
205                                </chainedmapper>
206                        </mapper>
207                        <path>
208                                <fileset dir="lib">
209                                        <include name="**/*.jar" />
210                                </fileset>
211                        </path>
212                </pathconvert>
213                <property name="dist.classpath"
214                        value="${dist.libs} ${JavaHelperLib.jarname} ${EventBenchCore.jarname}"></property>
215                <jar destfile="${dist.location.main}/${EventBenchConsole.jarname}"
216                        basedir="${build.location.eventbenchconsole}">
217                        <manifest>
218                                <attribute name="Built-By" value="${user.name}" />
219                                <attribute name="Main-Class" value="de.ugoe.cs.eventbench.Runner" />
220                                <attribute name="Class-Path" value="${dist.classpath}" />
221                        </manifest>
222                </jar>
223                <jar destfile="${dist.location.main}/${EventBenchCore.jarname}"
224                        basedir="${build.location.eventbenchcore}">
225                        <manifest>
226                                <attribute name="Built-By" value="${user.name}" />
227                        </manifest>
228                </jar>
229                <jar destfile="${dist.location.main}/${JavaHelperLib.jarname}"
230                        basedir="${build.location.javahelperlib}">
231                        <manifest>
232                                <attribute name="Built-By" value="${user.name}" />
233                                <attribute name="Class-Path" value="${dist.classpath}" />
234                        </manifest>
235                </jar>
236                <copy includeemptydirs="false" todir="${dist.location.main}/lib">
237                        <fileset dir="lib" />
238                </copy>
239                <copy todir="${dist.location.main}/misc">
240                        <fileset dir="${EventBenchConsole.location}/misc" />
241                </copy>
242                <copy todir="${dist.location.main}/rules">
243                        <fileset dir="${EventBenchConsole.location}/rules" />
244                </copy>
245
246                <!-- dist of JFCMonitor -->
247                <jar destfile="${dist.location.jfcmonitor}/${JFCMonitor.jarname}"
248                        basedir="${build.location.jfcmonitor}">
249                        <manifest>
250                                <attribute name="Built-By" value="${user.name}" />
251                                <attribute name="Main-Class" value="de.ugoe.cs.eventbench.jfcmonitor.Runner" />
252                                <attribute name="Class-Path" value="${JavaHelperLib.jarname}" />
253                        </manifest>
254                </jar>
255
256                <!-- copy Javadoc to dist -->
257                <copy includeemptydirs="false" todir="${dist.location.javadoc}">
258                        <fileset dir="${javadoc.location}" />
259                </copy>
260        </target>
261
262        <!-- Javadoc Targets -->
263        <target name="javadoc" description="o Create Javadocs (Requires Javadoc 1.4+)">
264                <mkdir dir="${javadoc.location}/javahelperlib" />
265                <mkdir dir="${javadoc.location}/eventbenchcore" />
266                <mkdir dir="${javadoc.location}/eventbenchconsole" />
267                <mkdir dir="${javadoc.location}/jfcmonitor" />
268                <javadoc destdir="${javadoc.location}/javahelperlib"
269                        additionalparam="-J-Dorg.apache.commons.attributes.javadoc.CATaglet.sources=${basedir}">
270                        <classpath refid="JavaHelperLib.classpath" />
271                        <link href="http://download.oracle.com/javase/6/docs/api/" />
272                        <fileset dir="${JavaHelperLib.location}/src" includes="**/*.java" />
273                </javadoc>
274                <javadoc destdir="${javadoc.location}/eventbenchcore"
275                        additionalparam="-J-Dorg.apache.commons.attributes.javadoc.CATaglet.sources=${basedir}">
276                        <classpath refid="EventBenchCore.classpath" />
277                        <link resolveLink="true" href="${javadoc.location}/javahelperlib/" />
278                        <link href="http://download.oracle.com/javase/6/docs/api/" />
279                        <fileset dir="${EventBenchCore.location}/src" includes="**/*.java" />
280                </javadoc>
281                <javadoc destdir="${javadoc.location}/eventbenchconsole"
282                        additionalparam="-J-Dorg.apache.commons.attributes.javadoc.CATaglet.sources=${basedir}">
283                        <classpath refid="EventBenchConsole.classpath" />
284                        <link resolveLink="true" href="${javadoc.location}/javahelperlib/" />
285                        <link resolveLink="true" href="${javadoc.location}/eventbenchcore/" />
286                        <link href="http://download.oracle.com/javase/6/docs/api/" />
287                        <fileset dir="${EventBenchConsole.location}/src" includes="**/*.java" />
288                </javadoc>
289                <javadoc destdir="${javadoc.location}/jfcmonitor"
290                        additionalparam="-J-Dorg.apache.commons.attributes.javadoc.CATaglet.sources=${basedir}">
291                        <classpath refid="JFCMonitor.classpath" />
292                        <link href="http://download.oracle.com/javase/6/docs/api/" />
293                        <fileset dir="${JFCMonitor.location}/src" includes="**/*.java" />
294                </javadoc>
295        </target>
296
297        <!-- JUnit Targets -->
298        <target depends="init.build" name="init.junit">
299                <mkdir dir="${test.location.results}" />
300        </target>
301        <target depends="init.junit" name="init.eventbenchcore-test">
302                <mkdir dir="${test.location.eventbenchcore}" />
303        </target>
304        <target depends="init.junit" name="init.javahelperlib-test">
305                <mkdir dir="${test.location.javahelperlib}" />
306        </target>
307
308        <target depends="init.eventbenchcore-test" name="build.eventbenchcore-test">
309                <javac debug="true" debuglevel="${debuglevel}" destdir="${test.location.eventbenchcore}"
310                        source="${source}" target="${target}" includeantruntime="false">
311                        <src path="${EventBenchCoreTest.location}/src" />
312                        <classpath refid="EventBenchCoreTest.classpath" />
313                </javac>
314        </target>
315        <target depends="init.javahelperlib-test" name="build.javahelperlib-test">
316                <javac debug="true" debuglevel="${debuglevel}" destdir="${test.location.javahelperlib}"
317                        source="${source}" target="${target}" includeantruntime="false">
318                        <src path="${JavaHelperLibTest.location}/src" />
319                        <classpath refid="JavaHelperLibTest.classpath" />
320                </javac>
321        </target>
322
323        <target depends="build.eventbenchcore,build.eventbenchcore-test"
324                name="junit.eventbenchcore">
325                <junit fork="on" printsummary="yes" haltonfailure="no">
326                        <classpath refid="EventBenchCoreTest.classpath" />
327                        <test name="${test.eventbenchcore.main-class}" haltonfailure="no"
328                                outfile="${test.eventbenchcore.results}">
329                                <formatter type="xml" />
330                        </test>
331                </junit>
332        </target>
333        <target depends="build.javahelperlib,build.javahelperlib-test"
334                name="junit.javahelperlib">
335                <junit fork="on" printsummary="yes" haltonfailure="no">
336                        <classpath refid="JavaHelperLibTest.classpath" />
337                        <test name="${test.javahelperlib.main-class}" haltonfailure="no"
338                                outfile="${test.javahelperlib.results}">
339                                <formatter type="xml" />
340                        </test>
341                </junit>
342        </target>
343       
344        <target depends="junit.eventbenchcore,junit.javahelperlib" name="junit" />
345       
346        <target depends="dist,junit" name="distAndTest" />
347</project>
Note: See TracBrowser for help on using the repository browser.