/
build.xml
474 lines (402 loc) · 18.6 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
<project name="GalleryRemote" default="compile" basedir=".">
<description>
A part of the Gallery project
</description>
<!-- set global properties for this build -->
<property file="build.properties" />
<property name="src" location="."/>
<property name="build" location="build"/>
<property name="lib" location="lib"/>
<property name="img" location="img"/>
<property name="dist" location="dist"/>
<property name="install" location="gallery_remote_Build_Output/Web_Installers/InstData"/>
<!-- define the following properties in build.properties:
iafolder: the folder where the InstallAnywhere executable is located
nsis.path: the folder where NSIS (the Nullsoft Installer System) is located
docbase: the Gallery docs CVS directory (obsolete)
debug.params: optional debug parameters for the screensaver debug -->
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
</target>
<target name="compile" depends="init"
description="compile the source">
<!-- Compile the java code from ${src} into ${build} -->
<javac srcdir="${src}" destdir="${build}"
includes="com/**,HTTPClient/**,edu/**"
listfiles="on" debug="on" source="1.3">
<classpath>
<pathelement location="lib/AppleJavaExtensions.jar"/>
<pathelement location="lib/metadata-extractor-2.1.jar"/>
<pathelement location="lib/saverbeans-api.jar"/>
</classpath>
</javac>
<!-- other files needed -->
<copy file="${src}/rar_about_gr1.png" todir="${build}"/>
<copy file="${src}/rar_icon_32.gif" todir="${build}"/>
<copy file="${src}/rar_icon_16.gif" todir="${build}"/>
<copy file="${src}/com/gallery/GalleryRemote/prefs/panes.properties" todir="${build}/com/gallery/GalleryRemote/prefs"/>
<copy todir="${build}/com/gallery/GalleryRemote/resources">
<fileset dir="${src}/com/gallery/GalleryRemote/resources"></fileset>
</copy>
</target>
<target name="run" depends="compile"
description="compile then run">
<java classname="com.gallery.GalleryRemote.GalleryRemote" fork="true">
<classpath>
<pathelement location="lib/metadata-extractor-2.1.jar"/>
<pathelement path="${build}"/>
<pathelement path="img"/>
</classpath>
</java>
</target>
<target name="jar" depends="clean,compile"
description="create a jar of the source">
<delete file="GalleryRemote.jar" />
<jar destfile="GalleryRemote.jar">
<fileset dir="${build}" />
<fileset dir="." includes="*.properties" excludes="postchangelog.properties" />
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Main-Class" value="com.gallery.GalleryRemote.GalleryRemote" />
<attribute name="Class-Path" value="lib/metadata-extractor-2.1.jar img/" />
</manifest>
</jar>
<signjar jar="GalleryRemote.jar" alias="gallery" storepass="gallery" />
</target>
<!--target name="applet_jar" depends="clean,compile,mac_img_jar" description="create a jar for the applet version of GR"-->
<target name="applet_jar" depends="compile,applet_img_jar" description="create a jar for the applet version of GR">
<jar destfile="GalleryRemoteApplet.jar" index="true" >
<fileset dir="${build}" includesfile="AppletMiniExcludes.txt"/>
<fileset dir="." includes="*.properties" excludes="postchangelog.properties" />
<manifest>
<attribute name="Built-By" value="${user.name}"/>
</manifest>
</jar>
<signjar jar="GalleryRemoteApplet.jar" alias="gallery" storepass="gallery" />
</target>
<target name="applet_mini_jar" depends="compile" description="create a jar for the applet version of GR">
<delete file="GalleryRemoteAppletMini.jar" />
<jar destfile="GalleryRemoteAppletMini.jar" index="true" >
<fileset dir="${build}" excludes="HTTPClient/*" excludesfile="AppletMiniExcludes.txt" />
<fileset dir="." includes="*.properties" excludes="postchangelog.properties" />
<!--fileset dir="${img}" includes="computer.gif, uploading.gif" /-->
<manifest>
<attribute name="Built-By" value="${user.name}"/>
</manifest>
</jar>
<signjar jar="GalleryRemoteAppletMini.jar" alias="gallery" storepass="gallery" />
</target>
<target name="httpclient_jar" depends="compile" description="create a jar for the HTTP library">
<delete file="GalleryRemoteHTTPClient.jar" />
<jar destfile="GalleryRemoteHTTPClient.jar" index="true" >
<fileset dir="${build}" includes="HTTPClient/*" />
<manifest>
<attribute name="Built-By" value="${user.name}"/>
</manifest>
</jar>
<signjar jar="GalleryRemoteHTTPClient.jar" alias="gallery" storepass="gallery" />
</target>
<target name="zip" depends="jar"
description="create a zip patch of the Gallery Remote install">
<zip destfile="gallery_remote.zip">
<fileset dir="." includes="defaults.properties"/>
<fileset dir="." includes="ChangeLog"/>
<fileset dir="." includes="GalleryRemote.jar"/>
<fileset dir="." includes="ReadMe.html"/>
<zipfileset dir="./lib" includes="metadata-extractor-2.1.jar" prefix="lib"/>
<zipfileset dir="./img" includes="*" prefix="img"/>
<zipfileset dir="./com/gallery/GalleryRemote/resources" includes="GRResources.properties" prefix="img"/>
</zip>
</target>
<target name="applet_zip" depends="applet_mini_jar, applet_jar, httpclient_jar"
description="create a zip of the applets">
<zip destfile="gallery_remote_applets.zip">
<fileset dir="." includes="GalleryRemoteAppletMini.jar, GalleryRemoteApplet.jar, GalleryRemoteHTTPClient.jar, applet_img.jar" />
</zip>
</target>
<target name="testWin">
<condition property="onWin">
<os family="windows"/>
</condition>
</target>
<target name="clean"
description="clean up">
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
<target name="installer" depends="jar"
description="Build the installer">
<!--target name="installer"
description="Build the installer" -->
<taskdef name="buildinstaller" classname="com.zerog.ia.integration.ant.InstallAnywhereAntTask"
classpath="${iafolder}/resource/build/iaant.jar"/>
<buildinstaller IAProjectFile="${basedir}/gallery_remote.iap_xml" IALocation="${iafolder}"
BuildWindowsWithVM="true"
BuildWindowsWithoutVM="true"
BuildLinuxWithVM="true"
BuildLinuxWithoutVM="true"
BuildSolarisWithoutVM="true"
BuildMacOSX="true"
BuildPureJava="true"/>
</target>
<target name="img_jar"
description="create a jar of the images">
<!--copy file="imagemagick/macos/im.properties" tofile="${img}/im.properties"/>
<copy file="jpegtran/macos/jpegtran.properties" tofile="${img}/jpegtran.properties"/-->
<jar destfile="img.jar">
<fileset dir="${img}"/>
<fileset dir="." includes="rar_about_gr1.png"/>
</jar>
<!--delete file="${img}/im.properties"/>
<delete file="${img}/jpegtran.properties"/-->
<signjar jar="img.jar" alias="gallery" storepass="gallery" />
</target>
<target name="applet_img_jar"
description="create a jar of the images">
<copy file="imagemagick/im.properties.applet" tofile="${img}/im.properties" />
<copy file="jpegtran/jpegtran.properties.applet" tofile="${img}/jpegtran.properties" />
<jar destfile="applet_img.jar">
<fileset dir="${img}" />
</jar>
<delete file="${img}/im.properties" />
<delete file="${img}/jpegtran.properties" />
</target>
<target name="executable_macosx" depends="jar, img_jar"
description="Build a MacOSX executable">
<delete dir="Gallery Remote.app"/>
<property file="defaults.properties"/>
<taskdef name="jarbundler"
classpath="${lib}/jarbundler.jar"
classname="com.loomcom.ant.tasks.jarbundler.JarBundler"/>
<jarbundler dir="."
name="Gallery Remote"
mainclass="com.gallery.GalleryRemote.GalleryRemote"
icon="rar_icon_128_gr1.icns"
jars="./GalleryRemote.jar ${lib}/metadata-extractor-2.1.jar ./img.jar"
execs="./jpegtran/macos/jpegtran"
stubfile="${lib}/JavaApplicationStub"
workingdirectory="$APP_PACKAGE"
version="${version}"
infostring="Gallery Remote ${version}, (c) 2003"
aboutmenuname="Gallery Remote"
jvmversion="1.3+"/>
<copy file="imagemagick/macos/im.properties" tofile="Gallery Remote.app/imagemagick/im.properties" />
<copy file="jpegtran/macos/jpegtran.properties" tofile="Gallery Remote.app/jpegtran/jpegtran.properties" />
</target>
<target name="installer_macosx" depends="executable_macosx"
description="Build a MacOSX package">
<tar destfile="GalleryRemote.MacOSX.NoVM.tgz" compression="gzip">
<tarfileset dir="." prefix="Gallery Remote">
<include name="Gallery Remote.app/**"/>
<exclude name="Gallery Remote.app/Contents/MacOS/*"/>
</tarfileset>
<tarfileset dir="Gallery Remote.app/Contents/MacOS"
prefix="Gallery Remote/Gallery Remote.app/Contents/MacOS/"
mode="777">
<include name="*"/>
</tarfileset>
</tar>
</target>
<target name="upload"
description="Upload to SF.net">
<loadproperties srcfile="defaults.properties"/>
<move file="${install}/Windows/NoVM/InstallGalleryRemote.exe"
tofile="${install}/staging/GalleryRemote.${version}.Win32.NoVM.exe"/>
<move file="${install}/Windows/VM/InstallGalleryRemote.exe" tofile="${install}/staging/GalleryRemote.${version}.Win32.VM.exe"/>
<!--move file="${install}/MacOSX/InstallGalleryRemote.zip" tofile="${install}/staging/GalleryRemote.${version}.MacOSX.NoVM.zip"/-->
<move file="${install}/Linux/NoVM/InstallGalleryRemote.bin" tofile="${install}/staging/GalleryRemote.${version}.Linux.NoVM.bin"/>
<move file="${install}/Linux/VM/InstallGalleryRemote.bin" tofile="${install}/staging/GalleryRemote.${version}.Linux.VM.bin"/>
<move file="${install}/Solaris/NoVM/InstallGalleryRemote.bin" tofile="${install}/staging/GalleryRemote.${version}.Solaris.NoVM.bin"/>
<move file="${install}/GenericUnix/InstallGalleryRemote.bin" tofile="${install}/staging/GalleryRemote.${version}.Unix.NoVM.bin"/>
<move file="${install}/Java/InstallGalleryRemote.jar" tofile="${install}/staging/GalleryRemote.${version}.jar"/>
</target>
<target name="post" description="Posts ChangeLog to menalto.com">
<taskdef name="postchangelog"
classpath="GalleryRemote.jar"
classname="com.gallery.GalleryRemote.util.PostChangeLog"/>
<postchangelog/>
</target>
<target name="create_keystore" description="Creates a self-signed certificate">
<exec executable="keytool">
<arg line="-genkey -keyalg RSA -alias gallery -dname "CN=gallery.sourceforge.net, OU=Gallery, O=Gallery, L=Menlo Park, ST=California, C=US" -keypass gallery -storepass gallery" />
</exec>
</target>
<target name="make_csr" description="Create a Certificate Signing Request from a self-signed certificate">
<exec executable="keytool">
<arg line="-certreq -alias gallery -keyalg RSA -keypass gallery -storepass gallery -file gallery.csr" />
</exec>
</target>
<target name="nightly" depends="zip, installer_macosx, applet_zip"
description="Run all the tasks for a nightly build" />
<!-- SaverBeans screensaver -->
<target name="sbproperties">
<property file="defaults.properties"/>
<property name="sbbuild" value="build/sb" />
<property name="screensaver" value="Gallery" />
<property name="screensaverez" value="Gallery" />
<property name="screensavershort" value="gallery" />
<property name="screensavershortfull" value="gallery_screensaver" />
<property name="screensaver.class"
value="com.gallery.GalleryRemote.GRScreenSaver" />
<!-- Values for the Windows installer -->
<property name="productName" value="Gallery Remote Screensaver" />
<property name="productVersion" value="${version}" />
<property name="productPublisher" value="The Gallery project" />
<property name="productWebSite" value="http://gallery.sf.net/" />
</target>
<target name="sbcheck-nsis" description="Check if NSIS is present">
<fail unless="nsis.path">
Property nsis.path not found. Please copy
build.properties.sample to build.properties and
follow the instructions in that file.
</fail>
<available file="${nsis.path}" property="nsis.present" />
<fail unless="nsis.present">
Property nsis.path is invalid. Please set
it to the installation path of NSIS.
</fail>
</target>
<target name="sbdefine" description="Define custom tasks">
<taskdef name="foreachscreensaver"
classname="org.jdesktop.jdic.screensaver.autogen.ForEachScreensaver"
classpath="lib/saverbeans-ant.jar" />
<taskdef name="makewin32installscript"
classname="org.jdesktop.jdic.screensaver.autogen.NsiGeneratorTask"
classpath="lib/saverbeans-ant.jar" />
</target>
<target name="sbinit" depends="sbproperties,sbdefine" />
<target name="sbcompile" depends="sbinit,compile" description="Compile the screensaver">
<copy file="imagemagick/im.properties.applet" tofile="${img}/im.properties" />
<copy file="jpegtran/jpegtran.properties.applet" tofile="${img}/jpegtran.properties" />
<jar destfile="GalleryRemoteScreenSaver.jar" index="true" >
<fileset dir="${build}" excludesfile="ScreenSaverExcludes.txt" />
<fileset dir="." includes="*.properties" excludes="postchangelog.properties" />
<fileset dir="${img}" includes="default.gif,im.properties,jpegtran.properties" />
<manifest>
<attribute name="Built-By" value="${user.name}"/>
</manifest>
</jar>
<delete file="${img}/im.properties" />
<delete file="${img}/jpegtran.properties" />
<!-- Generate Makefile and Unix source distribution for each -->
<mkdir dir="${sbbuild}/unix" />
<foreachscreensaver confDir="${src}/sbconf" outDir="${sbbuild}/unix"
os="unix" />
<!-- Generate Windows .scr and binary distribution for each -->
<mkdir dir="${sbbuild}/win32" />
<foreachscreensaver confDir="${src}/sbconf" outDir="${sbbuild}/win32"
os="win32" />
</target>
<!-- Create screensaver distribution -->
<target name="sbdist" depends="sbcompile">
<!-- Create distribution for win32: -->
<mkdir dir="${dist}/${screensavershort}-win32" />
<copy todir="${dist}/${screensavershort}-win32">
<fileset dir="lib">
<include name="saverbeans-api.jar" />
</fileset>
<fileset dir=".">
<include name="GalleryRemoteScreenSaver.jar" />
</fileset>
<fileset dir="${sbbuild}/win32">
<include name="*.scr" />
</fileset>
<fileset dir="${basedir}">
<include name="COPYING" />
</fileset>
<!--fileset dir="${src}/doc/win32">
<include name="README.txt" />
</fileset-->
</copy>
<zip destfile="${dist}/${screensavershort}-win32.zip" basedir="${dist}"
includes="${screensavershort}-win32/**" />
<!-- Create distribution for Unix: -->
<mkdir dir="${dist}/${screensavershortfull}.${version}.Unix" />
<copy todir="${dist}/${screensavershortfull}.${version}.Unix">
<fileset dir="lib">
<include name="saverbeans-api.jar" />
</fileset>
<fileset dir=".">
<include name="GalleryRemoteScreenSaver.jar" />
</fileset>
<fileset dir="${src}/sbconf">
<include name="*.xml" />
</fileset>
<fileset dir="${sbbuild}/unix" />
<fileset dir="${basedir}">
<include name="COPYING" />
</fileset>
<!--fileset dir="${src}/doc/unix">
<include name="README.txt" />
</fileset-->
</copy>
<zip destfile="${dist}/${screensavershortfull}.${version}.Unix.zip" basedir="${dist}"
includes="${screensavershortfull}.${version}.Unix/**" />
</target>
<target name="sbwin32-installer" depends="sbinit,sbcheck-nsis,sbdist">
<mkdir dir="${sbbuild}/win32-installer" />
<makewin32installscript
productName="${productName}"
productVersion="${productVersion}"
productPublisher="${productPublisher}"
productWebSite="${productWebSite}"
licenseFile="${basedir}/LICENSE"
outputFilename="${screensavershortfull}.${version}.exe"
saverbeansSdkPath="lib"
outFile="${dist}/${screensavershort}.nsi"
jarDir="${basedir}"
scrDir="${sbbuild}/win32"
>
<fileset dir="${src}/sbconf" includes="*.xml" />
</makewin32installscript>
<!-- Launch makensis on script to create the installer -->
<exec executable="${nsis.path}/makensis.exe" failonerror="true">
<arg line="${dist}/${screensavershort}.nsi" />
</exec>
</target>
<!--
- Compile and debug screensaver in a JFrame.
- Can optionally attach to process using your Java IDE. Change
- to suspend=y if you need to debug before the first frame.
- Use the port number that the JVM gives you.
-->
<target name="sbdebug" depends="sbcompile">
<java classname="org.jdesktop.jdic.screensaver.ScreensaverFrame"
fork="true">
<classpath>
<pathelement location="GalleryRemoteScreenSaver.jar" />
<pathelement location="lib/saverbeans-api.jar" />
</classpath>
<!--jvmarg value="-Xdebug" />
<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005" /-->
<arg value="${screensaver.class}" />
<arg line="${debug.params}" />
</java>
</target>
<target name="slideshowtest" depends="compile">
<java classname="com.gallery.GalleryRemote.DummyAppletContext" fork="true">
<classpath>
<pathelement location="lib/metadata-extractor-2.1.jar"/>
<pathelement path="${build}"/>
<pathelement path="img"/>
</classpath>
<arg line="com.gallery.GalleryRemote.GRAppletSlideshow -width 300 -height 450 gr_url http://www.paour.com/gallery2/ gr_gallery_version 2 gr_album 100401" />
</java>
</target>
<target name="install_applets" depends="applet_jar, applet_mini_jar, httpclient_jar, applet_img_jar">
<copy file="GalleryRemoteHTTPClient.jar" tofile="../gallery/java/GalleryRemoteHTTPClient.jar"/>
<copy file="GalleryRemoteAppletMini.jar" tofile="../gallery/java/GalleryRemoteAppletMini.jar"/>
<copy file="GalleryRemoteApplet.jar" tofile="../gallery/java/GalleryRemoteApplet.jar"/>
<copy file="applet_img.jar" tofile="../gallery/java/applet_img.jar"/>
<copy file="GalleryRemoteHTTPClient.jar" tofile="../gallery2/modules/uploadapplet/applets/GalleryRemoteHTTPClient.jar"/>
<copy file="GalleryRemoteAppletMini.jar" tofile="../gallery2/modules/uploadapplet/applets/GalleryRemoteAppletMini.jar"/>
<copy file="applet_img.jar" tofile="../gallery2/modules/uploadapplet/applets/applet_img.jar"/>
<copy file="GalleryRemoteHTTPClient.jar" tofile="../gallery2/modules/slideshowapplet/applets/GalleryRemoteHTTPClient.jar"/>
<copy file="GalleryRemoteAppletMini.jar" tofile="../gallery2/modules/slideshowapplet/applets/GalleryRemoteAppletMini.jar"/>
<copy file="applet_img.jar" tofile="../gallery2/modules/slideshowapplet/applets/applet_img.jar"/>
</target>
</project>