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

Properties

Name Value
svn:mime-type text/plain

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