cyberfox / jbidwatcher

The official home of JBidwatcher's source code, an eBay auction sniping, bidding & monitoring software application.

This URL has Read+Write access

cyberfox (author)
Sun Aug 24 13:28:28 -0700 2008
commit  3970aff139c629dc11f9f74919d1cfbc9da1a302
tree    18cc673a95075a4a80cca24e38fccc7feb83df02
parent  ce8309ba337d9fa1fe9b4cc252fde69f3e55f7da
jbidwatcher / build.xml
100644 359 lines (324 sloc) 16.118 kb
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
<?xml version="1.0" encoding="UTF-8"?>
<project name="JBidwatcher" default="apps" basedir='.'>
<!-- Since properties are inmutable, the first definition of a properties is used! -->
  <!-- Read computers environment -->
  <property environment="env" />
 
  <property name="build.dir" value="classes" />
  <property name="src.dir" value="src" />
  <property name="dest.dir" value="." />
  <property name="main.dir" value="." />
  <property name="log.dir" value="logs" />
  <property name="lib.dir" value="lib" />
  <property name="JAVADIR" value="src" />
 
  <property name="app.name" value="JBidwatcher" />
  <property name="VER" value="2.0beta7" />
  <property name="TARSRC" value="jbidwatcher-${VER}" />
  <property name="INTERMEDIATE" value="${app.name}.jar" />
  <property name="BINARY" value="${app.name}-${VER}.jar" />
  <property name="BINARYSCRIPTING" value="${app.name}-${VER}-script.jar" />
  <property name="OPT_BIN" value="${app.name}-${VER}_o.jar" />
  <property name="UNOPT_BIN" value="${app.name}-${VER}_u.jar" />
  <property name="TARFILE" value="${TARSRC}.tar.gz" />
  <property name="APPSCRIPTING" value="${app.name}-${VER}-script.app.tar.gz" />
  <property name="APPFILE" value="${app.name}-${VER}.app.tar.gz" />
  <property name="osx.app.name" value="${app.name}-${VER}.app" />
  <property name="osx.app.path" value="/tmp/building/${osx.app.name}" />
  <property name="DMGFILE" value="${app.name}-${VER}.dmg" />
  <property name="EXESCRIPTING" value="${app.name}-${VER}-script.exe" />
  <property name="EXEFILE" value="${app.name}-${VER}.exe" />
  <property name="MANIFEST" value="META-INF/MANIFEST.MF" />
 
  <property name="jopt.jar" value="${JAVADIR}/jopt/jopt.jar" />
  <!-- available file="${jopt.jar}" property="jopt.jar.present"/ -->
 
  <!-- Read any properties that are local to the used installation -->
  <!-- This file must not reside in the repository!!! -->
  <property file="build-local.properties" />
 
  <!-- Read properties that are special for this computer -->
  <!-- It could be placed in the repository -->
  <property file="build-${env.COMPUTERNAME}.properties" />
 
  <!-- Read properties that are special for this user -->
  <!-- It could be placed in the repository -->
  <property file="build-${env.USERNAME}.properties" />
 
  <path id="project.class.path">
    <pathelement path="${build.dir}" />
    <pathelement path="${src.dir}" />
    <pathelement path="${lib.dir}/apple.jar" />
    <pathelement path="${lib.dir}/derby.jar" />
    <pathelement path="${lib.dir}/jdesktop.jar" />
    <pathelement path="${lib.dir}/mp3codec.jar" />
    <pathelement path="${lib.dir}/jruby.jar" />
  </path>
 
  <target name="init" description="Prepare for build">
    <tstamp/>
    <mkdir dir="${build.dir}" />
    <mkdir dir="${log.dir}" />
  </target>
 
  <target name="compile" depends="init">
    <echo level="info" message="Compiling all classes." />
    <mkdir dir="${user.home}/.jbidwatcher" />
    <mkdir dir="${build.dir}" />
    <copy file="display.cfg" todir="${user.home}/.jbidwatcher" />
      <javac srcdir="${src.dir}" destdir="${build.dir}" debug="on" >
          <classpath refid="project.class.path" />
          <include name="**/*.java" />
      </javac>
  </target>
 
  <!--
<taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask"/>
rulesets/basic.xml
rulesets/design.xml
rulesets/imports.xml
rulesets/codesize.xml
rulesets/coupling.xml
rulesets/controversial.xml
rulesets/unusedcode.xml
 
