File: build.xml

package info (click to toggle)
jets3t 0.7.4+dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 5,572 kB
  • ctags: 4,635
  • sloc: java: 36,486; xml: 433; sh: 214; makefile: 26
file content (484 lines) | stat: -rw-r--r-- 15,195 bytes parent folder | download
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
<?xml version="1.0"?>
<!-- ====================================================================== 
     JetS3t    
     Toolkit and application suite for Amazon's S3 online storage service.
                   
     James Murty                                                                
     ====================================================================== -->
<project name="JetS3t" default="help">
    <description>
    		JetS3t : Toolkit and application suite for Amazon's S3 online storage service
    </description>
	
	<property file="build.properties"/>
	
	<target name="help">
		<echo>
Welcome to the JetS3t ANT build script.
			
The build.xml script will allow you to rebuild the JetS3t suite 
from the source code included with the distribution. It should 
make it easier to make your own additions to the library, to 
build your own versions of applications or applets, and to make
JetS3t work the way you want.
			
The first thing you may want to do is recompile JetS3t using 
the latest version of Java. To do this, modify the debug and 
build.target properties in the build.properties file and run 
the "rebuild-all" target.
			
			
ANT TARGET DESCRIPTIONS
			
rebuild-all : Rebuild the JetS3t Jar files for the library and
              all applications.
compile     : Compiles the JetS3t source code, but does not 
              produce Jar files. This target is useful as a 
              quick test to make sure any code changes you make
              will compile correctly.
clean       : Removes all the temporary compile/build artifacts
			  
help        : Displays this help message

rebuild-service     : Rebuild the library/toolkit files
rebuild-cockpit     : Rebuild the Cockpit application
rebuild-synchronize : Rebuild the Synchronize application
rebuild-gatekeeper  : Rebuild the Gatekeeper servlet WAR
rebuild-uploader    : Rebuild the Uploader application
rebuild-cockpitlite : Rebuild the CockpitLite application
			
repackage-applets   : Repackages all the applet applications. 
                      This replaces the contents of the applets
                      directory with applets built from the 
                      latest code, and signed with the keystore 
                      configured in the build.properties file.
repackage-applet-cockpit     : Repackage the Cockpit applet
repackage-applet-cockpitlite : Repackage the CockpitLite applet
repackage-applet-uploader    : Repackage the Uploader applet
			
init              : Sets dynamic properties required by the 
                    build script.
unzip-source-code : Unzips the JetS3t source code from src.zip.
                    This target will be called automatically if 
                    necessary.
zip-source-code   : Zips the JetS3t source code to an archive file with a 
			        version number: jets3t-src-${version}.zip
