/[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 561 - (show annotations) (download)
Fri Jul 17 12:23:50 2009 UTC (12 years, 4 months ago) by wvengen
File MIME type: text/plain
File size: 12593 byte(s)
move to different development build www location
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.cli" location="${dir.thirdparty}/commons-cli/commons-cli-1.2.jar"/>
63 <property name="dep.junit" location="${dir.thirdparty}/junit/junit-4.5.jar"/>
64 <property name="dep.abbot" location="${dir.thirdparty}/junit/abbot.jar"/>
65 <property name="dep.swingworker" location="${dir.thirdparty}/swingworker/swing-worker-1.2.jar"/>
66 <property name="dep.xhtmlrenderer" location="${dir.thirdparty}/flyingsaucer/core-renderer-minimal.jar"/>
67 <property name="dep.itext" location="${dir.thirdparty}/flyingsaucer/iText-2.0.8.jar"/>
68 <property name="dep.winregistry" location="${dir.thirdparty}/winregistry/WinRegistry-3.4.jar"/>
69 <property name="dep.apiviz" location="${dir.thirdparty}/javadoc/apiviz-1.3.0.GA.jar"/>
70 <!-- 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 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 <not><available classname="javax.activation.DataHandler"/></not>
77 </condition>
78 <path id="path.dependencies">
79 <!-- TODO use jdk13 library versions and test -->
80 <pathelement location="${dep.bouncycastle}"/>
81 <pathelement location="${dep.bouncycastle.smime}"/>
82 <pathelement location="${dep.javamail}"/>
83 <pathelement location="${dep.cli}"/>
84 <pathelement location="${dep.junit}"/>
85 <pathelement location="${dep.abbot}"/>
86 <pathelement location="${dep.swingworker}"/> <!-- for java1.5 and below -->
87 <pathelement location="${dep.xhtmlrenderer}"/>
88 <pathelement location="${dep.itext}"/>
89 <pathelement location="${dep.winregistry}"/>
90 </path>
91
92 <!--
93 - Initialisation and other setup
94 -->
95
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 <taskdef resource="proguard/ant/task.properties"
109 classpath="${dir.thirdparty}/proguard/proguard.jar"/>
110
111 <!-- timestamp -->
112 <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
135 <!--
136 - Full JAR creation target
137 -->
138 <target name="jar.large" depends="compile">
139 <basename property="dep.bouncycastle.basename" file="${dep.bouncycastle}"/>
140 <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 <attribute name="Class-Path" value="${dep.bouncycastle.basename}"/>
145 </manifest>
146 <fileset dir="${dir.build}">
147 <!-- remove non-production files -->
148 <exclude name="**/test*"/>
149 <exclude name="**/*test/**"/>
150 <exclude name="**/*tests/**"/>
151 <exclude name="**/package.html"/>
152 </fileset>
153 <zipfileset src="${dep.cli}" includes="**/*.class"/>
154 <zipfileset src="${dep.swingworker}" includes="**/*.class"/>
155 <zipfileset src="${dep.xhtmlrenderer}" includes="**/*.class" excludes="**/tool/**"/>
156 <zipfileset src="${dep.itext}" includes="**/*.class,**/fonts/*" excludes="**/tools/**"/>
157 <zipfileset src="${dep.winregistry}" includes="**/*.class"/>
158 <!-- 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 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 The activation framework doesn't appear to be needed during run -->
163 <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 </jar>
170 </target>
171
172 <!--
173 - Distribution creation target
174 -->
175 <target name="jar" depends="keystore,jar.large">
176 <!-- 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 <libraryjar file="${java.home}/lib/jce.jar"/>
182 <libraryjar file="${java.home}/lib/jsse.jar"/>
183 <libraryjar file="${dep.bouncycastle}"/>
184 <libraryjar file="${dep.junit}"/>
185 <libraryjar file="${dep.abbot}"/>
186 <libraryjar file="${dep.activation}" jarfilter="${dep.activation.proguardfilter}" />
187 <keepclasseswithmembers access="public">
188 <method access="public static" type="void"
189 name="main" parameters="java.lang.String[]"/>
190 </keepclasseswithmembers>
191 <!-- 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 </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 alias="${keystore.alias}" storepass="${keystore.passwd}"/>
203 <delete file="${keystore.tempfile}" quiet="true"/>
204 <!-- 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 <!-- copy bouncycastle jar to deployment area -->
214 <copy file="${dep.bouncycastle}" todir="${dir.dist}"/>
215 </target>
216 <target name="dist" depends="jar"/>
217
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 <basename property="dep.bouncycastle.basename" file="${dep.bouncycastle}"/>
227 <delete file="${dir.dist}/${dep.bouncycastle.basename}"/>
228 </target>
229
230 <!--
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 <exclude name="**/*test/**"/>
243 <exclude name="**/*tests/**"/>
244 <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 <!-- 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 <exclude name="**/*Test.*"/>
267 <exclude name="**/AllTests.*"/>
268 </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 <link href="http://java.sun.com/products/javamail/javadocs/"/>
280 <!-- no online javadoc found for WinRegistry -->
281 </javadoc>
282 </target>
283
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 </project>

Properties

Name Value
svn:mime-type text/plain

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