rulesets/braces.xml
rulesets/favorites.xml
rulesets/finalizers.xml
rulesets/javabeans.xml
rulesets/junit.xml
rulesets/naming.xml
rulesets/newrules.xml
rulesets/scratchpad.xml
rulesets/strictexception.xml
rulesets/strings.xml
<target name="pmd">
<pmd rulesetfiles="rulesets/basic.xml,rulesets/design.xml,rulesets/imports.xml,rulesets/codesize.xml,rulesets/coupling.xml,rulesets/controversial.xml,rulesets/unusedcode.xml">
<formatter type="html" toFile="pmd_jbidwatcher.html"/>
<fileset dir="${src.dir}">
<include name="**/*.java"/>
</fileset>
</pmd>
</target>
-->
 
  <target name="whatsnew">
    <cvschangelog destfile="changelog.xml" start="31 March 2006">
      <user displayname="Morgan Schweers" userid="cyberfox"/>
    </cvschangelog>
    <style in="changelog.xml" out="changelog.html" style="/usr/share/ant/etc/changelog.xsl">
      <param name="title" expression="JBidwatcher Recent Changes" />
      <param name="module" expression="JBidwatcher" />
    </style>
  </target>
 
  <target name="tar" description="Building source .tar file.">
    <tar destfile="${TARFILE}" compression="gzip">
      <tarfileset prefix="${TARSRC}" dir="${src.dir}" includes="*.java" />
      <tarfileset prefix="${TARSRC}" dir="${main.dir}" includes="*.jpg" />
      <tarfileset prefix="${TARSRC}" dir="${main.dir}" includes="*.sql" />
      <tarfileset prefix="${TARSRC}" dir="${main.dir}" includes="*.ser" />
      <tarfileset prefix="${TARSRC}" dir="${main.dir}" includes="*.xsl" />
      <tarfileset prefix="${TARSRC}" dir="${user.home}/.jbidwatcher" includes="display.cfg" />
      <tarfileset prefix="${TARSRC}" dir="${main.dir}" includes="auctions.dtd" />
      <tarfileset prefix="${TARSRC}" dir="${main.dir}" includes="TODO" />
      <tarfileset prefix="${TARSRC}" dir="${main.dir}" includes="Makefile" />
      <tarfileset prefix="${TARSRC}" dir="${main.dir}" includes="build.xml" />
      <tarfileset prefix="${TARSRC}" dir="${main.dir}" includes="platform/jbidwatcher.jnlp" />
      <tarfileset prefix="${TARSRC}" dir="${main.dir}" includes="${MANIFEST}" />
      <tarfileset prefix="${TARSRC}" dir="${main.dir}" includes="jbidwatcher.properties" />
      <tarfileset prefix="${TARSRC}/icons" dir="${main.dir}/icons" includes="**/*.gif" />
      <tarfileset prefix="${TARSRC}/icons" dir="${main.dir}/icons" includes="**/*.png" />
      <tarfileset prefix="${TARSRC}/audio" dir="${main.dir}/audio" includes="*.mp3" />
      <tarfileset prefix="${TARSRC}/db" dir="${main.dir}/db" includes="*.sql" />
      <tarfileset prefix="${TARSRC}/platform" dir="${main.dir}/platform" />
      <tarfileset prefix="${TARSRC}/help" dir="${main.dir}/help" includes="*.jpg" />
      <tarfileset prefix="${TARSRC}/help" dir="${main.dir}/help" includes="*.jbh" />
      <tarfileset prefix="${TARSRC}/lib" dir="${main.dir}/lib" />
    </tar>
  </target>
 
  <target name="jar-real" depends="compile">
    <echo level="info" message="Building executable .jar file." />
    <jar jarfile="${INTERMEDIATE}" manifest="${MANIFEST}" index="true">
      <fileset dir="${main.dir}" includes="*.jpg" />
      <fileset dir="${main.dir}" includes="*.sql" />
      <fileset dir="${main.dir}" includes="*.ser" />
      <fileset dir="${main.dir}" includes="*.xsl" />
      <fileset dir="${user.home}/.jbidwatcher" includes="display.cfg" />
      <fileset dir="${build.dir}" includes="**/*.class" />
      <!-- <fileset dir="${lib.dir}" includes="**/*.class" /> -->
      <fileset dir="${main.dir}" includes="icons/**/*.gif" />
      <fileset dir="${main.dir}" includes="icons/**/*.png" />
      <fileset dir="${main.dir}" includes="audio/*.mp3" />
      <fileset dir="${main.dir}" includes="db/*.sql" />
      <fileset dir="${main.dir}" includes="help/*.jpg" />
      <fileset dir="${main.dir}" includes="help/*.jbh" />
      <fileset dir="${main.dir}" includes="platform/tray.dll" />
      <fileset dir="${main.dir}" includes="jbidwatcher.properties" />
    </jar>
  </target>
 
  <target name="jar" depends="jar-real">
    <echo level="info" message="Building the top-level .jar file." />
    <mkdir dir="/tmp/building/main" />
    <copy file="${INTERMEDIATE}" tofile="/tmp/building/main/main.jar" />
    <jar jarfile="${BINARY}" manifest="onejar/META-INF/MANIFEST.MF">
      <fileset dir="${main.dir}/onejar" includes="com/**" />
      <fileset dir="${main.dir}/onejar" includes="boot-manifest.mf" />
      <fileset dir="/tmp/building" includes="main/main.jar" />
      <fileset dir="${main.dir}" includes="lib/apple.jar" />
      <fileset dir="${main.dir}" includes="lib/derby.jar" />
      <fileset dir="${main.dir}" includes="lib/jdesktop.jar" />
      <fileset dir="${main.dir}" includes="lib/mp3codec.jar" />
    </jar>
    <delete dir="/tmp/building/main" />
  </target>
 
  <target name="scripting-jar" depends="jar-real">
    <echo level="info" message="Building the top-level .jar file." />
    <mkdir dir="/tmp/building/main" />
    <copy file="${INTERMEDIATE}" tofile="/tmp/building/main/main.jar" />
    <jar jarfile="${BINARY}" manifest="onejar/META-INF/MANIFEST.MF">
      <fileset dir="${main.dir}/onejar" includes="com/**" />
      <fileset dir="${main.dir}/onejar" includes="boot-manifest.mf" />
      <fileset dir="/tmp/building" includes="main/main.jar" />
      <fileset dir="${main.dir}" includes="lib/*.jar" />
      <fileset dir="${main.dir}" includes="lib/ruby/**" />
    </jar>
    <delete dir="/tmp/building/main" />
  </target>
 
  <property name="packaging" value="platform" />
 
  <target name="scripting" depends="scripting-jar">
    <copy file="${BINARY}" tofile="${BINARYSCRIPTING}" />
    <antcall target="exe-real" />
    <move file="${EXEFILE}" tofile="${EXESCRIPTING}" />
  </target>
 
  <target name="exe" depends="jar">
    <antcall target="exe-real" />
  </target>
 
  <target name="exe-real">
    <copy file="${BINARY}" todir="/tmp"/>
    <copy file="${packaging}/jbidwatcher.ico" todir="/tmp"/>
    <copy file="${packaging}/jbidwatcher-launch.xml" todir="/tmp">
      <filterchain>
        <replacetokens begintoken="`" endtoken="`">
          <token key="binary" value="${BINARY}"/>
          <token key="executable" value="${EXEFILE}"/>
