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

Properties

Name Value
svn:mime-type text/plain

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