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

Properties

Name Value
svn:mime-type text/plain

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