-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
446 lines (398 loc) · 18.5 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="bluej" default="ready-to-run">
<!-- ************************************************************ -->
<!-- set global properties for this build (and subproject builds} -->
<!-- ********************************************** -->
<!-- it should not be necessary to edit any properties to build -->
<!-- user specific properties that are edited to match local build environment-->
<property file="build.properties"/>
<property name="bluej_home" value="${basedir}" />
<!--
This is the only place you need to change the version number.
After changing the version number the target "update-version-number" should be run -->
<property name="bluej.version.major" value="3" />
<property name="bluej.version.minor" value="0" />
<property name="bluej.version.release" value="4" />
<property name="bluej.version.suffix" value="colno" />
<!-- suffix with no spaces, eg "pre2" -->
<property name="bluej.version.nonspace.suffix" value="colno" />
<property name="bluej.version" value="${bluej.version.major}.${bluej.version.minor}.${bluej.version.release}${bluej.version.suffix}" />
<property name="bluej.version.nodots" value="${bluej.version.major}${bluej.version.minor}${bluej.version.release}${bluej.version.suffix}" />
<property name="bluej.version.debian" value="${bluej.version.major}.${bluej.version.minor}.${bluej.version.release}${bluej.version.nonspace.suffix}" />
<!-- user specific properties that are edited to match local build environment-->
<property file="build.properties"/>
<!-- Set up common directories -->
<property name="core.doc" value="doc/all"/>
<property name="extension.doc" value="doc/extensions"/>
<property name="core.src" value="src"/>
<property name="core.build" value="classes"/>
<property name="boot.src" value="boot/src"/>
<property name="boot.build" value="boot/classes"/>
<property name="test.src" value="test/src"/>
<property name="test.build" value="test/classes"/>
<property name="test.report" value="test/report"/>
<property name="extensions.lib" location="${bluej_home}/lib/extensions"/>
<property name="boot.jar" value="${bluej_home}/lib/bluej.jar"/>
<property name="core.jar" value="${bluej_home}/lib/bluejcore.jar"/>
<property name="editor.jar" value="${bluej_home}/lib/bluejeditor.jar"/>
<property name="extension.jar" value="${bluej_home}/lib/bluejext.jar"/>
<!-- Set up classpath (does not include jar files built by us) -->
<path id="bluej.class.path">
<pathelement location="${bluej_home}/lib/AppleJavaExtensions.jar"/>
<pathelement location="${bluej_home}/lib/junit.jar"/>
<pathelement location="${bluej_home}/lib/org-netbeans-lib-cvsclient.jar"/>
<pathelement location="${bluej_home}/lib/svnkit-javahl.jar"/>
<pathelement location="${bluej_home}/lib/trilead.jar"/>
</path>
<!-- If you change the first or last lines of this license you might want
to update the 'add-license-to-sources' target as well -->
<property name="license" value="/*${line.separator}
This file is part of the BlueJ program. ${line.separator}
Copyright (C) 1999-2009 Michael Kolling and John Rosenberg ${line.separator}
${line.separator}
This program is free software; you can redistribute it and/or ${line.separator}
modify it under the terms of the GNU General Public License ${line.separator}
as published by the Free Software Foundation; either version 2 ${line.separator}
of the License, or (at your option) any later version. ${line.separator}
${line.separator}
This program is distributed in the hope that it will be useful, ${line.separator}
but WITHOUT ANY WARRANTY; without even the implied warranty of ${line.separator}
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ${line.separator}
GNU General Public License for more details. ${line.separator}
${line.separator}
You should have received a copy of the GNU General Public License ${line.separator}
along with this program; if not, write to the Free Software ${line.separator}
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ${line.separator}
${line.separator}
This file is subject to the Classpath exception as provided in the ${line.separator}
LICENSE.txt file that accompanied this code.${line.separator}
*/${line.separator}"/>
<!-- taskdef name="jarbundler"
classname="com.loomcom.ant.tasks.jarbundler.JarBundler" / -->
<!--
- Compile the boot strap loader
-->
<target name="compile-boot">
<mkdir dir="${boot.build}"/>
<!-- Compile the java code from ${boot.src} into ${boot.build} -->
<!-- Boot should not need any other jars or classes other than standard JDK -->
<javac
executable="${build_java_home}/${java_command_dir_name}/javac"
fork="yes"
srcdir="${boot.src}"
destdir="${boot.build}"
source="1.5"
target="1.5"
deprecation="yes"
>
</javac>
</target>
<!--
- Compile the core classes (includes extension and editor classes)
-->
<target name="compile-core">
<mkdir dir="${core.build}"/>
<!-- Compile the java code from ${core.src} into ${core.build} -->
<javac
executable="${build_java_home}/${java_command_dir_name}/javac"
fork="yes"
source="1.5"
target="1.5"
srcdir="${core.src}"
destdir="${core.build}"
debug="on"
deprecation="yes"
excludes="de/**,
archiver/**, gnu/**, javax/**, kopi/**,
net/**/test/**,
net/**,
bluej/tester/**,
bluej/browser/**,
bluej/guibuilder/**,
bluej/editor/moe/Moe.java">
<classpath>
<path refid="bluej.class.path"/>
<pathelement location="${boot.jar}"/>
<pathelement location="${build_java_home}/lib/tools.jar"/>
</classpath>
</javac>
</target>
<target name="compile-test" depends="compile-boot, compile-core">
<mkdir dir="${test.build}"/>
<mkdir dir="${test.report}"/>
<!-- Compile the java code from ${test.src} into ${test.build} -->
<javac
executable="${build_java_home}/${java_command_dir_name}/javac"
fork="yes"
srcdir="${test.src}"
source="1.5"
target="1.5"
destdir="${test.build}"
deprecation="yes"
>
<classpath>
<path refid="bluej.class.path"/>
<pathelement location="${boot.build}"/>
<pathelement location="${core.build}"/>
<pathelement location="${build_java_home}/lib/tools.jar"/>
</classpath>
</javac>
</target>
<target name="jar-boot" depends="compile-boot">
<!-- delete the old jar first. To make sure it gets recreated -->
<delete quiet="true" file="${boot.jar}"/>
<!-- this is the Boot, the resulting jar is bluej.jar for historic reasons -->
<jar compress="yes" jarfile="${boot.jar}">
<fileset dir="${boot.build}">
<include name="bluej/Boot*.class"/>
<include name="bluej/Splash*.class"/>
<include name="bluej/BlueJLabel.class"/>
<include name="bluej/GreenfootLabel.class"/>
</fileset>
<fileset dir="${boot.src}">
<include name="bluej/splash.jpg"/>
<include name="bluej/greenfootsplash.jpg"/>
</fileset>
<manifest>
<attribute name="Main-Class" value="bluej.Boot"/>
</manifest>
</jar>
</target>
<target name="jar-core" depends="jar-boot, compile-core">
<!-- delete the old jar first. To make sure it gets recreated -->
<delete quiet="true" file="${core.jar}"/>
<jar compress="yes" jarfile="${core.jar}">
<fileset dir="${core.build}">
<exclude name="bluej/extensions/**" />
<exclude name="bluej/editor/**" />
<exclude name="org/**" />
</fileset>
</jar>
</target>
<target name="jar-editor" depends="jar-boot, compile-core">
<!-- delete the old jar first. To make sure it gets recreated -->
<delete quiet="true" file="${editor.jar}"/>
<jar compress="yes" jarfile="${editor.jar}">
<fileset dir="${core.build}">
<include name="bluej/editor/**" />
<include name="org/**" />
<exclude name="bluej/editor/*.txt" />
<exclude name="bluej/editor/*.xml" />
</fileset>
</jar>
</target>
<target name="jar-extension" depends="jar-boot, compile-core">
<!-- delete the old jar first. To make sure it gets recreated -->
<delete quiet="true" file="${extension.jar}"/>
<jar compress="yes" jarfile="${extension.jar}">
<fileset dir="${core.build}">
<include name="bluej/extensions/**" />
</fileset>
</jar>
</target>
<target name="ready-to-run" depends="jar-core, jar-editor, jar-extension">
</target>
<target name="run">
<!-- delete the greenfoot jar (if it exists) since it screws up BlueJ -->
<delete quiet="true" file="${extensions.lib}/greenfoot.jar"/>
<!-- run the java code built into the jar files -->
<java classname="bluej.Boot" fork="yes" jvm="${run_java_home}/${java_command_dir_name}/java">
<!-- Include the following line to enable attachment of the Netbeans debugger
<jvmarg value="-agentlib:jdwp=transport=dt_socket,address=8888,server=y,suspend=n"/>
-->
<classpath>
<pathelement location="${boot.jar}"/>
<pathelement location="${run_java_home}/lib/tools.jar"/>
<pathelement location="/System/Library/Java"/>
</classpath>
</java>
</target>
<target name="run-profiler">
<fail unless="netbeans.home">This target can only run inside the NetBeans IDE.</fail>
<nbprofiledirect>
<classpath>
<pathelement location="${boot.jar}"/>
<pathelement location="${run_java_home}/lib/tools.jar"/>
<pathelement location="/System/Library/Java"/>
</classpath>
</nbprofiledirect>
<!-- delete the greenfoot jar (if it exists) since it screws up BlueJ -->
<delete quiet="true" file="${extensions.lib}/greenfoot.jar"/>
<!-- run the java code built into the jar files -->
<java classname="bluej.Boot" fork="yes" jvm="${run_java_home}/${java_command_dir_name}/java">
<classpath>
<pathelement location="${boot.jar}"/>
<pathelement location="${run_java_home}/lib/tools.jar"/>
<pathelement location="/System/Library/Java"/>
</classpath>
<jvmarg value="${profiler.info.jvmargs.agent}"/>
</java>
</target>
<target name="editor-dist">
<ant antfile="editor.xml" dir="src/bluej/editor" target="dist"/>
</target>
<target name="dist" depends="ready-to-run">
<echo message="Do you have the latest copy of the submitter extension in your lib/extensions directory??"/>
<ant dir="package" target="dist"/>
<!-- ant dir="package" target="windows-dist"/-->
</target>
<target name="dist-greenfoot" depends="ready-to-run">
<ant dir="package" antfile="greenfoot-build.xml" target="dist"/>
</target>
<target name="windows-dist">
<ant dir="package" target="windows-dist"/>
</target>
<target name="mac-dist">
<jarbundler dir="package"
name="BlueJ"
mainclass="bluej.Boot"
jvmversion="1.4+"
icon="lib/images/bluej.icns"
version="${bluej.version}">
<jarfileset dir="lib">
<include name="**/*.jar" />
<exclude name="*/CVS" />
</jarfileset>
</jarbundler>
</target>
<!-- build *.deb package -->
<target name="debian-dist" description="build Debian package">
<ant dir="package" target="debian-dist"/>
</target>
<target name="test" depends="compile-core, compile-test">
<junit printsummary="yes" haltonfailure="yes">
<classpath>
<path refid="bluej.class.path"/>
<pathelement location="${boot.jar}"/>
<pathelement location="${core.jar}"/>
<pathelement location="${extension.jar}"/>
<pathelement location="${run_java_home}/lib/tools.jar"/>
<pathelement location="${editor.jar}"/>
<pathelement location="${test.build}"/>
</classpath>
<formatter type="plain"/>
<batchtest fork="yes" todir="${test.report}">
<fileset dir="${test.src}">
<include name="**/*Test*.java"/>
<exclude name="bluej/debugger/gentype/TestReflective.java"/>
<exclude name="**/AllTests.java"/>
</fileset>
</batchtest>
</junit>
</target>
<target name="doc-core">
<!-- doc the java code from ${core.src} into ${core.doc} -->
<mkdir dir="${core.doc}"/>
<javadoc destdir="${core.doc}"
packagenames="bluej.*, org.syntax.jedit.*"
excludepackagenames=
"bluej.guibuilder.*,
bluej.groupwork.*,
bluej.browser.*"
sourcepath="${core.src}"
Windowtitle="BlueJ API"
Doctitle="BlueJ API"
bottom="<a href=//www.bluej.org/>BlueJ homepage</a>">
<classpath>
<path refid="bluej.class.path"/>
<pathelement location="${boot.jar}"/>
<pathelement location="${build_java_home}/lib/tools.jar"/>
</classpath>
</javadoc>
</target>
<target name="doc-extension">
<mkdir dir="${extension.doc}"/>
<javadoc destdir="${extension.doc}"
packagenames="bluej.extensions.event"
sourcepath="${core.src}"
Windowtitle="BlueJ Extensions API"
Doctitle="BlueJ Extensions API"
bottom="<a href=http://www.bluej.org/>BlueJ homepage</a>">
<fileset dir="src" defaultexcludes="yes">
<include name="bluej/extensions/*.java" />
<exclude name="bluej/extensions/ExtensionBridge.java"/>
<include name="bluej/extensions/editor/*.java"/>
<exclude name="bluej/extensions/editor/EditorBridge.java"/>
</fileset>
<classpath>
<path refid="bluej.class.path"/>
<pathelement location="${boot.jar}"/>
<pathelement location="${build_java_home}/lib/tools.jar"/>
</classpath>
</javadoc>
</target>
<target name="update-version-number" description="updates the version number in all files where it appears" >
<replaceregexp byline="true">
<regexp pattern="BLUEJ_VERSION_MAJOR = .*"/>
<substitution expression="BLUEJ_VERSION_MAJOR = ${bluej.version.major};"/>
<fileset dir="boot/src/bluej" includes="Boot.java"/>
</replaceregexp>
<replaceregexp byline="true">
<regexp pattern="BLUEJ_VERSION_MINOR = .*"/>
<substitution expression="BLUEJ_VERSION_MINOR = ${bluej.version.minor};"/>
<fileset dir="boot/src/bluej" includes="Boot.java"/>
</replaceregexp>
<replaceregexp byline="true">
<regexp pattern="BLUEJ_VERSION_RELEASE = .*"/>
<substitution expression="BLUEJ_VERSION_RELEASE = ${bluej.version.release};"/>
<fileset dir="boot/src/bluej" includes="Boot.java"/>
</replaceregexp>
<replaceregexp byline="true">
<regexp pattern="BLUEJ_VERSION_SUFFIX = .*"/>
<substitution expression="BLUEJ_VERSION_SUFFIX = "${bluej.version.suffix}";"/>
<fileset dir="boot/src/bluej" includes="Boot.java"/>
</replaceregexp>
</target>
<target name="add-license-to-sources" description="adds the license to each source file" >
<replaceregexp flags="s" encoding="ISO8859-1">
<regexp pattern="(^\/\*\n This file is part of the BlueJ program.*? file that accompanied this code\.\n.\*\/\n)|^"/>
<substitution expression="${license}"/>
<fileset dir="." includes="**/*.java" >
<exclude name="package/Installer.java"/>
<exclude name="examples/**"/>
<exclude name="src/org/syntax/jedit/**"/>
<include name="package/winlaunch/**.cc"/>
<include name="package/winlaunch/**.h"/>
</fileset>
</replaceregexp>
</target>
<target name="clean-boot">
<delete quiet="true" dir="${boot.build}"/>
<delete quiet="true" file="${boot.jar}"/>
</target>
<target name="clean-greenfoot" description="clean up greenfoot related stuff" >
<!-- Installer image windows: greenfoot-install.bmp -->
<delete file="package/greenfoot-install.bmp" />
<!-- Installer image jar: greenfoot-install.png -->
<delete file="package/greenfoot-install.png" />
<delete file="boot/src/bluej/greenfootsplash.jpg" />
<delete dir="lib/greenfoot" />
<!-- Commons libraries -->
<delete >
<fileset dir="lib">
<include name="commons*.jar"/>
</fileset>
</delete>
<delete dir="package/scenarios" />
<delete>
<fileset file="lib/extensions/greenfoot.jar"/>
</delete>
<delete includeEmptyDirs="true">
<fileset dir="lib">
<include name="*/greenfoot/" />
</fileset>
</delete>
</target>
<target name="clean-core">
<delete quiet="true" dir="${core.build}" />
<delete quiet="true" file="${core.jar}" />
<delete quiet="true" file="${editor.jar}" />
<delete quiet="true" file="${extension.jar}" />
</target>
<target name="clean" depends="clean-boot, clean-core, clean-greenfoot">
<ant dir="package" target="clean"/>
</target>
<target name="editor-clean">
<ant antfile="editor.xml" dir="src/bluej/editor" target="clean"/>
</target>
</project>