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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 227 - (show annotations) (download)
Thu Apr 16 13:38:46 2009 UTC (13 years, 3 months ago) by wvengen
File MIME type: text/plain
File size: 6445 byte(s)
add swingworker to dependencies to build for java1.5 and below; add javadoc
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/jgridstart03/"/>
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 <property name="dep.bouncycastle" location="${dir.thirdparty}/bouncycastle/bcprov-jdk14-142.jar"/>
50 <property name="dep.cli" location="${dir.thirdparty}/commons-cli/commons-cli-1.2.jar"/>
51 <property name="dep.junit" location="${dir.thirdparty}/junit/junit-4.5.jar"/>
52 <property name="dep.swingworker" location="${dir.thirdparty}/swingworker/swing-worker-1.2.jar"/>
53 <path id="path.dependencies">
54 <!-- TODO use jdk13 library versions and test -->
55 <pathelement location="${dep.bouncycastle}"/>
56 <pathelement location="${dep.cli}"/>
57 <pathelement location="${dep.junit}"/>
58 <pathelement location="${dep.swingworker}"/> <!-- for java1.5 and below -->
59 </path>
60
61 <!--
62 - Initialisation and other setup
63 -->
64
65 <!-- keystore; create one if not supplied -->
66 <available file="${keystore.file}" type="file" property="keystore.available"/>
67 <target name="keystore" unless="keystore.available">
68 <tempfile property="keystore.file" prefix="keystore" suffix=".ks"/>
69 <property name="keystore.tempfile" value="${keystore.file}"/>
70 <property name="keystore.alias" value="default"/>
71 <property name="keystore.passwd" value="xyz12345"/>
72 <genkey alias="${keystore.alias}" storepass="${keystore.passwd}" keystore="${keystore.file}"
73 validity="1" dname="CN=Test, OU=Test, O=Test, C=Test"/>
74 </target>
75
76 <!-- proguard -->
77 <taskdef resource="proguard/ant/task.properties"
78 classpath="${dir.thirdparty}/proguard/proguard.jar"/>
79
80 <!-- timestamp -->
81 <target name="init">
82 <tstamp/>
83 </target>
84
85 <!--
86 - Compilation target
87 -->
88 <target name="compile" depends="init">
89 <mkdir dir="${dir.build}"/>
90 <!-- compile java sources -->
91 <javac srcdir="${dir.src}" destdir="${dir.build}" target="${target.jvmversion}">
92 <classpath refid="path.dependencies" />
93 </javac>
94 <!-- and copy resources; skip VCS dirs (and other hidden .*) -->
95 <copy todir="${dir.build}">
96 <fileset dir="${dir.src}">
97 <exclude name="**/*.java"/>
98 <exclude name="**/CVS"/>
99 <exclude name="**/.*"/>
100 </fileset>
101 </copy>
102 </target>
103
104 <!--
105 - Distribution creation target
106 -->
107 <target name="dist" depends="compile,keystore">
108 <!-- pack into jar -->
109 <jar jarfile="${dir.dist}/${target.name}.large.jar">
110 <manifest>
111 <attribute name="Built-By" value="${user.name}"/>
112 <attribute name="Main-Class" value="${target.main}"/>
113 </manifest>
114 <fileset dir="${dir.build}">
115 <exclude name="**/*Test.*"/>
116 <exclude name="**/AllTests.*"/>
117 </fileset>
118 <zipfileset src="${dep.cli}" excludes="META-INF/**"/>
119 <zipfileset src="${dep.swingworker}" excludes="META-INF/**"/>
120 </jar>
121 <!-- minimize jar file; skipnonpubliclibraryclasses needed for java1.6 -->
122 <proguard obfuscate="false" skipnonpubliclibraryclasses="false">
123 <injar file="${dir.dist}/${target.name}.large.jar"/>
124 <outjar file="${dir.dist}/${target.name}.jar"/>
125 <libraryjar file="${java.home}/lib/rt.jar"/>
126 <libraryjar file="${java.home}/lib/jsse.jar"/>
127 <libraryjar file="${dep.bouncycastle}"/>
128 <keepclasseswithmembers access="public">
129 <method access="public static" type="void"
130 name="main" parameters="java.lang.String[]"/>
131 </keepclasseswithmembers>
132 </proguard>
133 <delete file="${dir.dist}/${target.name}.large.jar"/>
134 <!-- sign it, required for java web start -->
135 <signjar keystore="${keystore.file}" jar="${dir.dist}/${target.name}.jar"
136 alias="${keystore.alias}" storepass="${keystore.passwd}"/>
137 <delete file="${keystore.tempfile}" quiet="true"/>
138 <!-- substitute variables in java web start files -->
139 <copy file="${dir.dist}/${target.name}.jnlp.in" tofile="${dir.dist}/${target.name}.jnlp" />
140 <copy file="${dir.dist}/bcprov.jnlp.in" tofile="${dir.dist}/bcprov.jnlp" />
141 <replace dir="${dir.dist}">
142 <include name="${target.name}.jnlp"/>
143 <include name="bcprov.jnlp"/>
144 <replacefilter token="@wwwbase@" value="${wwwbase}"/>
145 <replacefilter token="@main@" value="${target.main}"/>
146 </replace>
147 <!-- copy bouncycastle jar to deployment area -->
148 <copy file="${dep.bouncycastle}" todir="${dir.dist}"/>
149 </target>
150 <target name="jar" depends="dist"/>
151
152 <!--
153 - Cleaning target
154 -->
155 <target name="clean">
156 <delete dir="${dir.build}"/>
157 <delete file="${dir.dist}/${target.name}.jar"/>
158 <delete file="${dir.dist}/${target.name}.jnlp"/>
159 <delete file="${dir.dist}/bcprov.jnlp"/>
160 <basename property="dep.bouncycastle.basename" file="${dep.bouncycastle}"/>
161 <delete file="${dir.dist}/${dep.bouncycastle.basename}"/>
162 </target>
163
164 </project>

Properties

Name Value
svn:mime-type text/plain

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