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

Properties

Name Value
svn:mime-type text/plain

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