/[pdpsoft]/branches/nl.nikhef.jgridstart-flyingsaucer/nl.nikhef.jgridstart/build.xml
ViewVC logotype

Contents of /branches/nl.nikhef.jgridstart-flyingsaucer/nl.nikhef.jgridstart/build.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1193 - (show annotations) (download)
Fri Nov 27 16:27:58 2009 UTC (12 years ago) by wvengen
File MIME type: text/plain
File size: 19856 byte(s)
release jgridstart 1.0!
1 <?xml version="1.0" encoding="utf-8"?>
2 <project name="jgridstart" default="compile">
3 <description>jGridstart build file</description>
4
5 <!--
6 - Property definitions
7 -->
8 <!-- display name -->
9 <property name="target.title" value="jGridstart"/>
10 <!-- internal name -->
11 <property name="target.name" value="${ant.project.name}"/>
12 <!-- the program's version -->
13 <property name="target.version" value="1.0"/>
14 <!-- main class to execute -->
15 <property name="target.main" value="nl.nikhef.jgridstart.gui.Main"/>
16 <!-- java virtual machine version to compile for -->
17 <property name="target.jvmversion" value="1.5"/>
18
19 <!-- Java Web Start base url (for use in JNLP files) -->
20 <property name="wwwbase" value="http://www.nikhef.nl/~wvengen/jgridstart-devel/"/>
21
22 <!-- location of source files -->
23 <property name="dir.src" location="src"/>
24 <!-- location of compiled classes -->
25 <property name="dir.build" location="bin"/>
26 <!-- location of output files for deployment -->
27 <property name="dir.dist" location="deployment"/>
28 <!-- location of thirdparty libraries -->
29 <property name="dir.thirdparty" location="thirdparty"/>
30 <!-- location of javadoc output -->
31 <property name="dir.javadoc" location="doc"/>
32 <!-- location of junit test output -->
33 <property name="dir.testreports" location="testreports"/>
34 <!-- location of screenshot output -->
35 <property name="dir.screenshots" location="screenshots"/>
36 <property name="screenshots.main" value="nl.nikhef.jgridstart.gui.util.GUIScreenshotsTest"/>
37
38 <!-- extra tool definitions -->
39 <property name="browsertool.target.name" value="browsertool"/>
40 <property name="browsertool.target.main" value="nl.nikhef.jgridstart.install.BrowserTool"/>
41
42 <property name="tests.target.name" value="tests"/>
43 <property name="tests.target.main" value="nl.nikhef.jgridstart.AllTests"/>
44 <property name="tests.guitarget.name" value="testgui"/>
45 <property name="tests.guitarget.main" value="nl.nikhef.jgridstart.logging.UserTestRunner"/>
46
47 <!-- reference to property file defining the properties
48 - keystore.file java keystore file
49 - keystore.passwd password for accessing the java keystore
50 - keystore.alias alias pointing to certificate to sign with
51 - if the property file cannot be found or does not define a keystore.file
52 - that points to a file, a self-signed certificate is generated so you can
53 - get started easily. For production, of course, you'll need your own
54 - secure certificate that users can trust.
55 - An example keystore.properties could be as follows:
56 - keystore.file = ${dir.keystore}/keystore.ks
57 - keystore.alias = default
58 - keystore.passwd = mysecret
59 -->
60 <property name="dir.keystore" location=".."/>
61 <property file="${dir.keystore}/keystore.properties"/>
62
63 <!--
64 - dependencies
65 -->
66
67 <property name="dep.bouncycastle" location="${dir.thirdparty}/bouncycastle/bcprov-jdk14-143.jar"/>
68 <basename property="dep.bouncycastle.basename" file="${dep.bouncycastle}"/>
69 <property name="dep.bouncycastle.smime" location="${dir.thirdparty}/bouncycastle/bcmail-jdk14-143.jar"/>
70 <property name="dep.bouncycastle.tsp" location="${dir.thirdparty}/bouncycastle/bctsp-jdk14-143.jar"/>
71 <property name="dep.javamail" location="${dir.thirdparty}/bouncycastle/mail-1.4.1.jar"/>
72 <property name="dep.commons-cli" location="${dir.thirdparty}/commons/commons-cli-1.2.jar"/>
73 <property name="dep.commons-lang" location="${dir.thirdparty}/commons/commons-lang-2.4.jar"/>
74 <property name="dep.commons-exec" location="${dir.thirdparty}/commons/commons-exec-1.0.jar"/>
75 <property name="dep.junit" location="${dir.thirdparty}/junit/junit-4.7.jar"/>
76 <property name="dep.abbot" location="${dir.thirdparty}/junit/abbot.jar"/>
77 <property name="dep.swingworker" location="${dir.thirdparty}/swingworker/swing-worker-1.2.jar"/>
78 <property name="dep.xhtmlrenderer" location="${dir.thirdparty}/flyingsaucer/core-renderer-minimal.jar"/>
79 <property name="dep.itext" location="${dir.thirdparty}/flyingsaucer/iText-2.0.8.jar"/>
80 <property name="dep.winregistry" location="${dir.thirdparty}/winregistry/WinRegistry-3.4.jar"/>
81 <property name="dep.apiviz" location="${dir.thirdparty}/javadoc/apiviz-1.3.0.GA.jar"/>
82 <!-- activation framework is present in Java 1.6 and we don't use
83 it apart for resolving; so we can omit it when compiling there
84 to avoid ProGuard Warnings (which are fatal); so we need it for
85 lower versions. This is a little trick with ProGuard's jarfilter -->
86 <property name="dep.activation" location="${dir.thirdparty}/bouncycastle/activation.jar"/>
87 <path id="path.dependencies">
88 <!-- TODO use jdk13 library versions and test -->
89 <pathelement location="${dep.bouncycastle}"/>
90 <pathelement location="${dep.bouncycastle.smime}"/>
91 <pathelement location="${dep.javamail}"/>
92 <pathelement location="${dep.commons-lang}"/>
93 <pathelement location="${dep.commons-cli}"/>
94 <pathelement location="${dep.commons-exec}"/>
95 <pathelement location="${dep.junit}"/>
96 <pathelement location="${dep.abbot}"/>
97 <pathelement location="${dep.swingworker}"/> <!-- for java1.5 and below -->
98 <pathelement location="${dep.xhtmlrenderer}"/>
99 <pathelement location="${dep.itext}"/>
100 <pathelement location="${dep.winregistry}"/>
101 </path>
102
103 <patternset id="distfiles">
104 <!-- exclude non-production files -->
105 <exclude name="**/test*"/>
106 <exclude name="**/*test/**"/>
107 <exclude name="**/*tests/**"/>
108 <exclude name="**/package.html"/>
109 <exclude name="**/*Test.class"/>
110 <exclude name="**/*Test$*.class"/>
111 <exclude name="**/AllTests.class"/>
112 <exclude name="**/AllTests$*.class"/>
113 <exclude name="**/CVS"/>
114 <exclude name="**/.svn"/>
115 </patternset>
116
117 <!-- files to include as dependencies in jars -->
118 <resources id="depfiles">
119 <zipfileset src="${dep.commons-lang}" includes="**/*.class"/>
120 <zipfileset src="${dep.commons-cli}" includes="**/*.class"/>
121 <zipfileset src="${dep.commons-exec}" includes="**/*.class"/>
122 <zipfileset src="${dep.swingworker}" includes="**/*.class"/>
123 <zipfileset src="${dep.xhtmlrenderer}">
124 <include name="**/*.class"/>
125 <exclude name="**/tool/**"/>
126 <exclude name="**/swt/**"/>
127 <exclude name="**/SWT**"/>
128 </zipfileset>
129 <zipfileset src="${dep.itext}">
130 <include name="**/*.class"/>
131 <include name="**/fonts/*"/>
132 <exclude name="**/tools/**"/>
133 </zipfileset>
134 <zipfileset src="${dep.winregistry}" includes="**/*.class"/>
135 <zipfileset src="${dep.bouncycastle.smime}" includes="**/*.class"/>
136 <zipfileset src="${dep.bouncycastle.tsp}" includes="**/*.class"/>
137 <zipfileset src="${dep.javamail}">
138 <include name="com/sun/mail/handlers/**.class"/>
139 <include name="com/sun/mail/iap/**.class"/>
140 <include name="com/sun/mail/util/**.class"/>
141 <include name="javax/mail/*.class"/>
142 <include name="javax/mail/**/*.class"/>
143 </zipfileset>
144 <zipfileset src="${dep.activation}" includes="**/*.class"/>
145 </resources>
146
147
148 <!--
149 - Initialisation and other setup
150 -->
151
152 <!-- keystore; create one if not supplied -->
153 <available file="${keystore.file}" type="file" property="keystore.available"/>
154 <target name="keystore" unless="keystore.available">
155 <tempfile property="keystore.file" prefix="keystore" suffix=".ks"/>
156 <property name="keystore.tempfile" value="${keystore.file}"/>
157 <property name="keystore.alias" value="default"/>
158 <property name="keystore.passwd" value="xyz12345"/>
159 <genkey alias="${keystore.alias}" storepass="${keystore.passwd}" keystore="${keystore.file}"
160 validity="1" dname="CN=Test, OU=Test, O=Test, C=Test"/>
161 <property name="keystore.available" value="true"/>
162 </target>
163
164 <!-- proguard -->
165 <taskdef resource="proguard/ant/task.properties"
166 classpath="${dir.thirdparty}/proguard/proguard.jar"/>
167 <!-- subversion -->
168 <typedef resource="org/tigris/subversion/svnant/svnantlib.xml">
169 <classpath><fileset dir="${dir.thirdparty}/svnant">
170 <include name="*.jar"/>
171 </fileset></classpath>
172 </typedef>
173 <svn failonerror="false"><wcVersion path="." prefix="svn."/></svn>
174 <property name="target.revision" value="${svn.revision.range}"/>
175 <!-- timestamp -->
176 <target name="init">
177 <tstamp/>
178 </target>
179
180 <!--
181 - Compilation target
182 -->
183 <target name="compile" depends="init">
184 <mkdir dir="${dir.build}"/>
185 <!-- compile java sources -->
186 <javac srcdir="${dir.src}" destdir="${dir.build}" target="${target.jvmversion}" debug="on">
187 <classpath refid="path.dependencies" />
188 </javac>
189 <!-- copy resources; skip VCS dirs (and other hidden .*) -->
190 <copy todir="${dir.build}">
191 <fileset dir="${dir.src}">
192 <exclude name="**/*.java"/>
193 <exclude name="**/CVS"/>
194 <exclude name="**/.*"/>
195 <exclude name="resources/conf/global.properties"/>
196 </fileset>
197 </copy>
198 <!-- set global variables from build -->
199 <copy file="${dir.src}/resources/conf/global.properties"
200 tofile="${dir.build}/resources/conf/global.properties">
201 <filterchain>
202 <replacetokens>
203 <token key="jgridstart.version" value="${target.version}"/>
204 <token key="jgridstart.revision" value="${target.revision}"/>
205 </replacetokens>
206 </filterchain>
207 </copy>
208 </target>
209
210 <!--
211 - Full JAR creation target
212 -->
213 <target name="jar.large" depends="compile">
214 <jar jarfile="${dir.dist}/${target.name}.large.jar">
215 <manifest>
216 <attribute name="Built-By" value="${user.name}"/>
217 <attribute name="Main-Class" value="${target.main}"/>
218 <attribute name="Class-Path" value="${dep.bouncycastle.basename}"/>
219 </manifest>
220 <fileset dir="${dir.build}">
221 <patternset refid="distfiles"/>
222 </fileset>
223 <resources refid="depfiles"/>
224 </jar>
225 </target>
226
227 <!--
228 - ProGuard-minimised JAR creation
229 -->
230 <target name="jar.small" depends="jar.large">
231 <!-- minimize jar file; skipnonpubliclibraryclasses needed for java1.6 -->
232 <proguard obfuscate="false" skipnonpubliclibraryclasses="false" verbose="true">
233 <injar file="${dir.dist}/${target.name}.large.jar"/>
234 <outjar file="${dir.dist}/${target.name}.small.jar"/>
235 <libraryjar file="${java.home}/lib/rt.jar"/>
236 <libraryjar file="${java.home}/lib/jce.jar"/>
237 <libraryjar file="${java.home}/lib/jsse.jar"/>
238 <libraryjar file="${dep.bouncycastle}"/>
239 <libraryjar file="${dep.junit}"/>
240 <libraryjar file="${dep.abbot}"/>
241 <keepclasseswithmembers access="public">
242 <method access="public static" type="void"
243 name="main" parameters="java.lang.String[]"/>
244 </keepclasseswithmembers>
245 <!-- Somehow xhtmlrenderer classes are stripped too much, this is a workaround. Error e.g.
246 "Invalid index 2 in LocalVariableTable in class file org/xhtmlrenderer/render/Box" -->
247 <keepclasseswithmembers name="org.xhtmlrenderer.render.Box"> <method name="*"/></keepclasseswithmembers>
248 <keepclasseswithmembers name="org.xhtmlrenderer.swing.NaiveUserAgent"> <method name="*"/></keepclasseswithmembers>
249 <keepclasseswithmembers name="org.xhtmlrenderer.css.**"> <method name="*"/></keepclasseswithmembers>
250 <keepclasseswithmembers name="org.xhtmlrenderer.newtable.**"> <method name="*"/></keepclasseswithmembers>
251 <keepclasseswithmembers name="org.xhtmlrenderer.resource.XMLResource**"> <method name="*"/></keepclasseswithmembers>
252 <!-- xhtmlrenderer descriptor classes that proguard warns about otherwise -->
253 <keepclasseswithmembers name="org.xhtmlrenderer.render.**"> <method name="*"/></keepclasseswithmembers>
254 <keepclasseswithmembers name="org.xhtmlrenderer.layout.**"> <method name="*"/></keepclasseswithmembers>
255 <keepclasseswithmembers name="org.xhtmlrenderer.extend.OutputDevice"> <method name="*"/></keepclasseswithmembers>
256 <keepclasseswithmembers name="org.xhtmlrenderer.extend.FontContext"> <method name="*"/></keepclasseswithmembers>
257 <!-- logging is dynamically configured -->
258 <keepclasseswithmembers access="public" name="org.xhtmlrenderer.util.XRSimpleLogFormatter"> <method name="*"/></keepclasseswithmembers>
259 <keepclasseswithmembers access="public" name="org.xhtmlrenderer.util.Configuration"> <method name="*"/></keepclasseswithmembers>
260 <!-- CA class used is set in configfile -->
261 <keepclasseswithmembers name="nl.nikhef.jgridstart.ca.**"> <method name="*"/></keepclasseswithmembers>
262 <!-- S/MIME does some dynamic loading as well, and the "Invalid index 2 in LocalVariableTable"
263 error can appear again; disable some optimisations to solve the latter. -->
264 <optimizations filter="!code/simplification/variable,!method/marking/static"/>
265 <keepclasseswithmembers name="com.sun.mail.handlers.**"> <method name="*"/></keepclasseswithmembers>
266 <keepclasseswithmembers name="org.bouncycastle.mail.smime.handlers.**"> <method name="*"/></keepclasseswithmembers>
267 <!-- S/MIME descriptor classes that proguard warns about otherwise -->
268 <keepclasseswithmembers name="javax.activation.DataSource"><method name="*"/></keepclasseswithmembers>
269 <keepclasseswithmembers name="javax.mail.internet.MimePart"> <method name="*"/></keepclasseswithmembers>
270 <keepclasseswithmembers name="javax.mail.internet.MimeBodyPart"> <method name="*"/></keepclasseswithmembers>
271 <keepclasseswithmembers name="javax.activation.ActivationDataFlavor"> <method name="*"/></keepclasseswithmembers>
272 </proguard>
273 </target>
274
275 <!--
276 - Distribution creation target
277 -->
278 <target name="dist" depends="keystore,jar.small,jar.testgui">
279 <!-- copy large/small jar to distribution -->
280 <copy file="${dir.dist}/${target.name}.small.jar" tofile="${dir.dist}/${target.name}.jar"/>
281 <!-- sign, required for java web start -->
282 <signjar keystore="${keystore.file}" jar="${dir.dist}/${target.name}.jar"
283 alias="${keystore.alias}" storepass="${keystore.passwd}"/>
284 <delete file="${keystore.tempfile}" quiet="true"/>
285 <!-- substitute variables in java web start files -->
286 <copy file="${dir.dist}/${target.name}.jnlp.in" tofile="${dir.dist}/${target.name}.jnlp" />
287 <copy file="${dir.dist}/${tests.guitarget.name}.jnlp.in" tofile="${dir.dist}/${tests.guitarget.name}.jnlp" />
288 <copy file="${dir.dist}/bcprov.jnlp.in" tofile="${dir.dist}/bcprov.jnlp" />
289 <replace dir="${dir.dist}">
290 <include name="${target.name}.jnlp"/>
291 <include name="${tests.guitarget.name}.jnlp"/>
292 <include name="bcprov.jnlp"/>
293 <replacefilter token="@wwwbase@" value="${wwwbase}"/>
294 <replacefilter token="@main@" value="${target.main}"/>
295 <replacefilter token="@tests.main@" value="${tests.guitarget.main}"/>
296 <replacefilter token="@tests.name@" value="${tests.guitarget.name}"/>
297 </replace>
298 <!-- copy bouncycastle jar to deployment area -->
299 <copy file="${dep.bouncycastle}" todir="${dir.dist}"/>
300 </target>
301
302 <!--
303 - Cleaning target
304 -->
305 <target name="clean">
306 <delete dir="${dir.build}"/>
307 <delete file="${dir.dist}/${target.name}.jar"/>
308 <delete file="${dir.dist}/${target.name}.jnlp"/>
309 <delete file="${dir.dist}/bcprov.jnlp"/>
310 <delete file="${dir.dist}/${dep.bouncycastle.basename}"/>
311 <delete file="${dir.dist}/${browsertool.target.name}.jar"/>
312 <delete file="${dir.dist}/${tests.target.name}.jar"/>
313 <delete file="${dir.dist}/${tests.guitarget.name}.jnlp"/>
314 <delete file="${dir.dist}/${tests.guitarget.name}.jar"/>
315 </target>
316
317 <!--
318 - extra targets
319 -->
320 <!-- browsertool -->
321 <target name="browsertool" depends="compile">
322 <jar jarfile="${dir.dist}/${browsertool.target.name}.jar">
323 <manifest>
324 <attribute name="Built-By" value="${user.name}"/>
325 <attribute name="Main-Class" value="${browsertool.target.main}"/>
326 </manifest>
327 <fileset dir="${dir.build}">
328 <patternset refid="distfiles"/>
329 <include name="nl/nikhef/jgridstart/install/**"/>
330 <include name="nl/nikhef/jgridstart/util/**"/>
331 </fileset>
332 <zipfileset src="${dep.commons-lang}" includes="**/*.class"/>
333 <zipfileset src="${dep.commons-cli}" includes="**/*.class"/>
334 <zipfileset src="${dep.commons-exec}" includes="**/*.class"/>
335 <zipfileset src="${dep.winregistry}" includes="**/*.class"/>
336 </jar>
337 <!-- sign it, required for java web start -->
338 <signjar keystore="${keystore.file}" jar="${dir.dist}/${browsertool.name}.jar"
339 alias="${keystore.alias}" storepass="${keystore.passwd}"/>
340 </target>
341
342 <!-- archive with unit tests -->
343 <target name="jar.tests" depends="compile">
344 <jar jarfile="${dir.dist}/${tests.target.name}.jar">
345 <manifest>
346 <attribute name="Built-By" value="${user.name}"/>
347 <attribute name="Main-Class" value="${tests.target.main}"/>
348 <attribute name="Class-Path" value="${dep.bouncycastle.basename}"/>
349 </manifest>
350 <fileset dir="${dir.build}"/>
351 <resources refid="depfiles"/>
352 <zipfileset src="${dep.junit}" excludes="LICENSE.txt"/>
353 <zipfileset src="${dep.abbot}"/>
354 </jar>
355 </target>
356 <!-- user test runner -->
357 <target name="jar.testgui" depends="jar.tests,keystore">
358 <!-- create file with jar names -->
359 <echo file="${dir.build}/nl/nikhef/jgridstart/logging/testjars.txt">
360 ${tests.target.name}.jar
361 ${dep.bouncycastle.basename}
362 </echo>
363 <!-- and build jars -->
364 <jar jarfile="${dir.dist}/${tests.guitarget.name}.jar">
365 <manifest>
366 <attribute name="Built-By" value="${user.name}"/>
367 <attribute name="Main-Class" value="${tests.guitarget.main}"/>
368 </manifest>
369 <!-- the files for the runner -->
370 <fileset dir="${dir.build}">
371 <include name="nl/nikhef/jgridstart/logging/UserTestRunner*.class"/>
372 <include name="nl/nikhef/jgridstart/util/ConnectionUtils*.class"/>
373 <include name="nl/nikhef/jgridstart/util/FileUtils*.class"/>
374 <include name="nl/nikhef/jgridstart/logging/testjars.txt"/>
375 </fileset>
376 <zipfileset src="${dep.commons-lang}" includes="org/**"/>
377 <zipfileset src="${dep.commons-exec}" includes="**/*.class"/>
378 <!-- and jars with all stuff that will be unpacked later -->
379 <fileset file="${dir.dist}/${tests.target.name}.jar"/>
380 <fileset file="${dep.bouncycastle}"/>
381 </jar>
382 <signjar keystore="${keystore.file}" jar="${dir.dist}/${tests.guitarget.name}.jar"
383 alias="${keystore.alias}" storepass="${keystore.passwd}"/>
384 </target>
385
386 <!-- javadoc with APIviz, needs graphviz >= 2.20 -->
387 <target name="javadoc" depends="compile">
388 <javadoc
389 destdir="${dir.javadoc}"
390 classpathref="path.dependencies"
391 access="protected" source="${target.jvmversion}"
392 doclet="org.jboss.apiviz.APIviz" docletpath="${dep.apiviz}" additionalparam="-sourceclasspath ${dir.build}">
393 <sourcefiles>
394 <fileset dir="${dir.src}">
395 <include name="**/*.java"/>
396 <exclude name="**/*Test.*"/>
397 <exclude name="**/AllTests.*"/>
398 </fileset>
399 </sourcefiles>
400 <link href="http://java.sun.com/j2se/1.5.0/docs/api/"/>
401 <link href="http://bouncycastle.org/docs/docs1.4/"/>
402 <link href="http://bouncycastle.org/docs/mdocs1.4/"/>
403 <link href="http://commons.apache.org/lang/api-release/"/>
404 <link href="http://commons.apache.org/cli/api-1.2/"/>
405 <link href="http://commons.apache.org/exec/apidocs/"/>
406 <link href="http://junit.org/apidocs/"/>
407 <link href="http://abbot.sourceforge.net/doc/api/"/>
408 <link href="https://swingworker.dev.java.net/nonav/javadoc/"/>
409 <link href="http://pigeonholdings.com/projects/flyingsaucer/R8/javadoc/user/"/>
410 <link href="http://www.1t3xt.info/api/"/>
411 <link href="http://java.sun.com/products/javamail/javadocs/"/>
412 <!-- no online javadoc found for WinRegistry -->
413 </javadoc>
414 </target>
415
416 <!-- test report -->
417 <target name="testreport" depends="compile">
418 <junit fork="yes" haltonfailure="no">
419 <test fork="yes" todir="${dir.testreports}" name="nl.nikhef.jgridstart.AllTests"/>
420 <formatter type="xml"/>
421 <classpath refid="path.dependencies"/>
422 <classpath path="${dir.build}"/>
423 </junit>
424 </target>
425
426 <!-- generate screenshots for documentation -->
427 <target name="screenshots" depends="compile">
428 <java classname="${screenshots.main}" fork="yes">
429 <arg value="${dir.screenshots}"/>
430 <classpath refid="path.dependencies"/>
431 <classpath path="${dir.build}"/>
432 </java>
433 </target>
434
435 </project>

Properties

Name Value
svn:mime-type text/plain

grid.support@nikhef.nl
ViewVC Help
Powered by ViewVC 1.1.28