<token key="appname" value="${app.name}" />
        </replacetokens>
      </filterchain>
    </copy>
    <exec executable="launch4j" failonerror="true">
      <arg line="/tmp/jbidwatcher-launch.xml"/>
    </exec>
    <delete file="/tmp/jbidwatcher-launch.xml"/>
    <delete file="/tmp/${BINARY}"/>
    <delete file="/tmp/jbidwatcher.ico"/>
    <copy file="/tmp/${EXEFILE}" todir="."/>
  </target>
 
  <target name="osx" depends="jar">
    <antcall target="osx-app" />
  </target>
 
  <!--- IN DEVELOPMENT -->
  <target name="dmg" depends="osx-distribution">
    <exec executable="mkisofs">
      <arg line='-V JBidwatcher -r -apple -o ${DMGFILE} "${osx.app.path}/.."'/>
    </exec>
  </target>
 
  <target name="osx-development" depends="osx-distribution">
    <copy todir="${dest.dir}/${osx.app.name}">
      <fileset dir="${osx.app.path}" includes="**" />
    </copy>
  </target>
 
  <target name="osx-distribution">
    <delete dir="${osx.app.path}" />
    <mkdir dir="${osx.app.path}" />
    <mkdir dir="${osx.app.path}/Contents" />
    <mkdir dir="${osx.app.path}/Contents/MacOS" />
    <mkdir dir="${osx.app.path}/Contents/Resources" />
    <mkdir dir="${osx.app.path}/Contents/Resources/Java" />
 
    <copy file="${packaging}/Info.plist" todir="${osx.app.path}/Contents">
      <filterchain>
        <replacetokens begintoken="`" endtoken="`">
          <token key="binary" value="${INTERMEDIATE}" />