</echo>
	</target>

	<!-- ================================= 
         Define the script-wide classpath.
         ================================= -->
	<path id="classpath">
		<fileset dir="/" includesfile="debian/classpath-debian"/>
		<fileset dir="jars" includes="${dist.file.thirdparty}"/>
	</path>
	
	
    <target name="rebuild-all" 
    	depends="rebuild-thirdparty,rebuild-service,rebuild-cockpit,rebuild-cockpitlite,rebuild-synchronize,rebuild-uploader,rebuild-gatekeeper"/>
	
	<target name="unzip-source-code" unless="src-unzipped">
		<!--<unzip dest="." src="src.zip" overwrite="false"/>-->
	</target>
	
	<target name="zip-source-code">
		<zip 
			destfile="jets3t-src-${version}.zip"
			basedir="."
			includes="${dir.src}/**/*.java"/>
	</target>

	<target name="init">
		<available property="src-unzipped" file="${dir.src}"/>
		<available property="keystore-exists" file="${keystore.file}"/>
	</target>
	
	<target name="compile" depends="init,unzip-source-code">		
		<mkdir dir="${dir.build}"/>
		<javac 
			srcdir="${dir.src}"
			destdir="${dir.build}"
			debug="${debug}"
			source="1.4"
			target="${build.target}">
			<classpath refid="classpath"/>
			<exclude name="contribs/mx/**" unless="contribs.include-mx"/>
		</javac>
	</target>

	<target name="compile-thirdparty" depends="init,unzip-source-code">		
		<mkdir dir="${dir.build}"/>
		<javac 
			srcdir="${dir.src}"
			destdir="${dir.build}"
			debug="${debug}"
			source="1.4"
			target="${build.target}">
			<classpath refid="classpath"/>
			<exclude name="contribs/**"/>
			<exclude name="org/**"/>
			<exclude name="S3PostFormBuilder.java"/>
		</javac>
	</target>
		
	<target name="rebuild-service" depends="compile">
		<jar
			basedir="${dir.build}"			
			file="jars/${dist.file.service}"
            index="true"
			>
			<include name="org/jets3t/service/**"/>
			<include name="org/apache/commons/httpclient/contrib/**"/>
			<include name="com/jamesmurty/utils/**"/>
			<include name="com/centerkey/utils/**"/>
			<include name="contribs/mx/**" if="contribs.include-mx"/>
			<manifest>
				<attribute name="Class-Path" value="axis.jar commons-codec.jar commons-httpclient.jar commons-logging.jar bcprov.jar"/>
			</manifest>
		</jar>
        <jar
            basedir="${dir.build}"
            file="jars/${dist.file.guisupport}"
            index="true"
            >
            <include name="org/jets3t/gui/**"/>
            <include name="org/jets3t/gui/skins/**"/>
        </jar>
	</target>

    <target name="rebuild-cockpit" depends="rebuild-service">
		<jar
			basedir="${dir.build}"			
			file="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="rebuild-cockpitlite" depends="rebuild-service">
        <jar
            basedir="${dir.build}"
            file="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="rebuild-synchronize" depends="rebuild-service">
		<jar
			basedir="${dir.build}"			
			file="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="rebuild-uploader" depends="rebuild-service">
		<jar
			basedir="${dir.build}"			
			file="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="rebuild-thirdparty" depends="compile-thirdparty">
		<jar
			basedir="${dir.build}"			
			file="jars/${dist.file.thirdparty}"
            index="true"
			>
			<include name="net/iharder/**"/>
			<include name="com/jamesmurty/**"/>
		</jar>
	</target>
	
	<target name="rebuild-gatekeeper" depends="rebuild-service">
		<war 
			destfile="servlets/gatekeeper/${dist.file.gatekeeper}"
			webxml="${dir.servlets}/gatekeeper-web.xml"
			>
			
			<lib dir="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.configs}">
                <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="create-keystore" unless="keystore-exists">
		<echo>
