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

Properties

Name Value
svn:mime-type text/plain

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