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

Properties

Name Value
svn:mime-type text/plain

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