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

Properties

Name Value
svn:mime-type text/plain

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