Keystore file ${keystore.file} does not exist. The build script will now create
a generic keystore on your behalf for development and testing purposes. If you
intend to make the applets publicly available, please create a keystore with
proper information and modify the keystore settings in build.properties
to refer to this official keystore.
		</echo>
		<genkey
			alias="${keystore.alias}"
			storepass="${keystore.storepass}"
			keystore="${keystore.file}"
			keypass="${keystore.keypass}"
			dname="CN=Unknown Developer, OU=, O=, C="
			validity="30"
			verbose="true">			
		</genkey>
	</target>

    <target name="repackage-applets" depends="repackage-applet-cockpit,repackage-applet-cockpitlite,repackage-applet-uploader">
	</target>
		
    <target name="sign-jars" depends="init,rebuild-all,create-keystore">
		<mkdir dir="${dir.applets}"/>
		
        <!-- Copy jars required by all applets -->
		<copy 			
			todir="${dir.applets}"
			flatten="true"
			>
			<fileset dir="jars">
				<include name="**/${dist.file.service}"/>
				<include name="**/${dist.file.guisupport}"/>
			</fileset>
		</copy>
		<copy 			
			todir="${dir.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.applets}" includes="*.jar"/>
		</signjar>
    </target>
		
    <target name="repackage-applet-cockpit" depends="sign-jars">

        <!-- Copy jars required by Cockpit applet -->
        <copy
            todir="${dir.applets}"
            flatten="true"
            >
            <fileset dir="jars">
                <include name="**/${dist.file.cockpit}"/>
            </fileset>
        </copy>

		<!-- Copy relevant configuration files -->
		<copy todir="${dir.applets}">
			<fileset dir="${dir.configs}">
				<include name="jets3t.properties"/>
				<include name="mime.types"/>
			</fileset>
		</copy>
		<copy todir="${dir.applets}">
			<fileset dir="${dir.applets}">
				<include name="commons-logging.properties"/>
				<include name="simplelog.properties"/>
			</fileset>
		</copy>

		<!-- Copy applet running HTML files -->
		<copy todir="${dir.applets}">
            <fileset dir="${dir.applets}">
                <exclude name="*cockpit*lite*"/>
                <include name="*cockpit*"/>
            </fileset>
		</copy>
    	
		<!-- Copy resources -->
		<copy todir="${dir.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.applets}">
                <include name="${dist.file.cockpit}"/>
            </fileset>
        </signjar>
	</target>
		
    <target name="repackage-applet-cockpitlite" depends="sign-jars">
		
        <!-- Copy jars required by CockpitLite applet -->
		<copy 			
			todir="${dir.applets}"
			flatten="true"
			>
			<fileset dir="jars">
                <include name="**/${dist.file.cockpitlite}"/>
                <include name="**/${dist.file.guisupport}"/>
			</fileset>
		</copy>

        <!-- Copy relevant configuration files -->
        <copy todir="${dir.applets}">
            <fileset dir="${dir.configs}">
                <include name="jets3t.properties"/>
                <include name="mime.types"/>
                <include name="cockpit-lite.properties"/>
			</fileset>
		</copy>
        <copy todir="${dir.applets}">
            <fileset dir="${dir.applets}">
                <include name="commons-logging.properties"/>
                <include name="simplelog.properties"/>
            </fileset>
        </copy>

        <!-- Copy applet running HTML files -->
        <copy todir="${dir.applets}">
            <fileset dir="${dir.applets}">
                <include name="*cockpit*lite*"/>
            </fileset>
        </copy>
    	
		<!-- Copy resources -->
		<copy todir="${dir.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.applets}">
                <include name="${dist.file.cockpitlite}"/>
            </fileset>
		</signjar>
    </target>
		
    <target name="repackage-applet-uploader" depends="sign-jars">

        <!-- Copy jars required by Uploader applet -->
        <copy
            todir="${dir.applets}"
            flatten="true"
            >
            <fileset dir="jars">
                <include name="**/${dist.file.uploader}"/>
            </fileset>
        </copy>

		<!-- Copy relevant configuration files -->
		<copy todir="${dir.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.applets}">
			<fileset dir="${dir.applets}">
				<include name="commons-logging.properties"/>
				<include name="simplelog.properties"/>
			</fileset>
		</copy>

		<!-- Copy applet running HTML files -->
		<copy todir="${dir.applets}">
            <fileset dir="${dir.applets}">
                <include name="*uploader*"/>
            </fileset>
		</copy>
    	
		<!-- Copy resources -->
		<copy todir="${dir.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.applets}">
                <include name="${dist.file.uploader}"/>
            </fileset>
        </signjar>
	</target>


	<target name="clean">
		<delete dir="${dir.build}"/>
	</target>
	
	<target name="javadoc" depends="compile">
		<mkdir dir="${dir.build}/api"/>
		<javadoc
			destdir="${dir.build}/api"
			classpathref="classpath"
			access="public"
			defaultexcludes="yes">
			<packageset dir="src">
				<include name="**"/>
				<exclude name="com/**"/>
				<exclude name="net/**"/>
			</packageset>
			<link href="/usr/share/doc/default-jdk-doc/api/"
				packagelistLoc="/usr/share/doc/default-jdk-doc/api/package-list"/>
		</javadoc>
	</target>

</project>