forked from dougm/jets3t
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.xml
519 lines (456 loc) · 16 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
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
<?xml version="1.0"?>
<!-- ======================================================================
JetS3t
Toolkit for Amazon's S3 online storage service.
James Murty
====================================================================== -->
<project name="JetS3t" default="dist">
<description>
JetS3t : Toolkit for Amazon's S3 online storage service
</description>
<property file="build.properties"/>
<!-- =================================
Define the script-wide classpath.
================================= -->
<path id="classpath">
<fileset dir="${dir.libs}" includes="**/*.jar"/>
</path>
<target name="compile">
<mkdir dir="${dir.build}"/>
<javac
srcdir="${dir.src}"
destdir="${dir.build}"
debug="${debug}"
source="1.4"
target="${build.target}">
<classpath refid="classpath"/>
<exclude name="**/mir/**"/>
<exclude name="contribs/mx/**" unless="contribs.include-mx"/>
</javac>
</target>
<target name="dist-service" depends="compile">
<mkdir dir="${dir.dist}/jets3t-${version}/jars"/>
<jar
basedir="${dir.build}"
file="${dir.dist}/jets3t-${version}/jars/${dist.file.service}"
index="true"
>
<include name="org/jets3t/service/**"/>
<include name="org/apache/commons/httpclient/contrib/**"/>
<include name="contribs/mx/**" if="contribs.include-mx"/>
</jar>
<jar
basedir="${dir.build}"
file="${dir.dist}/jets3t-${version}/jars/${dist.file.guisupport}"
index="true"
>
<include name="org/jets3t/gui/**"/>
<include name="org/jets3t/gui/skins/**"/>
</jar>
</target>
<target name="dist-resources">
<mkdir dir="${dir.dist}/jets3t-${version}/resources"/>
<copy
todir="${dir.dist}/jets3t-${version}/resources">
<fileset dir="${dir.resources}"/>
</copy>
</target>
<target name="dist-app-cockpit" depends="dist-service,dist-resources">
<mkdir dir="${dir.dist}/jets3t-${version}/jars"/>
<jar
basedir="${dir.build}"
file="${dir.dist}/jets3t-${version}/jars/${dist.file.cockpit}"
index="true"
>
<include name="org/jets3t/apps/cockpit/**"/>
<manifest>
<attribute name="Main-Class" value="org.jets3t.apps.cockpit.Cockpit"/>
</manifest>
</jar>
</target>
<target name="dist-app-cockpitlite" depends="dist-service,dist-resources">
<mkdir dir="${dir.dist}/jets3t-${version}/jars"/>
<jar
basedir="${dir.build}"
file="${dir.dist}/jets3t-${version}/jars/${dist.file.cockpitlite}"
index="true"
>
<include name="org/jets3t/apps/cockpitlite/**"/>
<manifest>
<attribute name="Main-Class" value="org.jets3t.apps.cockpitlite.CockpitLite"/>
</manifest>
</jar>
</target>
<target name="dist-app-synchronize" depends="dist-service,dist-resources">
<mkdir dir="${dir.dist}/jets3t-${version}/jars"/>
<jar
basedir="${dir.build}"
file="${dir.dist}/jets3t-${version}/jars/${dist.file.synchronize}"
index="true"
>
<include name="org/jets3t/apps/synchronize/**"/>
<manifest>
<attribute name="Main-Class" value="org.jets3t.apps.synchronize.Synchronize"/>
</manifest>
</jar>
</target>
<target name="dist-app-uploader" depends="dist-service,dist-resources">
<mkdir dir="${dir.dist}/jets3t-${version}/jars"/>
<jar
basedir="${dir.build}"
file="${dir.dist}/jets3t-${version}/jars/${dist.file.uploader}"
index="true"
>
<include name="org/jets3t/apps/uploader/**"/>
<manifest>
<attribute name="Main-Class" value="org.jets3t.apps.uploader.Uploader"/>
</manifest>
</jar>
</target>
<target name="dist-servlets" depends="dist-servlet-gatekeeper">
</target>
<target name="dist-servlet-gatekeeper" depends="dist-service">
<mkdir dir="${dir.dist}/jets3t-${version}/servlets/gatekeeper"/>
<war
destfile="${dir.dist}/jets3t-${version}/servlets/gatekeeper/${dist.file.gatekeeper}"
webxml="${dir.servlet}/gatekeeper-web.xml"
>
<lib dir="${dir.dist}/jets3t-${version}/jars" includes="${dist.file.service}"/>
<lib dir="${dir.libs}/commons-httpclient" includes="*.jar"/>
<lib dir="${dir.libs}/commons-logging" includes="*.jar"/>
<lib dir="${dir.libs}/commons-codec" includes="*.jar"/>
<lib dir="${dir.libs}/logging-log4j" includes="*.jar"/>
<lib dir="${dir.libs}/safehaus_jug" includes="*.jar"/>
<classes dir="${dir.servlet}">
<include name="commons-logging.properties"/>
<include name="log4j.properties"/>
<include name="simplelog.properties"/>
</classes>
<classes dir="${dir.build}">
<include name="org/jets3t/servlets/gatekeeper/**"/>
</classes>
</war>
</target>
<target name="dist-apps" depends="dist-app-cockpit,dist-app-cockpitlite,dist-app-synchronize,dist-app-uploader">
</target>
<target name="dist" depends="dist-service,dist-apps,dist-servlets">
<!-- Copy configs to dist directory -->
<mkdir dir="${dir.dist}/jets3t-${version}/configs"/>
<copy
todir="${dir.dist}/jets3t-${version}/configs">
<fileset dir="${dir.configs}"/>
</copy>
<replace dir="${dir.dist}/jets3t-${version}/configs"
token="{jets3t-version}" value="${version}"/>
<!-- Copy scripts to dist directory so they are included in archive files -->
<mkdir dir="${dir.dist}/jets3t-${version}/bin"/>
<copy
todir="${dir.dist}/jets3t-${version}/bin">
<fileset dir="${dir.scripts}"/>
</copy>
<replace dir="${dir.dist}/jets3t-${version}/bin"
token="{jets3t-version}" value="${version}"/>
<!-- Copy libraries to dist directory so they are included in archive files -->
<mkdir dir="${dir.dist}/jets3t-${version}/libs"/>
<copy
todir="${dir.dist}/jets3t-${version}/libs">
<fileset dir="${dir.libs}" includes="**/*"/>
</copy>
</target>
<target name="package" depends="dist,package-applets,api-docs">
<!-- Zip source code to dist directory so it's included in distribution -->
<zip destfile="${dir.dist}/jets3t-${version}/src.zip"
basedir="${dir.src}/.."
includes="src/**/*.java"
excludes="**/mir/**"/>
<!-- Zip API documentation to dist directory so it's included in distribution -->
<zip destfile="${dir.dist}/jets3t-${version}/api-docs.zip"
basedir="${dir.apidocs}/.."
includes="api-docs/**"/>
<!-- Copy distribution build files -->
<copy
tofile="${dir.dist}/jets3t-${version}/build.xml"
file="dist-build.xml"/>
<copy
tofile="${dir.dist}/jets3t-${version}/build.properties"
file="dist-build.properties"/>
<replace
file="${dir.dist}/jets3t-${version}/build.properties"
token="{jets3t-version}" value="${version}"/>
<!-- Copy servlet configuration files to enable redistribution -->
<copy
todir="${dir.dist}/jets3t-${version}/servlets"
file="${dir.servlet}/gatekeeper-web.xml"/>
<!-- Copy text file notices etc -->
<copy
todir="${dir.dist}/jets3t-${version}">
<fileset dir="." includes="*.txt"/>
</copy>
<!-- Create zip archive -->
<zip destfile="${dir.dist}/jets3t-${version}.zip"
basedir="${dir.dist}"
includes="jets3t-${version}/**"/>
</target>
<target name="package-applets" depends="package-applet-cockpit,package-applet-cockpitlite,package-applet-uploader">
</target>
<target name="sign-jars" depends="dist">
<mkdir dir="${dir.dist-applets}"/>
<!-- Copy jars required by all applets -->
<copy
todir="${dir.dist-applets}"
flatten="true"
>
<fileset dir="${dir.dist}/jets3t-${version}/jars">
<include name="**/${dist.file.service}"/>
<include name="**/${dist.file.guisupport}"/>
</fileset>
</copy>
<copy
todir="${dir.dist-applets}"
flatten="true"
>
<fileset dir="${dir.libs}">
<include name="**/commons-logging/*.jar"/>
<include name="**/commons-codec/*.jar"/>
<include name="**/commons-httpclient/*.jar"/>
<include name="**/bouncycastle/*.jar"/>
</fileset>
</copy>
<!-- Sign jars -->
<signjar
alias="${keystore.alias}"
keystore="${keystore.file}"
storepass="${keystore.storepass}"
keypass="${keystore.keypass}"
lazy="true"
>
<fileset dir="${dir.dist-applets}" includes="*.jar"/>
</signjar>
</target>
<target name="package-applet-cockpit" depends="sign-jars">
<!-- Copy jars required by Cockpit applet -->
<copy
todir="${dir.dist-applets}"
flatten="true"
>
<fileset dir="${dir.dist}/jets3t-${version}/jars">
<include name="**/${dist.file.cockpit}"/>
</fileset>
</copy>
<!-- Copy relevant configuration files -->
<copy todir="${dir.dist-applets}">
<fileset dir="${dir.configs}">
<include name="jets3t.properties"/>
<include name="mime.types"/>
</fileset>
</copy>
<copy todir="${dir.dist-applets}">
<fileset dir="${dir.applet}">
<include name="commons-logging.properties"/>
<include name="simplelog.properties"/>
</fileset>
</copy>
<!-- Copy applet running HTML files -->
<copy todir="${dir.dist-applets}">
<fileset dir="${dir.applet}">
<exclude name="*cockpit*lite*"/>
<include name="*cockpit*"/>
</fileset>
</copy>
<replace dir="${dir.dist-applets}"
token="{jets3t-version}" value="${version}"/>
<!-- Copy resources -->
<copy todir="${dir.dist-applets}">
<fileset dir="${dir.resources}" includes="**"/>
</copy>
<!-- Sign jars -->
<signjar
alias="${keystore.alias}"
keystore="${keystore.file}"
storepass="${keystore.storepass}"
keypass="${keystore.keypass}"
lazy="true"
>
<fileset dir="${dir.dist-applets}">
<include name="${dist.file.cockpit}"/>
</fileset>
</signjar>
</target>
<target name="package-applet-cockpitlite" depends="sign-jars">
<!-- Copy jars required by CockpitLite applet -->
<copy
todir="${dir.dist-applets}"
flatten="true"
>
<fileset dir="${dir.dist}/jets3t-${version}/jars">
<include name="**/${dist.file.cockpitlite}"/>
<include name="**/${dist.file.guisupport}"/>
</fileset>
</copy>
<!-- Copy relevant configuration files -->
<copy todir="${dir.dist-applets}">
<fileset dir="${dir.configs}">
<include name="jets3t.properties"/>
<include name="mime.types"/>
<include name="cockpit-lite.properties"/>
</fileset>
</copy>
<copy todir="${dir.dist-applets}">
<fileset dir="${dir.applet}">
<include name="commons-logging.properties"/>
<include name="simplelog.properties"/>
</fileset>
</copy>
<!-- Copy applet running HTML files -->
<copy todir="${dir.dist-applets}">
<fileset dir="${dir.applet}">
<include name="*cockpit*lite*"/>
</fileset>
</copy>
<replace dir="${dir.dist-applets}"
token="{jets3t-version}" value="${version}"/>
<!-- Copy resources -->
<copy todir="${dir.dist-applets}">
<fileset dir="${dir.resources}" includes="**"/>
</copy>
<!-- Sign jars -->
<signjar
alias="${keystore.alias}"
keystore="${keystore.file}"
storepass="${keystore.storepass}"
keypass="${keystore.keypass}"
lazy="true"
>
<fileset dir="${dir.dist-applets}">
<include name="${dist.file.cockpitlite}"/>
</fileset>
</signjar>
</target>
<target name="package-applet-uploader" depends="sign-jars">
<!-- Copy jars required by Uploader applet -->
<copy
todir="${dir.dist-applets}"
flatten="true"
>
<fileset dir="${dir.dist}/jets3t-${version}/jars">
<include name="**/${dist.file.uploader}"/>
</fileset>
</copy>
<!-- Copy relevant configuration files -->
<copy todir="${dir.dist-applets}">
<fileset dir="${dir.configs}">
<include name="jets3t.properties"/>
<include name="mime.types"/>
<include name="uploader.properties"/>
<include name="cockpitlite.properties"/>
</fileset>
</copy>
<copy todir="${dir.dist-applets}">
<fileset dir="${dir.applet}">
<include name="commons-logging.properties"/>
<include name="simplelog.properties"/>
</fileset>
</copy>
<!-- Copy applet running HTML files -->
<copy todir="${dir.dist-applets}">
<fileset dir="${dir.applet}">
<include name="*uploader*"/>
</fileset>
</copy>
<replace dir="${dir.dist-applets}"
token="{jets3t-version}" value="${version}"/>
<!-- Copy resources -->
<copy todir="${dir.dist-applets}">
<fileset dir="${dir.resources}" includes="**"/>
</copy>
<!-- Sign jars -->
<signjar
alias="${keystore.alias}"
keystore="${keystore.file}"
storepass="${keystore.storepass}"
keypass="${keystore.keypass}"
lazy="true"
>
<fileset dir="${dir.dist-applets}">
<include name="${dist.file.uploader}"/>
</fileset>
</signjar>
</target>
<target name="website" depends="package">
<!-- Copy applets directory to website -->
<mkdir dir="${dir.website}/applets-jets3t-${version}"/>
<copy
todir="${dir.website}/applets-jets3t-${version}">
<fileset dir="${dir.dist-applets}"/>
</copy>
<!-- Copy Release Notes document to website directory -->
<copy
todir="${dir.website}">
<fileset dir="." includes="RELEASE_NOTES.txt"/>
</copy>
<!-- Copy API documentation to website -->
<mkdir dir="${dir.website}/api"/>
<copy
todir="${dir.website}/api">
<fileset dir="${dir.apidocs}" includes="**/*.htm*"/>
</copy>
</target>
<target name="clean">
<delete dir="${dir.build}"/>
<delete dir="${dir.dist}"/>
</target>
<target name="api-docs">
<mkdir dir="${dir.apidocs}"/>
<javadoc
author="false"
version="true"
destdir="${dir.apidocs}"
windowtitle="JetS3t API : Amazon S3 Toolkit">
<classpath refid="classpath"/>
<fileset
dir="${dir.src}"
includes="**/*.java"
excludes="**/mir/**"/>
</javadoc>
</target>
<target name="junit-tests">
<junit>
<classpath refid="classpath"/>
<fileset
dir="${dir.src}/org/jets3t/tests"
includes="**/*.java"/>
</junit>
</target>
<target name="wsdl2java">
<java classname="org.apache.axis.wsdl.WSDL2Java">
<classpath refid="classpath"/>
<arg value="--package"/>
<arg value="org.jets3t.service.impl.soap.axis._2006_03_01"/>
<arg value="--output"/>
<arg value="${dir.src}"/>
<arg value="wsdl/AmazonS3.wsdl"/>
</java>
</target>
<target name="runFakeS3Server" depends="compile">
<java classname="org.jets3t.tests.FakeS3Server" fork="true">
<jvmarg line="-Djavax.net.ssl.keyStore=${keystore.file}"/>
<jvmarg line="-Djavax.net.ssl.keyStorePassword=${keystore.storepass}"/>
<classpath>
<fileset dir="${dir.libs}" includes="**/*.jar"/>
<path path="${dir.build}" />
</classpath>
</java>
</target>
<target name="runCockpitToFakeS3Server" depends="compile">
<java classname="org.jets3t.apps.cockpit.Cockpit" fork="true">
<jvmarg line="-Djavax.net.ssl.trustStore=${keystore.file}"/>
<jvmarg line="-Djavax.net.ssl.trustStorePassword=${keystore.storepass}"/>
<classpath>
<fileset dir="${dir.libs}" includes="**/*.jar"/>
<path path="${dir.build}" />
<path path="${dir.resources}" />
<path path="${dir.configs}" />
</classpath>
</java>
</target>
</project>