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

Properties

Name Value
svn:mime-type text/plain

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