/[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 557 - (hide annotations) (download)
Thu Jul 16 16:34:50 2009 UTC (12 years, 6 months ago) by wvengen
File MIME type: text/plain
File size: 12590 byte(s)
hopefully this will build on Java 1.5 and 1.6
1 wvengen 178 <?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 wvengen 183 <!-- display name -->
9 wvengen 178 <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 178 <property name="target.version" value="0.0.3"/>
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 298 <property name="wwwbase" value="http://www.nikhef.nl/~wvengen/jgridstart03b/"/>
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 183
35 wvengen 464 <!-- 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 wvengen 183 <!-- reference to property file defining the properties
40     - keystore.file java keystore file
41     - keystore.passwd password for accessing the java keystore
42     - keystore.alias alias pointing to certificate to sign with
43     - if the property file cannot be found or does not define a keystore.file
44     - that points to a file, a self-signed certificate is generated so you can
45     - get started easily. For production, of course, you'll need your own
46     - secure certificate that users can trust.
47     - An example keystore.properties could be as follows:
48     - keystore.file = ${dir.keystore}/keystore.ks
49     - keystore.alias = default
50     - keystore.passwd = mysecret
51     -->
52 wvengen 178 <property name="dir.keystore" location=".."/>
53     <property file="${dir.keystore}/keystore.properties"/>
54 wvengen 183
55 wvengen 250 <!--
56     - dependencies
57     -->
58    
59 wvengen 400 <property name="dep.bouncycastle" location="${dir.thirdparty}/bouncycastle/bcprov-jdk14-143.jar"/>
60     <property name="dep.bouncycastle.smime" location="${dir.thirdparty}/bouncycastle/bcmail-jdk14-143.jar"/>
61 wvengen 553 <property name="dep.javamail" location="${dir.thirdparty}/bouncycastle/mail-1.4.1.jar"/>
62 wvengen 178 <property name="dep.cli" location="${dir.thirdparty}/commons-cli/commons-cli-1.2.jar"/>
63 wvengen 180 <property name="dep.junit" location="${dir.thirdparty}/junit/junit-4.5.jar"/>
64 wvengen 364 <property name="dep.abbot" location="${dir.thirdparty}/junit/abbot.jar"/>
65 wvengen 250 <property name="dep.swingworker" location="${dir.thirdparty}/swingworker/swing-worker-1.2.jar"/>
66 wvengen 196 <property name="dep.xhtmlrenderer" location="${dir.thirdparty}/flyingsaucer/core-renderer-minimal.jar"/>
67 wvengen 253 <property name="dep.itext" location="${dir.thirdparty}/flyingsaucer/iText-2.0.8.jar"/>
68 wvengen 444 <property name="dep.winregistry" location="${dir.thirdparty}/winregistry/WinRegistry-3.4.jar"/>
69 wvengen 487 <property name="dep.apiviz" location="${dir.thirdparty}/javadoc/apiviz-1.3.0.GA.jar"/>
70 wvengen 555 <!-- activation framework is present in Java 1.6 and we don't use
71     it apart for resolving; so we can omit it when compiling there
72 wvengen 557 to avoid ProGuard Warnings (which are fatal); so we need it for
73     lower versions. This is a little trick with ProGuard's jarfilter -->
74     <property name="dep.activation" location="${dir.thirdparty}/bouncycastle/activation.jar"/>
75     <condition property="dep.activation.proguardfilter" value="(!**)">
76 wvengen 555 <not><available classname="javax.activation.DataHandler"/></not>
77     </condition>
78 wvengen 178 <path id="path.dependencies">
79     <!-- TODO use jdk13 library versions and test -->
80     <pathelement location="${dep.bouncycastle}"/>
81 wvengen 553 <pathelement location="${dep.bouncycastle.smime}"/>
82     <pathelement location="${dep.javamail}"/>
83 wvengen 178 <pathelement location="${dep.cli}"/>
84 wvengen 180 <pathelement location="${dep.junit}"/>
85 wvengen 364 <pathelement location="${dep.abbot}"/>
86 wvengen 250 <pathelement location="${dep.swingworker}"/> <!-- for java1.5 and below -->
87 wvengen 196 <pathelement location="${dep.xhtmlrenderer}"/>
88 wvengen 553 <pathelement location="${dep.itext}"/>
89 wvengen 444 <pathelement location="${dep.winregistry}"/>
90 wvengen 178 </path>
91    
92     <!--
93     - Initialisation and other setup
94     -->
95 wvengen 183
96     <!-- keystore; create one if not supplied -->
97     <available file="${keystore.file}" type="file" property="keystore.available"/>
98     <target name="keystore" unless="keystore.available">
99     <tempfile property="keystore.file" prefix="keystore" suffix=".ks"/>
100     <property name="keystore.tempfile" value="${keystore.file}"/>
101     <property name="keystore.alias" value="default"/>
102     <property name="keystore.passwd" value="xyz12345"/>
103     <genkey alias="${keystore.alias}" storepass="${keystore.passwd}" keystore="${keystore.file}"
104     validity="1" dname="CN=Test, OU=Test, O=Test, C=Test"/>
105     </target>
106    
107     <!-- proguard -->
108 wvengen 178 <taskdef resource="proguard/ant/task.properties"
109     classpath="${dir.thirdparty}/proguard/proguard.jar"/>
110    
111 wvengen 183 <!-- timestamp -->
112 wvengen 178 <target name="init">
113     <tstamp/>
114     </target>
115    
116     <!--
117     - Compilation target
118     -->
119     <target name="compile" depends="init">
120     <mkdir dir="${dir.build}"/>
121     <!-- compile java sources -->
122     <javac srcdir="${dir.src}" destdir="${dir.build}" target="${target.jvmversion}">
123     <classpath refid="path.dependencies" />
124     </javac>
125     <!-- and copy resources; skip VCS dirs (and other hidden .*) -->
126     <copy todir="${dir.build}">
127     <fileset dir="${dir.src}">
128     <exclude name="**/*.java"/>
129     <exclude name="**/CVS"/>
130     <exclude name="**/.*"/>
131     </fileset>
132     </copy>
133     </target>
134 wvengen 557
135 wvengen 178 <!--
136 wvengen 557 - Full JAR creation target
137 wvengen 178 -->
138 wvengen 557 <target name="jar.large" depends="compile">
139 wvengen 390 <basename property="dep.bouncycastle.basename" file="${dep.bouncycastle}"/>
140 wvengen 178 <jar jarfile="${dir.dist}/${target.name}.large.jar">
141     <manifest>
142     <attribute name="Built-By" value="${user.name}"/>
143     <attribute name="Main-Class" value="${target.main}"/>
144 wvengen 390 <attribute name="Class-Path" value="${dep.bouncycastle.basename}"/>
145 wvengen 178 </manifest>
146 wvengen 372 <fileset dir="${dir.build}">
147     <!-- remove non-production files -->
148     <exclude name="**/test*"/>
149 wvengen 509 <exclude name="**/*test/**"/>
150     <exclude name="**/*tests/**"/>
151 wvengen 372 <exclude name="**/package.html"/>
152     </fileset>
153 wvengen 250 <zipfileset src="${dep.cli}" includes="**/*.class"/>
154     <zipfileset src="${dep.swingworker}" includes="**/*.class"/>
155 wvengen 253 <zipfileset src="${dep.xhtmlrenderer}" includes="**/*.class" excludes="**/tool/**"/>
156 wvengen 401 <zipfileset src="${dep.itext}" includes="**/*.class,**/fonts/*" excludes="**/tools/**"/>
157 wvengen 444 <zipfileset src="${dep.winregistry}" includes="**/*.class"/>
158 wvengen 400 <!-- iText needs some org.bouncycastle.cms classes but some other classes in this
159     package reference javax.mail which we don't want to include as well (so that
160 wvengen 553 ProGuard can resolve them). Solution: only include part of the smime package.
161     In addition to this, certificate renewal also requires S/MIME mail stuff.
162 wvengen 555 The activation framework doesn't appear to be needed during run -->
163 wvengen 553 <zipfileset src="${dep.bouncycastle.smime}">
164     <include name="org/bouncycastle/cms/**"/>
165     <include name="org/bouncycastle/mail/smime/*.class/"/>
166     <include name="org/bouncycastle/mail/smime/util/*.class/"/>
167     </zipfileset>
168     <zipfileset src="${dep.javamail}" includes="**/*.class"/>
169 wvengen 178 </jar>
170 wvengen 557 </target>
171    
172     <!--
173     - Distribution creation target
174     -->
175     <target name="jar" depends="keystore,jar.large">
176 wvengen 178 <!-- minimize jar file; skipnonpubliclibraryclasses needed for java1.6 -->
177     <proguard obfuscate="false" skipnonpubliclibraryclasses="false">
178     <injar file="${dir.dist}/${target.name}.large.jar"/>
179     <outjar file="${dir.dist}/${target.name}.jar"/>
180     <libraryjar file="${java.home}/lib/rt.jar"/>
181 wvengen 399 <libraryjar file="${java.home}/lib/jce.jar"/>
182 wvengen 196 <libraryjar file="${java.home}/lib/jsse.jar"/>
183 wvengen 178 <libraryjar file="${dep.bouncycastle}"/>
184 wvengen 250 <libraryjar file="${dep.junit}"/>
185 wvengen 364 <libraryjar file="${dep.abbot}"/>
186 wvengen 557 <libraryjar file="${dep.activation}" jarfilter="${dep.activation.proguardfilter}" />
187 wvengen 250 <keepclasseswithmembers access="public">
188 wvengen 178 <method access="public static" type="void"
189     name="main" parameters="java.lang.String[]"/>
190     </keepclasseswithmembers>
191 wvengen 298 <!-- logging is dynamically configured -->
192     <keepclasseswithmembers access="public" name="org.xhtmlrenderer.util.XRSimpleLogFormatter">
193     <method name="*"/>
194     </keepclasseswithmembers>
195     <keepclasseswithmembers access="public" name="org.xhtmlrenderer.util.Configuration">
196     <method name="*"/>
197     </keepclasseswithmembers>
198 wvengen 178 </proguard>
199     <delete file="${dir.dist}/${target.name}.large.jar"/>
200     <!-- sign it, required for java web start -->
201     <signjar keystore="${keystore.file}" jar="${dir.dist}/${target.name}.jar"
202 wvengen 183 alias="${keystore.alias}" storepass="${keystore.passwd}"/>
203     <delete file="${keystore.tempfile}" quiet="true"/>
204 wvengen 178 <!-- substitute variables in java web start files -->
205     <copy file="${dir.dist}/${target.name}.jnlp.in" tofile="${dir.dist}/${target.name}.jnlp" />
206     <copy file="${dir.dist}/bcprov.jnlp.in" tofile="${dir.dist}/bcprov.jnlp" />
207     <replace dir="${dir.dist}">
208     <include name="${target.name}.jnlp"/>
209     <include name="bcprov.jnlp"/>
210     <replacefilter token="@wwwbase@" value="${wwwbase}"/>
211     <replacefilter token="@main@" value="${target.main}"/>
212     </replace>
213 wvengen 182 <!-- copy bouncycastle jar to deployment area -->
214     <copy file="${dep.bouncycastle}" todir="${dir.dist}"/>
215 wvengen 178 </target>
216 wvengen 557 <target name="dist" depends="jar"/>
217 wvengen 178
218     <!--
219     - Cleaning target
220     -->
221     <target name="clean">
222     <delete dir="${dir.build}"/>
223     <delete file="${dir.dist}/${target.name}.jar"/>
224     <delete file="${dir.dist}/${target.name}.jnlp"/>
225     <delete file="${dir.dist}/bcprov.jnlp"/>
226 wvengen 182 <basename property="dep.bouncycastle.basename" file="${dep.bouncycastle}"/>
227     <delete file="${dir.dist}/${dep.bouncycastle.basename}"/>
228 wvengen 178 </target>
229    
230 wvengen 464 <!--
231     - extra targets
232     -->
233     <target name="browsertool" depends="compile">
234     <jar jarfile="${dir.dist}/${browsertool.target.name}.jar">
235     <manifest>
236     <attribute name="Built-By" value="${user.name}"/>
237     <attribute name="Main-Class" value="${browsertool.target.main}"/>
238     </manifest>
239     <fileset dir="${dir.build}">
240     <!-- remove non-production files -->
241     <exclude name="**/test*"/>
242 wvengen 509 <exclude name="**/*test/**"/>
243     <exclude name="**/*tests/**"/>
244 wvengen 464 <exclude name="**/package.html"/>
245     <include name="nl/nikhef/jgridstart/install/**"/>
246     <include name="nl/nikhef/jgridstart/util/**"/>
247     </fileset>
248     <zipfileset src="${dep.cli}" includes="**/*.class"/>
249     <zipfileset src="${dep.winregistry}" includes="**/*.class"/>
250     </jar>
251     <!-- sign it, required for java web start -->
252     <signjar keystore="${keystore.file}" jar="${dir.dist}/${browsertool.name}.jar"
253     alias="${keystore.alias}" storepass="${keystore.passwd}"/>
254     </target>
255    
256 wvengen 487 <!-- javadoc with APIviz, needs graphviz >= 2.20 -->
257     <target name="javadoc" depends="compile">
258     <javadoc
259     destdir="${dir.javadoc}"
260     classpathref="path.dependencies"
261     access="protected" source="${target.jvmversion}"
262     doclet="org.jboss.apiviz.APIviz" docletpath="${dep.apiviz}" additionalparam="-sourceclasspath ${dir.build}">
263     <sourcefiles>
264     <fileset dir="${dir.src}">
265     <include name="**/*.java"/>
266 wvengen 492 <exclude name="**/*Test.*"/>
267     <exclude name="**/AllTests.*"/>
268 wvengen 487 </fileset>
269     </sourcefiles>
270     <link href="http://java.sun.com/j2se/1.5.0/docs/api/"/>
271     <link href="http://bouncycastle.org/docs/docs1.4/"/>
272     <link href="http://bouncycastle.org/docs/mdocs1.4/"/>
273     <link href="http://commons.apache.org/cli/api-1.2/"/>
274     <link href="http://junit.org/junit/javadoc/4.5/"/>
275     <link href="http://abbot.sourceforge.net/doc/api/"/>
276     <link href="https://swingworker.dev.java.net/nonav/javadoc/"/>
277     <link href="http://pigeonholdings.com/projects/flyingsaucer/R8/javadoc/user/"/>
278     <link href="http://www.1t3xt.info/api/"/>
279 wvengen 553 <link href="http://java.sun.com/products/javamail/javadocs/"/>
280 wvengen 514 <!-- no online javadoc found for WinRegistry -->
281 wvengen 487 </javadoc>
282     </target>
283 wvengen 514
284     <!-- test report -->
285     <target name="testreport" depends="compile">
286     <junit fork="yes" haltonfailure="no">
287     <test fork="yes" todir="${dir.testreports}" name="nl.nikhef.jgridstart.AllTests"/>
288     <formatter type="xml"/>
289     <classpath refid="path.dependencies"/>
290     <classpath path="${dir.build}"/>
291     </junit>
292     </target>
293 wvengen 253 </project>

Properties

Name Value
svn:mime-type text/plain

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