/[pdpsoft]/trunk/nl.nikhef.jgridstart/build.xml
ViewVC logotype

Annotation of /trunk/nl.nikhef.jgridstart/build.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 234 - (hide annotations) (download)
Mon Apr 20 07:05:38 2009 UTC (13 years, 5 months ago) by wvengen
File MIME type: text/plain
File size: 6819 byte(s)
make compilation on java 1.5 work again; make proguard work with HTMLPane
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 178 <property name="wwwbase" value="http://www.nikhef.nl/~wvengen/jgridstart03/"/>
21    
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 234 <!--
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 227 <property name="dep.swingworker" location="${dir.thirdparty}/swingworker/swing-worker-1.2.jar"/>
55 wvengen 234 <!-- HTMLPane is used as dependency but needs stubs for ProGuard :/ -->
56 wvengen 233 <property name="dep.htmlpane" location="${dir.thirdparty}/htmlpane/HTMLPane.jar"/>
57 wvengen 234 <property name="dep.htmlpane.stubs" location="${dir.thirdparty}/htmlpane/HTMLPane-stubs.zip"/>
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 227 <pathelement location="${dep.swingworker}"/> <!-- for java1.5 and below -->
64 wvengen 233 <pathelement location="${dep.htmlpane}"/>
65 wvengen 178 </path>
66    
67     <!--
68     - Initialisation and other setup
69     -->
70 wvengen 183
71     <!-- keystore; create one if not supplied -->
72     <available file="${keystore.file}" type="file" property="keystore.available"/>
73     <target name="keystore" unless="keystore.available">
74     <tempfile property="keystore.file" prefix="keystore" suffix=".ks"/>
75     <property name="keystore.tempfile" value="${keystore.file}"/>
76     <property name="keystore.alias" value="default"/>
77     <property name="keystore.passwd" value="xyz12345"/>
78     <genkey alias="${keystore.alias}" storepass="${keystore.passwd}" keystore="${keystore.file}"
79     validity="1" dname="CN=Test, OU=Test, O=Test, C=Test"/>
80     </target>
81    
82     <!-- proguard -->
83 wvengen 178 <taskdef resource="proguard/ant/task.properties"
84     classpath="${dir.thirdparty}/proguard/proguard.jar"/>
85    
86 wvengen 183 <!-- timestamp -->
87 wvengen 178 <target name="init">
88     <tstamp/>
89     </target>
90    
91     <!--
92     - Compilation target
93     -->
94     <target name="compile" depends="init">
95     <mkdir dir="${dir.build}"/>
96     <!-- compile java sources -->
97     <javac srcdir="${dir.src}" destdir="${dir.build}" target="${target.jvmversion}">
98     <classpath refid="path.dependencies" />
99     </javac>
100     <!-- and copy resources; skip VCS dirs (and other hidden .*) -->
101     <copy todir="${dir.build}">
102     <fileset dir="${dir.src}">
103     <exclude name="**/*.java"/>
104     <exclude name="**/CVS"/>
105     <exclude name="**/.*"/>
106     </fileset>
107     </copy>
108     </target>
109    
110     <!--
111     - Distribution creation target
112     -->
113 wvengen 183 <target name="dist" depends="compile,keystore">
114 wvengen 178 <!-- pack into jar -->
115     <jar jarfile="${dir.dist}/${target.name}.large.jar">
116     <manifest>
117     <attribute name="Built-By" value="${user.name}"/>
118     <attribute name="Main-Class" value="${target.main}"/>
119     </manifest>
120 wvengen 234 <fileset dir="${dir.build}"/>
121     <zipfileset src="${dep.cli}" includes="**/*.class"/>
122     <zipfileset src="${dep.swingworker}" includes="**/*.class"/>
123     <zipfileset src="${dep.htmlpane}" includes="**/*.class images/**"/>
124 wvengen 178 </jar>
125     <!-- minimize jar file; skipnonpubliclibraryclasses needed for java1.6 -->
126     <proguard obfuscate="false" skipnonpubliclibraryclasses="false">
127     <injar file="${dir.dist}/${target.name}.large.jar"/>
128     <outjar file="${dir.dist}/${target.name}.jar"/>
129     <libraryjar file="${java.home}/lib/rt.jar"/>
130 wvengen 202 <libraryjar file="${java.home}/lib/jsse.jar"/>
131 wvengen 178 <libraryjar file="${dep.bouncycastle}"/>
132 wvengen 234 <libraryjar file="${dep.junit}"/>
133     <libraryjar file="${dep.htmlpane.stubs}"/>
134 wvengen 178 <keepclasseswithmembers access="public">
135     <method access="public static" type="void"
136     name="main" parameters="java.lang.String[]"/>
137     </keepclasseswithmembers>
138     </proguard>
139     <delete file="${dir.dist}/${target.name}.large.jar"/>
140     <!-- sign it, required for java web start -->
141     <signjar keystore="${keystore.file}" jar="${dir.dist}/${target.name}.jar"
142 wvengen 183 alias="${keystore.alias}" storepass="${keystore.passwd}"/>
143     <delete file="${keystore.tempfile}" quiet="true"/>
144 wvengen 178 <!-- substitute variables in java web start files -->
145     <copy file="${dir.dist}/${target.name}.jnlp.in" tofile="${dir.dist}/${target.name}.jnlp" />
146     <copy file="${dir.dist}/bcprov.jnlp.in" tofile="${dir.dist}/bcprov.jnlp" />
147     <replace dir="${dir.dist}">
148     <include name="${target.name}.jnlp"/>
149     <include name="bcprov.jnlp"/>
150     <replacefilter token="@wwwbase@" value="${wwwbase}"/>
151     <replacefilter token="@main@" value="${target.main}"/>
152     </replace>
153 wvengen 182 <!-- copy bouncycastle jar to deployment area -->
154     <copy file="${dep.bouncycastle}" todir="${dir.dist}"/>
155 wvengen 178 </target>
156     <target name="jar" depends="dist"/>
157    
158     <!--
159     - Cleaning target
160     -->
161     <target name="clean">
162     <delete dir="${dir.build}"/>
163     <delete file="${dir.dist}/${target.name}.jar"/>
164     <delete file="${dir.dist}/${target.name}.jnlp"/>
165     <delete file="${dir.dist}/bcprov.jnlp"/>
166 wvengen 182 <basename property="dep.bouncycastle.basename" file="${dep.bouncycastle}"/>
167     <delete file="${dir.dist}/${dep.bouncycastle.basename}"/>
168 wvengen 178 </target>
169    
170     </project>

Properties

Name Value
svn:mime-type text/plain

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