source: trunk/JavaCommons/build.xml @ 278

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