<token key="version" value="${VER}" />
<token key="appname" value="${app.name}" />
        </replacetokens>
      </filterchain>
    </copy>
 
    <copy file="${packaging}/JavaApplicationStub" todir="${osx.app.path}/Contents/MacOS" />
    <chmod file="${osx.app.path}/Contents/MacOS/JavaApplicationStub" perm="755" />
    <copy file="${packaging}/Info.plist" todir="${osx.app.path}/Contents" />
    <copy file="${packaging}/PkgInfo" todir="${osx.app.path}/Contents" />
    <copy file="${packaging}/jbidicon.icns" todir="${osx.app.path}/Contents/Resources" />
    <copy file="${packaging}/quaqua.jar" todir="${osx.app.path}/Contents/Resources/Java" />
    <copy file="${packaging}/libquaqua.jnilib" todir="${osx.app.path}/Contents/Resources/Java" />
    <copy file="${packaging}/libquaqua64.jnilib" todir="${osx.app.path}/Contents/Resources/Java" />
    <chmod file="${osx.app.path}/Contents/Resources/Java/libquaqua.jnilib" perm="755" />
    <chmod file="${osx.app.path}/Contents/Resources/Java/libquaqua64.jnilib" perm="755" />
    <copy file="${dest.dir}/${INTERMEDIATE}" todir="${osx.app.path}/Contents/Resources/Java" />
    <!--- Testing the possibility of putting all the libraries in the resources directory -->
    <copy todir="${osx.app.path}/Contents/Resources/Java">
      <fileset dir="${lib.dir}" includes="apple.jar" />
      <fileset dir="${lib.dir}" includes="derby.jar" />
      <fileset dir="${lib.dir}" includes="jdesktop.jar" />
      <fileset dir="${lib.dir}" includes="mp3codec.jar" />
    </copy>
  </target>
 
  <target name="osx-app" depends="osx-distribution">
    <tar destfile="${APPFILE}" compression="gzip">
      <tarfileset dir="${osx.app.path}" prefix="${app.name}.app" mode="755">
<include name="Contents/MacOS/JavaApplicationStub" />
<include name="Contents/Resources/Java/libquaqua.jnilib" />
      </tarfileset>
      <tarfileset dir="${osx.app.path}" prefix="${app.name}.app">
<include name="**" />
<exclude name="Contents" />
<exclude name="Contents/MacOS" />
<exclude name="Contents/Resources" />
<exclude name="Contents/Resources/Java" />
<exclude name="Contents/MacOS/JavaApplicationStub" />
<exclude name="Contents/Resources/Java/libquaqua.jnilib" />
      </tarfileset>
    </tar>
  </target>
 
  <target name="clean" description="Clean all build products.">
    <echo level="info" message="Clean all build products." />
    <delete file="${BINARY}" />
    <delete file="${BINARYSCRIPTING}" />
    <delete file="${INTERMEDIATE}" />
    <delete file="${UNOPT_BIN}" />
    <delete file="${TARFILE}" />
    <delete file="${APPFILE}" />
    <delete file="${EXEFILE}" />
    <delete file="${APPSCRIPTING}" />
    <delete file="${EXESCRIPTING}" />
    <delete file="${DMGFILE}" />
    <delete includeEmptyDirs="true" dir="osx"/>
    <delete>
      <fileset dir="${build.dir}" includes="**/*.class" />
    </delete>
    <delete dir="${osx.app.path}" />
    <!-- Delete intermediate files in case they still are around -->
    <delete file="/tmp/building/main/main.jar" />
    <delete file="/tmp/jbidwatcher-launch.xml"/>
    <delete file="/tmp/${BINARY}"/>
    <delete file="/tmp/jbidwatcher.ico"/>
    <delete dir="${dest.dir}/${osx.app.name}" />
  </target>
 
  <target name="apps" depends="tar,osx,exe,dmg" />
 
  <target name="release" depends="apps" description="Build for a full release.">
    <property name="server.path" value="jbidwatcher@jbidwatcher.com:www/htdocs/rdl" />
    <antcall target="upload" />
  </target>
 
  <target name="beta" depends="apps" description="Build for a pre-release version.">
    <property name="server.path" value="jbidwatcher@jbidwatcher.com:www/htdocs/beta" />
    <antcall target="upload" />
  </target>
 
  <target name="alpha" depends="apps" description="Build for an alpha or beta version.">
    <property name="server.path" value="jbidwatcher@jbidwatcher.com:www/htdocs/alpha" />
    <antcall target="upload" />
  </target>
 
  <target name="upload" description="Upload the code to a given destination">
    <scp verbose="true" todir="${server.path}" keyfile="/home/mrs/.ssh/id_rsa" passphrase="">
      <fileset dir="${main.dir}">
<include name="${BINARY}" />
<include name="${APPFILE}" />
<include name="${EXEFILE}" />
<include name="${BINARYSCRIPTING}" />
<include name="${APPSCRIPTING}" />
<include name="${EXESCRIPTING}" />
<include name="${TARFILE}" />
<include name="${DMGFILE}" />
      </fileset>
    </scp>
  </target>
 
  <target name="run" description="Start Application">
    <java fork="true" jar="${BINARY}" args="-Xmx512m -Xms256m"/>
  </target>
</project>