/[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 183 - (hide annotations) (download)
Tue Apr 7 13:10:39 2009 UTC (13 years, 5 months ago) by wvengen
File MIME type: text/plain
File size: 6154 byte(s)
create self-signed keystore when not found in build so it builds out-of-the-box; comment build.xml properties
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 178
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 wvengen 180 <property name="dep.junit" location="${dir.thirdparty}/junit/junit-4.5.jar"/>
52 wvengen 178 <path id="path.dependencies">
53     <!-- TODO use jdk13 library versions and test -->
54     <pathelement location="${dep.bouncycastle}"/>
55     <pathelement location="${dep.cli}"/>
56 wvengen 180 <pathelement location="${dep.junit}"/>
57 wvengen 178 </path>
58    
59     <!--
60     - Initialisation and other setup
61     -->
62 wvengen 183
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 wvengen 178 <taskdef resource="proguard/ant/task.properties"
76     classpath="${dir.thirdparty}/proguard/proguard.jar"/>
77    
78 wvengen 183 <!-- timestamp -->
79 wvengen 178 <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 wvengen 183 <target name="dist" depends="compile,keystore">
106 wvengen 178 <!-- 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 wvengen 180 <fileset dir="${dir.build}">
113     <exclude name="**/*Test.*"/>
114     <exclude name="**/AllTests.*"/>
115     </fileset>
116 wvengen 178 <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="${dep.bouncycastle}"/>
124     <keepclasseswithmembers access="public">
125     <method access="public static" type="void"
126     name="main" parameters="java.lang.String[]"/>
127     </keepclasseswithmembers>
128     </proguard>
129     <delete file="${dir.dist}/${target.name}.large.jar"/>
130     <!-- sign it, required for java web start -->
131     <signjar keystore="${keystore.file}" jar="${dir.dist}/${target.name}.jar"
132 wvengen 183 alias="${keystore.alias}" storepass="${keystore.passwd}"/>
133     <delete file="${keystore.tempfile}" quiet="true"/>
134 wvengen 178 <!-- substitute variables in java web start files -->
135     <copy file="${dir.dist}/${target.name}.jnlp.in" tofile="${dir.dist}/${target.name}.jnlp" />
136     <copy file="${dir.dist}/bcprov.jnlp.in" tofile="${dir.dist}/bcprov.jnlp" />
137     <replace dir="${dir.dist}">
138     <include name="${target.name}.jnlp"/>
139     <include name="bcprov.jnlp"/>
140     <replacefilter token="@wwwbase@" value="${wwwbase}"/>
141     <replacefilter token="@main@" value="${target.main}"/>
142     </replace>
143 wvengen 182 <!-- copy bouncycastle jar to deployment area -->
144     <copy file="${dep.bouncycastle}" todir="${dir.dist}"/>
145 wvengen 178 </target>
146     <target name="jar" depends="dist"/>
147    
148     <!--
149     - Cleaning target
150     -->
151     <target name="clean">
152     <delete dir="${dir.build}"/>
153     <delete file="${dir.dist}/${target.name}.jar"/>
154     <delete file="${dir.dist}/${target.name}.jnlp"/>
155     <delete file="${dir.dist}/bcprov.jnlp"/>
156 wvengen 182 <basename property="dep.bouncycastle.basename" file="${dep.bouncycastle}"/>
157     <delete file="${dir.dist}/${dep.bouncycastle.basename}"/>
158 wvengen 178 </target>
159    
160     </project>

Properties

Name Value
svn:mime-type text/plain

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