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

Properties

Name Value
svn:mime-type text/plain

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