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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 914 - (hide annotations) (download)
Tue Oct 13 15:49:15 2009 UTC (12 years, 3 months ago) by wvengen
File MIME type: text/plain
File size: 16329 byte(s)
jgridstart release 1.0beta4
1 wvengen 178 <?xml version="1.0" encoding="utf-8"?>
2     <project name="jgridstart" default="compile">
3 wvengen 821 <description>jGridstart build file</description>
4 wvengen 178
5     <!--
6     - Property definitions
7     -->
8 wvengen 183 <!-- display name -->
9 wvengen 821 <property name="target.title" value="jGridstart"/>
10 wvengen 183 <!-- internal name -->
11 wvengen 178 <property name="target.name" value="${ant.project.name}"/>
12 wvengen 183 <!-- the program's version -->
13 wvengen 914 <property name="target.version" value="1.0beta4"/>
14 wvengen 183 <!-- main class to execute -->
15 wvengen 178 <property name="target.main" value="nl.nikhef.jgridstart.gui.Main"/>
16 wvengen 183 <!-- java virtual machine version to compile for -->
17 wvengen 178 <property name="target.jvmversion" value="1.5"/>
18    
19 wvengen 183 <!-- Java Web Start base url (for use in JNLP files) -->
20 wvengen 561 <property name="wwwbase" value="http://www.nikhef.nl/~wvengen/jgridstart-devel/"/>
21 wvengen 178
22 wvengen 183 <!-- 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 wvengen 487 <!-- location of javadoc output -->
31     <property name="dir.javadoc" location="doc"/>
32 wvengen 514 <!-- location of junit test output -->
33     <property name="dir.testreports" location="testreports"/>
34 wvengen 860 <!-- location of screenshot output -->
35     <property name="dir.screenshots" location="screenshots"/>
36     <property name="screenshots.main" value="nl.nikhef.jgridstart.gui.util.GUIScreenshotsTest"/>
37 wvengen 183
38 wvengen 464 <!-- extra tool definitions -->
39     <property name="browsertool.target.name" value="browsertool"/>
40     <property name="browsertool.target.main" value="nl.nikhef.jgridstart.install.BrowserTool"/>
41 wvengen 707
42     <property name="tests.target.name" value="tests"/>
43     <property name="tests.target.main" value="nl.nikhef.jgridstart.AllTests"/>
44 wvengen 464
45 wvengen 183 <!-- 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 wvengen 178 <property name="dir.keystore" location=".."/>
59     <property file="${dir.keystore}/keystore.properties"/>
60 wvengen 621
61 wvengen 250 <!--
62     - dependencies
63     -->
64    
65 wvengen 400 <property name="dep.bouncycastle" location="${dir.thirdparty}/bouncycastle/bcprov-jdk14-143.jar"/>
66 wvengen 707 <basename property="dep.bouncycastle.basename" file="${dep.bouncycastle}"/>
67 wvengen 400 <property name="dep.bouncycastle.smime" location="${dir.thirdparty}/bouncycastle/bcmail-jdk14-143.jar"/>
68 wvengen 665 <property name="dep.bouncycastle.tsp" location="${dir.thirdparty}/bouncycastle/bctsp-jdk14-143.jar"/>
69 wvengen 553 <property name="dep.javamail" location="${dir.thirdparty}/bouncycastle/mail-1.4.1.jar"/>
70 wvengen 595 <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 wvengen 180 <property name="dep.junit" location="${dir.thirdparty}/junit/junit-4.5.jar"/>
73 wvengen 364 <property name="dep.abbot" location="${dir.thirdparty}/junit/abbot.jar"/>
74 wvengen 250 <property name="dep.swingworker" location="${dir.thirdparty}/swingworker/swing-worker-1.2.jar"/>
75 wvengen 196 <property name="dep.xhtmlrenderer" location="${dir.thirdparty}/flyingsaucer/core-renderer-minimal.jar"/>
76 wvengen 253 <property name="dep.itext" location="${dir.thirdparty}/flyingsaucer/iText-2.0.8.jar"/>
77 wvengen 444 <property name="dep.winregistry" location="${dir.thirdparty}/winregistry/WinRegistry-3.4.jar"/>
78 wvengen 487 <property name="dep.apiviz" location="${dir.thirdparty}/javadoc/apiviz-1.3.0.GA.jar"/>
79 wvengen 555 <!-- 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 wvengen 557 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 wvengen 178 <path id="path.dependencies">
85     <!-- TODO use jdk13 library versions and test -->
86     <pathelement location="${dep.bouncycastle}"/>
87 wvengen 553 <pathelement location="${dep.bouncycastle.smime}"/>
88     <pathelement location="${dep.javamail}"/>
89 wvengen 595 <pathelement location="${dep.commons-lang}"/>
90     <pathelement location="${dep.commons-cli}"/>
91 wvengen 180 <pathelement location="${dep.junit}"/>
92 wvengen 364 <pathelement location="${dep.abbot}"/>
93 wvengen 250 <pathelement location="${dep.swingworker}"/> <!-- for java1.5 and below -->
94 wvengen 196 <pathelement location="${dep.xhtmlrenderer}"/>
95 wvengen 553 <pathelement location="${dep.itext}"/>
96 wvengen 444 <pathelement location="${dep.winregistry}"/>
97 wvengen 178 </path>
98 wvengen 595
99 wvengen 597 <patternset id="distfiles">
100 wvengen 595 <!-- 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 wvengen 597 </patternset>
112 wvengen 707
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     <!-- iText needs some org.bouncycastle.cms classes but some other classes in this
131     package reference javax.mail which we don't want to include as well (so that
132     ProGuard can resolve them). Solution: only include part of the smime package.
133 wvengen 772 In addition to this, certificate renewal also requires S/MIME mail stuff. -->
134 wvengen 707 <zipfileset src="${dep.bouncycastle.smime}">
135     <include name="org/bouncycastle/cms/**"/>
136     <include name="org/bouncycastle/mail/smime/*.class/"/>
137     <include name="org/bouncycastle/mail/smime/util/*.class/"/>
138     </zipfileset>
139     <zipfileset src="${dep.bouncycastle.tsp}" includes="**/*.class"/>
140     <zipfileset src="${dep.javamail}" includes="**/*.class"/>
141 wvengen 772 <zipfileset src="${dep.activation}" includes="**/*.class"/>
142 wvengen 707 </resources>
143    
144 wvengen 178
145     <!--
146     - Initialisation and other setup
147     -->
148 wvengen 183
149     <!-- keystore; create one if not supplied -->
150     <available file="${keystore.file}" type="file" property="keystore.available"/>
151     <target name="keystore" unless="keystore.available">
152     <tempfile property="keystore.file" prefix="keystore" suffix=".ks"/>
153     <property name="keystore.tempfile" value="${keystore.file}"/>
154     <property name="keystore.alias" value="default"/>
155     <property name="keystore.passwd" value="xyz12345"/>
156     <genkey alias="${keystore.alias}" storepass="${keystore.passwd}" keystore="${keystore.file}"
157     validity="1" dname="CN=Test, OU=Test, O=Test, C=Test"/>
158     </target>
159    
160     <!-- proguard -->
161 wvengen 178 <taskdef resource="proguard/ant/task.properties"
162     classpath="${dir.thirdparty}/proguard/proguard.jar"/>
163 wvengen 621 <!-- subversion -->
164 wvengen 728 <typedef resource="org/tigris/subversion/svnant/svnantlib.xml">
165 wvengen 621 <classpath><fileset dir="${dir.thirdparty}/svnant">
166 wvengen 728 <include name="*.jar"/>
167 wvengen 621 </fileset></classpath>
168     </typedef>
169 wvengen 728 <svn failonerror="false"><wcVersion path="." prefix="svn."/></svn>
170     <property name="target.revision" value="${svn.revision.range}"/>
171 wvengen 183 <!-- timestamp -->
172 wvengen 178 <target name="init">
173     <tstamp/>
174     </target>
175    
176     <!--
177     - Compilation target
178     -->
179     <target name="compile" depends="init">
180     <mkdir dir="${dir.build}"/>
181     <!-- compile java sources -->
182     <javac srcdir="${dir.src}" destdir="${dir.build}" target="${target.jvmversion}">
183     <classpath refid="path.dependencies" />
184     </javac>
185 wvengen 621 <!-- copy resources; skip VCS dirs (and other hidden .*) -->
186 wvengen 178 <copy todir="${dir.build}">
187     <fileset dir="${dir.src}">
188     <exclude name="**/*.java"/>
189     <exclude name="**/CVS"/>
190     <exclude name="**/.*"/>
191 wvengen 621 <exclude name="resources/conf/global.properties"/>
192 wvengen 178 </fileset>
193     </copy>
194 wvengen 621 <!-- set global variables from build -->
195     <copy file="${dir.src}/resources/conf/global.properties"
196     tofile="${dir.build}/resources/conf/global.properties">
197     <filterchain>
198     <replacetokens>
199     <token key="jgridstart.version" value="${target.version}"/>
200     <token key="jgridstart.revision" value="${target.revision}"/>
201     </replacetokens>
202     </filterchain>
203     </copy>
204 wvengen 178 </target>
205 wvengen 557
206 wvengen 178 <!--
207 wvengen 557 - Full JAR creation target
208 wvengen 178 -->
209 wvengen 557 <target name="jar.large" depends="compile">
210 wvengen 178 <jar jarfile="${dir.dist}/${target.name}.large.jar">
211     <manifest>
212     <attribute name="Built-By" value="${user.name}"/>
213     <attribute name="Main-Class" value="${target.main}"/>
214 wvengen 390 <attribute name="Class-Path" value="${dep.bouncycastle.basename}"/>
215 wvengen 178 </manifest>
216 wvengen 597 <fileset dir="${dir.build}">
217     <patternset refid="distfiles"/>
218     </fileset>
219 wvengen 707 <resources refid="depfiles"/>
220 wvengen 178 </jar>
221 wvengen 557 </target>
222 wvengen 562
223 wvengen 557 <!--
224 wvengen 562 - ProGuard-minimised JAR creation
225 wvengen 557 -->
226 wvengen 562 <target name="jar.small" depends="jar.large">
227 wvengen 178 <!-- minimize jar file; skipnonpubliclibraryclasses needed for java1.6 -->
228     <proguard obfuscate="false" skipnonpubliclibraryclasses="false">
229     <injar file="${dir.dist}/${target.name}.large.jar"/>
230 wvengen 612 <outjar file="${dir.dist}/${target.name}.small.jar"/>
231 wvengen 178 <libraryjar file="${java.home}/lib/rt.jar"/>
232 wvengen 399 <libraryjar file="${java.home}/lib/jce.jar"/>
233 wvengen 196 <libraryjar file="${java.home}/lib/jsse.jar"/>
234 wvengen 178 <libraryjar file="${dep.bouncycastle}"/>
235 wvengen 250 <libraryjar file="${dep.junit}"/>
236 wvengen 364 <libraryjar file="${dep.abbot}"/>
237 wvengen 250 <keepclasseswithmembers access="public">
238 wvengen 178 <method access="public static" type="void"
239     name="main" parameters="java.lang.String[]"/>
240     </keepclasseswithmembers>
241 wvengen 612 <!-- Somehow xhtmlrenderer classes are stripped too much, this is a workaround. Error e.g.
242     "Invalid index 2 in LocalVariableTable in class file org/xhtmlrenderer/render/Box" -->
243     <keepclasseswithmembers name="org.xhtmlrenderer.render.Box">
244     <method name="*"/>
245     </keepclasseswithmembers>
246     <keepclasseswithmembers name="org.xhtmlrenderer.swing.NaiveUserAgent">
247     <method name="*"/>
248     </keepclasseswithmembers>
249     <keepclasseswithmembers name="org.xhtmlrenderer.css.**">
250     <method name="*"/>
251     </keepclasseswithmembers>
252     <keepclasseswithmembers name="org.xhtmlrenderer.newtable.**">
253     <method name="*"/>
254     </keepclasseswithmembers>
255 wvengen 665 <keepclasseswithmembers name="org.xhtmlrenderer.resource.XMLResource**">
256     <method name="*"/>
257     </keepclasseswithmembers>
258 wvengen 298 <!-- logging is dynamically configured -->
259     <keepclasseswithmembers access="public" name="org.xhtmlrenderer.util.XRSimpleLogFormatter">
260     <method name="*"/>
261     </keepclasseswithmembers>
262     <keepclasseswithmembers access="public" name="org.xhtmlrenderer.util.Configuration">
263     <method name="*"/>
264     </keepclasseswithmembers>
265 wvengen 735 <!-- CA class used is set in configfile -->
266     <keepclasseswithmembers name="nl.nikhef.jgridstart.ca.**">
267     <method name="*"/>
268     </keepclasseswithmembers>
269 wvengen 562 </proguard>
270     </target>
271    
272     <!--
273     - Distribution creation target
274     -->
275 wvengen 612 <target name="dist" depends="keystore,jar.small">
276 wvengen 562 <!-- copy large/small jar to distribution -->
277 wvengen 612 <copy file="${dir.dist}/${target.name}.small.jar" tofile="${dir.dist}/${target.name}.jar"/>
278 wvengen 178 <!-- sign it, required for java web start -->
279     <signjar keystore="${keystore.file}" jar="${dir.dist}/${target.name}.jar"
280 wvengen 183 alias="${keystore.alias}" storepass="${keystore.passwd}"/>
281     <delete file="${keystore.tempfile}" quiet="true"/>
282 wvengen 178 <!-- substitute variables in java web start files -->
283     <copy file="${dir.dist}/${target.name}.jnlp.in" tofile="${dir.dist}/${target.name}.jnlp" />
284     <copy file="${dir.dist}/bcprov.jnlp.in" tofile="${dir.dist}/bcprov.jnlp" />
285     <replace dir="${dir.dist}">
286     <include name="${target.name}.jnlp"/>
287     <include name="bcprov.jnlp"/>
288     <replacefilter token="@wwwbase@" value="${wwwbase}"/>
289     <replacefilter token="@main@" value="${target.main}"/>
290     </replace>
291 wvengen 182 <!-- copy bouncycastle jar to deployment area -->
292     <copy file="${dep.bouncycastle}" todir="${dir.dist}"/>
293 wvengen 178 </target>
294    
295     <!--
296     - Cleaning target
297     -->
298     <target name="clean">
299     <delete dir="${dir.build}"/>
300     <delete file="${dir.dist}/${target.name}.jar"/>
301     <delete file="${dir.dist}/${target.name}.jnlp"/>
302     <delete file="${dir.dist}/bcprov.jnlp"/>
303 wvengen 182 <delete file="${dir.dist}/${dep.bouncycastle.basename}"/>
304 wvengen 707 <delete file="${dir.dist}/${browsertool.target.name}.jar"/>
305     <delete file="${dir.dist}/${tests.target.name}.jar"/>
306 wvengen 178 </target>
307    
308 wvengen 464 <!--
309     - extra targets
310     -->
311 wvengen 707 <!-- browsertool -->
312 wvengen 464 <target name="browsertool" depends="compile">
313     <jar jarfile="${dir.dist}/${browsertool.target.name}.jar">
314     <manifest>
315     <attribute name="Built-By" value="${user.name}"/>
316     <attribute name="Main-Class" value="${browsertool.target.main}"/>
317     </manifest>
318 wvengen 597 <fileset dir="${dir.build}">
319     <patternset refid="distfiles"/>
320 wvengen 464 <include name="nl/nikhef/jgridstart/install/**"/>
321     <include name="nl/nikhef/jgridstart/util/**"/>
322     </fileset>
323 wvengen 599 <zipfileset src="${dep.commons-cli}" includes="**/*.class"/>
324 wvengen 464 <zipfileset src="${dep.winregistry}" includes="**/*.class"/>
325     </jar>
326     <!-- sign it, required for java web start -->
327     <signjar keystore="${keystore.file}" jar="${dir.dist}/${browsertool.name}.jar"
328     alias="${keystore.alias}" storepass="${keystore.passwd}"/>
329     </target>
330 wvengen 707
331     <!-- archive with unit tests -->
332     <target name="jar.tests" depends="compile">
333     <jar jarfile="${dir.dist}/${tests.target.name}.jar">
334     <manifest>
335     <attribute name="Built-By" value="${user.name}"/>
336     <attribute name="Main-Class" value="${tests.target.main}"/>
337     <attribute name="Class-Path" value="${dep.bouncycastle.basename}"/>
338     </manifest>
339     <fileset dir="${dir.build}"/>
340     <resources refid="depfiles"/>
341     <zipfileset src="${dep.junit}" includes="**/*.class"/>
342     <zipfileset src="${dep.abbot}" includes="**/*.class"/>
343     </jar>
344     </target>
345 wvengen 464
346 wvengen 487 <!-- javadoc with APIviz, needs graphviz >= 2.20 -->
347     <target name="javadoc" depends="compile">
348     <javadoc
349     destdir="${dir.javadoc}"
350     classpathref="path.dependencies"
351     access="protected" source="${target.jvmversion}"
352     doclet="org.jboss.apiviz.APIviz" docletpath="${dep.apiviz}" additionalparam="-sourceclasspath ${dir.build}">
353     <sourcefiles>
354     <fileset dir="${dir.src}">
355     <include name="**/*.java"/>
356 wvengen 492 <exclude name="**/*Test.*"/>
357     <exclude name="**/AllTests.*"/>
358 wvengen 487 </fileset>
359     </sourcefiles>
360     <link href="http://java.sun.com/j2se/1.5.0/docs/api/"/>
361     <link href="http://bouncycastle.org/docs/docs1.4/"/>
362     <link href="http://bouncycastle.org/docs/mdocs1.4/"/>
363 wvengen 595 <link href="http://commons.apache.org/lang/api-release/"/>
364 wvengen 487 <link href="http://commons.apache.org/cli/api-1.2/"/>
365     <link href="http://junit.org/junit/javadoc/4.5/"/>
366     <link href="http://abbot.sourceforge.net/doc/api/"/>
367     <link href="https://swingworker.dev.java.net/nonav/javadoc/"/>
368     <link href="http://pigeonholdings.com/projects/flyingsaucer/R8/javadoc/user/"/>
369     <link href="http://www.1t3xt.info/api/"/>
370 wvengen 553 <link href="http://java.sun.com/products/javamail/javadocs/"/>
371 wvengen 514 <!-- no online javadoc found for WinRegistry -->
372 wvengen 487 </javadoc>
373     </target>
374 wvengen 514
375     <!-- test report -->
376     <target name="testreport" depends="compile">
377     <junit fork="yes" haltonfailure="no">
378     <test fork="yes" todir="${dir.testreports}" name="nl.nikhef.jgridstart.AllTests"/>
379     <formatter type="xml"/>
380     <classpath refid="path.dependencies"/>
381     <classpath path="${dir.build}"/>
382     </junit>
383     </target>
384 wvengen 860
385     <!-- generate screenshots for documentation -->
386     <target name="screenshots" depends="compile">
387     <java classname="${screenshots.main}" fork="yes">
388     <arg value="${dir.screenshots}"/>
389     <classpath refid="path.dependencies"/>
390     <classpath path="${dir.build}"/>
391     </java>
392     </target>
393    
394 wvengen 253 </project>

Properties

Name Value
svn:mime-type text/plain

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