-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
293 lines (236 loc) · 9.63 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
<project name="jimcat" default="build">
<property name="version" value="v0.1 - Iteration V" />
<!-- <property name="version" value="v0.1 - Final" /> -->
<!-- directories configuration -->
<property name="source" value="src/" />
<property name="bin" value="build/" />
<property name="dest" value="dest/" />
<property name="doc" value="doc/" />
<property name="libdir" value="./lib" />
<property name="datadir" value="./data" />
<property name="antlibs" value="./libant" />
<property name="scpkeyfile" value="../Password/jimcat.key" />
<!-- resource file configuration -->
<property name="manifestfile" value="./res/MANIFEST.MF" />
<property name="splashscreen" value="./src/org/jimcat/gui/splashscreen/splashscreen.png" />
<property name="webstartscript" value="./res/jimcat.jnlp" />
<property name="website" value="./res/jimcat.html" />
<!-- keystore to sign jars -->
<property name="keystore" value="./res/keystore" />
<!-- required libraries -->
<property name="substance" value="substance.jar" />
<property name="swingx" value="swingx-2007_05_01.jar" />
<property name="commons-lang" value="commons-lang-2.3.jar" />
<property name="joda-time" value="joda-time-1.4.jar" />
<property name="xstream" value="xstream-1.2.1.jar" />
<property name="xpp3-min" value="xpp3_min-1.1.3.4.O.jar" />
<property name="commons-io" value="commons-io-1.3.1.jar" />
<property name="metadata-extractor" value="metadata-extractor-2.3.1.jar" />
<property name="log4j" value="log4j-1.2.11.jar" />
<property name="dom4j" value="dom4j-1.6.1.jar" />
<property name="commons-logging" value="commons-logging-1.0.4.jar" />
<property name="commons-collections" value="commons-collections-2.1.1.jar" />
<property name="db4o" value="db4o-6.4.54.11278-java5.jar" />
<property name="looks" value="looks-2.1.4.jar" />
<property name="junit" value="junit.jar" />
<!-- teh result jar -->
<property name="jimcat" value="jimcat.jar" />
<!-- targets -->
<target name="init" description="initialiszing antscript">
<mkdir dir="${bin}" />
<mkdir dir="${dest}" />
<mkdir dir="${doc}" />
<!-- a list of source libs -->
<path id="sourcelibs">
<pathelement path="${libdir}/${substance}" />
<pathelement path="${libdir}/${swingx}" />
<pathelement path="${libdir}/${commons-lang}" />
<pathelement path="${libdir}/${joda-time}" />
<pathelement path="${libdir}/${xstream}" />
<pathelement path="${libdir}/${xpp3-min}" />
<pathelement path="${libdir}/${commons-io}" />
<pathelement path="${libdir}/${metadata-extractor}" />
<pathelement path="${libdir}/${log4j}" />
<pathelement path="${libdir}/${dom4j}" />
<pathelement path="${libdir}/${commons-logging}" />
<pathelement path="${libdir}/${commons-collections}" />
<pathelement path="${libdir}/${db4o}" />
<pathelement path="${libdir}/${looks}" />
<pathelement path="${ant.home}/../org.junit_3.8.1/${junit}" />
</path>
<!-- a list of destination libs -->
<path id="destlibs">
<pathelement path="${dest}/${substance}" />
<pathelement path="${dest}/${swingx}" />
<pathelement path="${dest}/${commons-lang}" />
<pathelement path="${dest}/${joda-time}" />
<pathelement path="${dest}/${xstream}" />
<pathelement path="${dest}/${xpp3-min}" />
<pathelement path="${dest}/${commons-io}" />
<pathelement path="${dest}/${metadata-extractor}" />
<pathelement path="${dest}/${log4j}" />
<pathelement path="${dest}/${dom4j}" />
<pathelement path="${dest}/${commons-logging}" />
<pathelement path="${dest}/${commons-collections}" />
<pathelement path="${dest}/${db4o}" />
<pathelement path="${dest}/${junit}" />
<pathelement path="${dest}/${looks}" />
<pathelement path="${dest}/${jimcat}" />
</path>
<property name="manifest.classpath" value="${substance} ${swingx} ${commons-lang} ${joda-time} ${xstream} ${xpp3-min} ${commons-io} ${metadata-extractor} ${log4j} ${dom4j} ${commons-logging} ${commons-collections} ${looks} ${db4o}" />
<!-- install svn ant task -->
<path id="svnAnt.classpath">
<fileset dir="${antlibs}">
<include name="**/*.jar" />
</fileset>
</path>
<taskdef name="svn" classname="org.tigris.subversion.svnant.SvnTask" classpathref="svnAnt.classpath" />
</target>
<!-- check if all required libraries are available -->
<target name="check" description="checks if all needed libs are available">
<antcall target="checkfile">
<param name="checkfile" value="${libdir}/${substance}" />
</antcall>
<antcall target="checkfile">
<param name="checkfile" value="${libdir}/${swingx}" />
</antcall>
<antcall target="checkfile">
<param name="checkfile" value="${libdir}/${commons-lang}" />
</antcall>
<antcall target="checkfile">
<param name="checkfile" value="${libdir}/${joda-time}" />
</antcall>
<antcall target="checkfile">
<param name="checkfile" value="${libdir}/${xstream}" />
</antcall>
<antcall target="checkfile">
<param name="checkfile" value="${libdir}/${xpp3-min}" />
</antcall>
<antcall target="checkfile">
<param name="checkfile" value="${libdir}/${commons-io}" />
</antcall>
<antcall target="checkfile">
<param name="checkfile" value="${libdir}/${metadata-extractor}" />
</antcall>
<antcall target="checkfile">
<param name="checkfile" value="${libdir}/${log4j}" />
</antcall>
<antcall target="checkfile">
<param name="checkfile" value="${libdir}/${dom4j}" />
</antcall>
<antcall target="checkfile">
<param name="checkfile" value="${libdir}/${commons-logging}" />
</antcall>
<antcall target="checkfile">
<param name="checkfile" value="${libdir}/${commons-collections}" />
</antcall>
<antcall target="checkfile">
<param name="checkfile" value="${libdir}/${db4o}" />
</antcall>
</target>
<!-- ant task checking if single file exists -->
<target name="checkfile" description="checks if the file handed in is available">
<available file="${checkfile}" property="jar.present" />
<fail unless="jar.present" message="Bitte zuerst ${checkfile} bereitstellen!" />
</target>
<target name="compile" description="compiles the source of this project" depends="init,check">
<javac optimize="true" srcdir="${source}" destdir="${bin}" target="1.5">
<classpath refid="sourcelibs" />
</javac>
<copy todir="${bin}">
<fileset dir="${source}">
<exclude name="**/*.java" />
</fileset>
</copy>
</target>
<target name="build" description="generates jar files" depends="init,clean,compile">
<copy file="${splashscreen}" todir="${bin}" />
<!-- build time -->
<tstamp>
<format property="BUILD_TIME" pattern="dd-MM-yyyy HH:mm:ss" locale="de,AT" />
</tstamp>
<!-- svn revision -->
<!--<svn>
<status path="./" revisionproperty="REVISION_NUMBER" />
</svn>-->
<manifest file="${manifestfile}">
<attribute name="Main-Class" value="org.jimcat.JimCat" />
<attribute name="Class-Path" value="${manifest.classpath}" />
<!-- <attribute name="SplashScreen-Image" value="jimcat.png" /> -->
<attribute name="Implementation-Title" value="development build" />
<attribute name="Implementation-Version" value="${version} - Revision: ${BUILD_TIME}" />
</manifest>
<jar destfile="${dest}/${jimcat}" basedir="${bin}" manifest="${manifestfile}" />
<copy todir="${dest}" flatten="true">
<fileset dir="${libdir}">
<filename name="**/*.jar" />
</fileset>
</copy>
</target>
<target name="run" description="runes">
<java classname="org.jimcat.JimCat" fork="yes" spawn="false">
<classpath refid="destlibs" />
</java>
</target>
<target name="buildAndRun" description="compiles and runs this project">
<antcall target="build" />
<antcall target="run" />
</target>
<target name="env" description="prints version infos">
<echo message="Antversion: ${ant.version}" />
<echo message="JavaVersion: ${java.version}" />
<echo message="Ant Libarey: ${ant.home}" />
</target>
<!-- if you just want to update jimcat -->
<target name="deploy" depends="clean,build" description="copy app to server">
<signjar alias="mykey" keystore="${keystore}" storepass="jimcat" lazy="true">
<fileset dir="${dest}">
<include name="jimcat.jar" />
</fileset>
</signjar>
<scp todir="[email protected]:incoming/" keyfile="${scpkeyfile}" passphrase="" trust="true">
<fileset dir="${dest}">
<include name="jimcat.jar" />
</fileset>
</scp>
</target>
<!-- use this if there have been some major changes -->
<target name="deployAll" depends="clean,build" description="copy app to server">
<copy file="${website}" todir="${dest}" />
<copy file="${webstartscript}" todir="${dest}" />
<copy file="${splashscreen}" todir="${dest}" />
<antcall target="signdest" />
<scp todir="[email protected]:incoming/" keyfile="${scpkeyfile}" passphrase="" trust="true">
<fileset dir="${dest}">
</fileset>
</scp>
</target>
<target name="signdest" depends="init">
<signjar alias="mykey" keystore="${keystore}" storepass="jimcat" lazy="true">
<fileset dir="${dest}">
<include name="*.jar" />
</fileset>
</signjar>
</target>
<target name="javadoc" depends="init" description="generate javadoc">
<javadoc destdir="${doc}" author="false" version="true" use="true" access="private" windowtitle="JimCat Documentation">
<fileset dir="${source}">
<include name="**/*.java" />
</fileset>
<classpath refid="sourcelibs" />
<tag name="todo" scope="all" description="To do:" />
<link href="http://java.sun.com/j2se/1.5.0/docs/api/" />
</javadoc>
</target>
<target name="clean" description="removes dest directory">
<delete>
<fileset dir="${bin}/" includes="**" />
</delete>
<delete>
<fileset dir="${dest}/" includes="**" />
</delete>
<delete>
<fileset dir="${doc}/" includes="**" />
</delete>
</target>
</project>