-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
1051 lines (956 loc) · 38.4 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
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0"?>
<!-- A build file for use by Ant to build Kawa. -->
<!-- Requires Ant 1.6.3 -->
<project name="Kawa" default="default" basedir=".">
<fail>
Kawa's Subversion repository is no longer used.
Get the sources using Git instead: clone https://gitlab.com/kashell/Kawa.git
</fail>
<property environment="env"/>
<!-- Give the user a chance to override the defaults. -->
<property file="build.properties"/>
<property name="version.release" value="2.2.1"/>
<property name="version.local" value=""/>
<property name="version" value="${version.release}${version.local}"/>
<property name="debug" value="true" />
<property name="deprecation" value="false" />
<property name="optimize" value="true" />
<!--
There was some discussion of using user.dir as a default here.
The most promising use being for dist.dir (and maybe build.dir).
But I decided against that for several reasons:
1) Consistency (don't make a special case).
2) The user.dir property isn't reliable (some bad JVMs out there).
3) Ant is not able to handle both absolute and relative paths
for commandline arguments based on user.dir. Ant automatically
handles relative paths relative to basedir, not user.dir.
As a result, if dist.dir defaulted to user.dir,
"ant -buildfile ../kawa/build.xml" and
"ant -buildfile ../kawa/build.xml -Ddist.dir=."
would produce different results.
4) The value of user.dir is not useful when using a Java IDE
(like NetBeans or JBuilder) since it is the directory that
happened to be current when the IDE started.
So, the only way to use Ant where the current directory (user.dir)
is not the directory containing the buildfile, you *must* supply
absolute paths as arguments. That is:
"ant -buildfile ../kawa/build.xml -Ddist.dir=`pwd`/."
The exception is Ant's arguments themselves, which are processed
as plain Java files and so are relative to the current directory.
-->
<property name="src.dir" value="${basedir}"/>
<property name="build.dir" value="${basedir}"/>
<property name="dist.dir" value="${build.dir}"/>
<property name="build.tools" value="${build.dir}/tools"/>
<property name="build.tmp" value="${build.dir}/tmp"/>
<property name="build.preprocessed" value="${build.dir}"/>
<property name="build.classes" value="${build.dir}"/>
<property name="dist.kawa.jar" value="${dist.dir}/lib/kawa.jar"/>
<condition property="kawa.shell" value="/bin/bash" else="/bin/sh">
<available file="/bin/bash"/>
</condition>
<!--
Set preprocess.overwrite true to force preprocessing.
Eventually this will be dependency checked.
For now use "ant clean" if anything changes.
-->
<property name="preprocess.overwrite" value="false"/>
<target name="all" depends="select-java-auto, classes, jar, kawa.sh, kawa.bat"/>
<target name="default" depends="all"/>
<target name="classes"
depends="java-classes, lib-scm-classes
, slib-scm-classes, commonlisp-scm-classes, brl-classes
, xml-classes, servlet-classes, jemacs-classes, android-classes
, javafx-classes" />
<!--
These are the files that are Kawa.
They go in the classpath, jar, and are deleted by clean.
If additional files (resources like properties and the
like) are added, something will need to be done so that
clean will still work when build.classes=src.dir.
-->
<fileset id="build.classes" dir="${build.classes}">
<include name="gnu/**/*.class"/>
<include name="kawa/**/*.class"/>
</fileset>
<!--
These are the files that are preprocessed before compiling.
In order to allow them to be mixed with the original source,
we must list them each here.
-->
<fileset id="build.preprocessed" dir="${build.preprocessed}">
<include name="kawa/Version.java"/>
</fileset>
<fileset id="build.selectjava" dir="${src.dir}">
<include name="**/*.java"/>
<or>
<contains text="BEGIN JAVA" casesensitive="true"/>
<contains text=" #endif " casesensitive="true"/>
</or>
</fileset>
<target name="run" depends="classes">
<java taskname="kawa" classname="kawa.repl" classpath="${build.classes}" fork="true"/>
</target>
<target name="runw" depends="classes">
<java taskname="kawa" fork="true"
classname="kawa.repl" classpath="${build.classes}">
<arg value="-w"/>
</java>
</target>
<!--
This is part of an "if" trick. Do not change me.
The "if" attribute for tasks is not true if the property is not
set at all, not whether the value is "true" or "false".
So here we use the value of the with- or enable- properties
and rely on true being "true" with this property defined,
and false being "false" with that property not defined.
-->
<property name="true" value="true"/>
<target name="build-settings" depends="build-tools">
<!-- If java.awt.Component is in the classpath, then we'll compile the
AWT UI, unless you override the setting of with-awt. -->
<condition property="with-awt" else="false">
<available classname="java.awt.Component"/>
</condition>
<!-- If org.xml.sax.ContentHandler is in the classpath, then we'll compile
in SAX2 support, unless you override the setting of with-sax2. -->
<condition property="with-sax2" else="false">
<available classname="org.xml.sax.ContentHandler"/>
</condition>
<!-- If java.awt.Component is in the classpath, then we'll compile the
JEmacs Swing UI, unless you override the setting of with-swing. -->
<condition property="with-swing" else="false">
<available classname="javax.swing.JComponent"/>
</condition>
<!-- JEmacs stuff is compiled if Swing is used, unless enable-jemacs is false.
-->
<property name="enable-jemacs" value="false"/>
<property name="enable-xml" value="true"/>
<property name="enable-brl" value="false"/>
<property name="enable-android" value="false"/>
<property name="javafx.home" value=""/>
<property name="enable-javafx" value="false"/>
<condition property="do.enable.javafx">
<or>
<istrue value="${enable-javafx}"/>
<not><equals arg1="${javafx.home}" arg2=""/></not>
</or>
</condition>
<condition property="-use.javafx.home">
<and>
<not><equals arg1="${javafx.home}" arg2=""/></not>
<istrue value="${do.enable.javafx}"/>
</and>
</condition>
<path id="pextra.classpath">
<fileset dir="${javafx.home}"><include name="rt/lib/jfxrt.jar" if="-use.javafx.home"/></fileset>
</path>
<property name="extra.classpath" refid="pextra.classpath"/>
<path id="build.classpath">
<pathelement path="${java.class.path}"/>
<fileset dir="${javafx.home}"><include name="rt/lib/jfxrt.jar" if="-use.javafx.home"/></fileset>
</path>
<!-- If javax.servlet.http.HttpServlet is in the classpath, then we'll
compile Kawa' servlet interface, unless you override enable-servlet.
The servlet code uses methods from the 2.3 specification now.
So test for a class that is new for the 2.3 API. -->
<condition property="enable-servlet" else="false">
<available classname="javax.servlet.Filter"/>
</condition>
<condition property="isWindows">
<os family="windows" />
</condition>
<condition property="classpath.separator" value=";" else=":">
<os family="windows" />
</condition>
<condition property="preprocess-xml" value="+enable:XML" else="-enable:XML">
<istrue value="${enable-xml}"/>
</condition>
<condition property="preprocess-HttpServer" value="+use:com.sun.net.httpserver"
else="-use:com.sun.net.httpserver">
<available classname="com.sun.net.httpserver.HttpServer"/>
</condition>
<condition property="with-javax-script" else="false">
<available classname="javax.script.ScriptEngine"/>
</condition>
<condition property="-needs-scripting-inf">
<and>
<istrue value="${with-javax-script}"/>
<not>
<available file="META-INF/services/javax.script.ScriptEngineFactory"/>
</not>
</and>
</condition>
<condition property="-needs-scripting-inf-xquery">
<and>
<istrue value="${-needs-scripting-inf}"/>
<istrue value="${enable-xml}"/>
</and>
</condition>
<echo>
version=${version}
dist.kawa.jar=${dist.kawa.jar}
build.dir=${build.dir}
with-awt=${with-awt}
with-swing=${with-swing}
with-sax2=${with-sax2}
enable-jemacs=${enable-jemacs}
enable-xml=${enable-xml}
enable-servlet=${enable-servlet}
enable-android=${enable-android}
enable-javafx=${do.enable.javafx}
</echo>
<!--
This dummy copy is just so we can reference the sets by id.
This is needed because we are not able to put linestrippersets
in a task or project the way we can with filtersets.
Ant gives "Overriding previous definition of reference to..."
warnings. Can't seem to avoid that.
-->
<xcopy dataOnly="true">
<linestripperset id="strip-char-subs">
<linestripper first="if CHAR is byte" last="endif CHAR is byte" />
</linestripperset>
</xcopy>
</target>
<target name="build-tools">
<mkdir dir="${build.tools}"/>
<mkdir dir="${build.tmp}"/>
<!--
This didn't work in NetBeans for some reason.
(Even the includejavaruntime/includeantruntime attributes do no good.
The really weird thing is that NetBeans has access to the classes
for autocomplete and the scripting window. Oh well.)
The workaround is to link to ant.jar.
-->
<javac srcdir="${src.dir}"
destdir="${build.tools}"
classpath="lib/ext/ant.jar"
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimize}"
includeantruntime="true">
<include name="gnu/kawa/util/PreProcess.java"/>
<include name="gnu/kawa/ant/*.java"/>
</javac>
<taskdef name="xcopy"
classname="gnu.kawa.ant.XCopy"
classpath="${build.tools}"/>
<taskdef name="kawac"
classname="gnu.kawa.ant.Kawac"
classpath="${build.tools}"/>
<!--
This doesn't really help us because user data
definitions don't seem to be possible.
<typedef name="linestripperset"
classname="gnu.kawa.ant.LineStripperSet"
classpath="${build.tools}"/>
-->
</target>
<available property="has-java2" classname="java.lang.ThreadLocal"/>
<available property="has-java4" classname="java.lang.CharSequence"/>
<available property="has-java5" classname="java.lang.Appendable"/>
<available property="has-java6" classname="javax.script.AbstractScriptEngine"/>
<available property="has-java7" classname="java.lang.invoke.MethodHandle"/>
<available property="has-java8" classname="java.util.stream.Stream"/>
<target name="select-java1" depends="build-settings">
<pathconvert property="fileList" pathSep=" " dirSep="${file.separator}">
<path><fileset refid="build.selectjava"/></path>
</pathconvert>
<java classname="gnu.kawa.util.PreProcess">
<classpath location="${build.tools}"/>
<arg line="%java1 ${preprocess-xml} -use:com.sun.net.httpserver"/>
<arg line="${fileList}"/>
</java>
</target>
<target name="select-java2" depends="build-settings">
<pathconvert property="fileList" pathSep=" " dirSep="${file.separator}">
<path><fileset refid="build.selectjava"/></path>
</pathconvert>
<java classname="gnu.kawa.util.PreProcess">
<classpath location="${build.tools}"/>
<arg line="%java2 ${preprocess-xml} -use:com.sun.net.httpserver"/>
<arg line="${fileList}"/>
</java>
</target>
<target name="select-java4" depends="build-settings">
<pathconvert property="fileList" pathSep=" " dirSep="${file.separator}">
<path><fileset refid="build.selectjava"/></path>
</pathconvert>
<java classname="gnu.kawa.util.PreProcess">
<classpath location="${build.tools}"/>
<arg line="%java4 ${preprocess-xml} -use:com.sun.net.httpserver"/>
<arg line="${fileList}"/>
</java>
</target>
<target name="select-java5" depends="build-settings">
<pathconvert property="fileList" pathSep=" " dirSep="${file.separator}">
<path><fileset refid="build.selectjava"/></path>
</pathconvert>
<java classname="gnu.kawa.util.PreProcess">
<classpath location="${build.tools}"/>
<arg line="%java5 ${preprocess-xml} -use:com.sun.net.httpserver"/>
<arg line="${fileList}"/>
</java>
</target>
<target name="select-java6" depends="build-settings">
<pathconvert property="fileList" pathSep=" " dirSep="${file.separator}">
<path><fileset refid="build.selectjava"/></path>
</pathconvert>
<java classname="gnu.kawa.util.PreProcess">
<classpath location="${build.tools}"/>
<arg line="%java6 ${preprocess-xml} ${preprocess-HttpServer}"/>
<arg line="${fileList}"/>
</java>
</target>
<target name="select-android" depends="build-settings">
<pathconvert property="fileList" pathSep=" " dirSep="${file.separator}">
<path><fileset refid="build.selectjava"/></path>
</pathconvert>
<java classname="gnu.kawa.util.PreProcess">
<classpath location="${build.tools}"/>
<arg line="%android ${preprocess-xml} -use:com.sun.net.httpserver"/>
<arg line="${fileList}"/>
</java>
</target>
<target name="select-java7" depends="build-settings">
<pathconvert property="fileList" pathSep=" " dirSep="${file.separator}">
<path><fileset refid="build.selectjava"/></path>
</pathconvert>
<java classname="gnu.kawa.util.PreProcess">
<classpath location="${build.tools}"/>
<arg line="%java7 ${preprocess-xml} ${preprocess-HttpServer}"/>
<arg line="${fileList}"/>
</java>
</target>
<target name="select-java8" depends="build-settings">
<pathconvert property="fileList" pathSep=" " dirSep="${file.separator}">
<path><fileset refid="build.selectjava"/></path>
</pathconvert>
<java classname="gnu.kawa.util.PreProcess">
<classpath location="${build.tools}"/>
<arg line="%java8 ${preprocess-xml} ${preprocess-HttpServer}"/>
<arg line="${fileList}"/>
</java>
</target>
<target name="-maybe-select-java1" unless="has-java2">
<antcall target="select-java1"/>
</target>
<target name="-maybe-select-java2" if="has-java2" unless="has-java4">
<antcall target="select-java2"/>
</target>
<target name="-maybe-select-java4" if="has-java4" unless="has-java5">
<antcall target="select-java4"/>
</target>
<target name="-maybe-select-java5" if="has-java5" unless="has-java6">
<antcall target="select-java5"/>
</target>
<target name="-maybe-select-java6" if="has-java6" unless="has-java7">
<antcall target="select-java6"/>
</target>
<target name="-maybe-select-java7" if="has-java7" unless="has-java8">
<antcall target="select-java7"/>
</target>
<target name="-maybe-select-java8" if="has-java8">
<antcall target="select-java8"/>
</target>
<target name="-maybe-select-android" if="${enable-android}">
<antcall target="select-android"/>
</target>
<target name="select-java-auto">
<antcall target="-select-java-non-android"/>
<antcall target="-maybe-select-android"/>
</target>
<target name="-select-java-non-android" unless="${enable-android}">
<antcall target="-maybe-select-java1"/>
<antcall target="-maybe-select-java2"/>
<antcall target="-maybe-select-java4"/>
<antcall target="-maybe-select-java5"/>
<antcall target="-maybe-select-java6"/>
<antcall target="-maybe-select-java7"/>
<antcall target="-maybe-select-java8"/>
</target>
<!--
This preprocessing jazz is rather involved and verbose,
but it is entirely compatible with the makefile code
and actually _isn't_ as complicated as I could have made
it (as there are still unrolled patterns here that could
have been wrapped up but I demurred in consideration of
those who may try and grok it).
-->
<filterset id="filter-do-not-edit" begintoken="-*-" endtoken="-*-">
<filter token="Java"
value="Automatically generated file - DO NOT EDIT!. -*- buffer-read-only: t -*-" />
</filterset>
<target name="preprocess" depends="build-tools, build-settings">
<mkdir dir="${build.preprocessed}"/>
<xcopy todir="${build.preprocessed}/kawa"
overwrite="${preprocess.overwrite}">
<fileset dir="${src.dir}/kawa" includes="*.java.in"/>
<mapper type="glob" from="*Version.java.in" to="*Version.java"/>
<filterset refid="filter-do-not-edit"/>
<filterset begintoken=""" endtoken=""">
<filter token="VERSION" value=""${version}"" />
</filterset>
</xcopy>
</target>
<target name="-make-primvector-source">
<java classname="gnu.kawa.util.PreProcess">
<classpath location="${build.tools}"/>
<arg value="%${TAG}"/>
<arg value="%UniformVector"/>
<arg value="-o"/>
<arg value="gnu/lists/${OUT}Vector.java"/>
<arg value="gnu/lists/PrimVector.template"/>
</java>
</target>
<target name="-maybe-generate-simplevector-files" unless="simplevector-files-uptodate">
<antcall target="-make-primvector-source">
<param name="TAG" value="OBJECT"/>
<param name="OUT" value="F"/>
</antcall>
<antcall target="-make-primvector-source">
<param name="TAG" value="BIT"/>
<param name="OUT" value="Bit"/>
</antcall>
<antcall target="-make-primvector-source">
<param name="TAG" value="BYTE"/>
<param name="OUT" value="Byte"/>
</antcall>
<antcall target="-make-primvector-source">
<param name="TAG" value="SHORT"/>
<param name="OUT" value="Short"/>
</antcall>
<antcall target="-make-primvector-source">
<param name="TAG" value="INT"/>
<param name="OUT" value="Int"/>
</antcall>
<antcall target="-make-primvector-source">
<param name="TAG" value="LONG"/>
<param name="OUT" value="Long"/>
</antcall>
<antcall target="-make-primvector-source">
<param name="TAG" value="F32"/>
<param name="OUT" value="F32"/>
</antcall>
<antcall target="-make-primvector-source">
<param name="TAG" value="F64"/>
<param name="OUT" value="F64"/>
</antcall>
<antcall target="-make-primvector-source">
<param name="TAG" value="S8"/>
<param name="OUT" value="S8"/>
</antcall>
<antcall target="-make-primvector-source">
<param name="TAG" value="S16"/>
<param name="OUT" value="S16"/>
</antcall>
<antcall target="-make-primvector-source">
<param name="TAG" value="S32"/>
<param name="OUT" value="S32"/>
</antcall>
<antcall target="-make-primvector-source">
<param name="TAG" value="S64"/>
<param name="OUT" value="S64"/>
</antcall>
<antcall target="-make-primvector-source">
<param name="TAG" value="U8"/>
<param name="OUT" value="U8"/>
</antcall>
<antcall target="-make-primvector-source">
<param name="TAG" value="U16"/>
<param name="OUT" value="U16"/>
</antcall>
<antcall target="-make-primvector-source">
<param name="TAG" value="U32"/>
<param name="OUT" value="U32"/>
</antcall>
<antcall target="-make-primvector-source">
<param name="TAG" value="U64"/>
<param name="OUT" value="U64"/>
</antcall>
</target>
<target name="generate-simplevector-files" depends="build-tools">
<uptodate property="simplevector-files-uptodate">
<srcfiles file="${src.dir}/gnu/lists/PrimVector.template"/>
<srcfiles file="${build.tools}/gnu/kawa/util/PreProcess.class"/>
<compositemapper>
<mergemapper to="${src.dir}/gnu/lists/FVector.java"/>
<mergemapper to="${src.dir}/gnu/lists/BitVector.java"/>
<mergemapper to="${src.dir}/gnu/lists/ByteVector.java"/>
<mergemapper to="${src.dir}/gnu/lists/ShortVector.java"/>
<mergemapper to="${src.dir}/gnu/lists/IntVector.java"/>
<mergemapper to="${src.dir}/gnu/lists/LongVector.java"/>
<mergemapper to="${src.dir}/gnu/lists/F32Vector.java"/>
<mergemapper to="${src.dir}/gnu/lists/F64Vector.java"/>
<mergemapper to="${src.dir}/gnu/lists/S8Vector.java"/>
<mergemapper to="${src.dir}/gnu/lists/S16Vector.java"/>
<mergemapper to="${src.dir}/gnu/lists/S32Vector.java"/>
<mergemapper to="${src.dir}/gnu/lists/S64Vector.java"/>
<mergemapper to="${src.dir}/gnu/lists/U8Vector.java"/>
<mergemapper to="${src.dir}/gnu/lists/U16Vector.java"/>
<mergemapper to="${src.dir}/gnu/lists/U32Vector.java"/>
<mergemapper to="${src.dir}/gnu/lists/U64Vector.java"/>
</compositemapper>
</uptodate>
<antcall target="-maybe-generate-simplevector-files"/>
</target>
<target name="kawa.sh" depends="build-settings">
<copy file="${src.dir}/bin/kawa.sh.in" tofile="bin/kawa.sh">
<filterset>
<filter token="ENABLE_KAWA_FRONTEND_TRUE" value="#"/>
<filter token="VERSION" value="${version}"/>
<filter token="CLASSPATH_SEPARATOR" value="${classpath.separator}"/>
<filter token="KAWAJAR" value="kawa.jar"/>
<filter token="CYGPATH_W" value="echo"/>
<filter token="KAWA_SHELL" value="${kawa.shell}"/>
<filter token="conf_classpath" value=""/>
</filterset>
</copy>
<chmod file="bin/kawa.sh" perm="+x"/>
</target>
<patternset id="with-sax2-false">
</patternset>
<patternset id="with-sax2-true">
<include name="gnu/kawa/sax/"/>
</patternset>
<patternset id="with-awt-true"/>
<patternset id="with-awt-false">
<exclude name="kawa/GuiConsole.java"/>
<exclude name="kawa/MessageArea.java"/>
<exclude name="kawa/TextAreaWriter.java"/>
<exclude name="kawa/GuiInPort.java"/>
</patternset>
<target name="java-classes" depends="preprocess,generate-simplevector-files">
<mkdir dir="${build.classes}"/>
<!--
Javac doesn't "shadow" directories, so there may not be duplicates.
That means that if you're building other than in the source directory,
then the source directory must be clean.
-->
<javac srcdir="${build.preprocessed}:${src.dir}"
destdir="${build.classes}"
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimize}"
includeantruntime="false">
<include name="gnu/bytecode/"/>
<include name="gnu/commonlisp/lang/"/>
<include name="gnu/ecmascript/"/>
<include name="gnu/expr/"/>
<exclude name="gnu/expr/AbstractScriptEngineFactory.java" unless="has-java6"/>
<exclude name="gnu/expr/KawaScriptBindings.java" unless="has-java6"/>
<exclude name="gnu/expr/KawaScriptEngine.java" unless="has-java6"/>
<exclude name="kawa/standard/SchemeScriptEngineFactory.java" unless="has-java6"/>
<include name="gnu/kawa/functions/"/>
<include name="gnu/kawa/lispexpr/*.java"/>
<exclude name="gnu/kawa/lispexpr/MakeXmlElement.java" unless="${enable-xml}"/>
<exclude name="gnu/kawa/lispexpr/ReaderXmlElement.java" unless="${enable-xml}"/>
<exclude name="gnu/kawa/lispexpr/ResolveNamespace.java" unless="${enable-xml}"/>
<include name="gnu/kawa/reflect/"/>
<include name="gnu/kawa/util/"/>
<include name="gnu/lists/"/>
<include name="gnu/mapping/"/>
<include name="gnu/math/"/>
<include name="gnu/q2/lang/"/>
<include name="gnu/text/"/>
<include name="kawa/lang/"/>
<include name="kawa/standard/"/>
<include name="kawa/repl.java"/>
<include name="kawa/Shell.java"/>
<include name="kawa/Version.java"/>
<include name="kawa/Source*.java"/>
<include name="kawa/Telnet*.java"/>
<include name="kawa/Gui*.java" if="${with-swing}"/>
<include name="kawa/Repl*.java" if="${with-swing}"/>
<include name="gnu/kawa/xml/"/>
<include name="gnu/xml/"/>
<patternset refid="with-awt-${with-awt}"/>
<include name="gnu/kawa/models/" if="${with-awt}"/>
<include name="gnu/kawa/swingviews/" if="${with-swing}"/>
</javac>
</target>
<!--
Can't use apply's dependency checking because
Kawa can't handle a "-C" with no files listed.
Also that is probably the wrong thing because
Kawa needs all the files listed for its scanning.
-->
<target name="lib-scm-classes"
depends="java-classes">
<kawac failonerror="true" destdir="${build.classes}"
prefix="kawa.lib." modulestatic="run" language="scheme">
<arg line="--warn-undefined-variable --warn-unknown-member --warn-as-error"/>
<filelist dir="${src.dir}/kawa/lib">
<file name="prim_imports.scm"/>
<file name="prim_syntax.scm"/>
<file name="std_syntax.scm"/>
<file name="reflection.scm"/>
<file name="syntax.scm"/>
<file name="lists.scm"/>
<file name="case_syntax.scm"/>
<file name="DefineRecordType.scm"/>
<file name="ExceptionClasses.scm"/>
<file name="exceptions.scm"/>
<file name="kawa/expressions.scm"/>
<file name="compile_misc.scm"/>
<file name="compile_map.scm"/>
<file name="thread.scm"/>
<file name="characters.scm"/>
<file name="keywords.scm"/>
<file name="numbers.scm"/>
<file name="strings.scm"/>
<file name="parameters.scm"/>
<file name="parameterize.scm"/>
<file name="ports.scm"/>
<file name="files.scm"/>
<file name="misc.scm"/>
<file name="misc_syntax.scm"/>
<file name="vectors.scm"/>
<file name="uniform.scm"/>
<file name="bytevectors.scm"/>
<file name="arrays.scm"/>
<file name="system.scm"/>
<file name="kawa/pictures.scm"/>
<file name="kawa/process-keywords.scm"/>
<file name="kawa/string-cursors.scm"/>
<file name="kawa/quaternions.scm"/>
<file name="kawa/rotations.scm"/>
<file name="kawa/hashtable.scm"/>
<file name="kawa/regex.scm"/>
<file name="kawa/reflect.scm"/>
<file name="kawa/base.scm"/>
<file name="rnrs/hashtables.scm"/>
<file name="rnrs/lists.scm"/>
<file name="rnrs/arithmetic/bitwise.scm"/>
<file name="srfi95.scm"/>
<file name="rnrs/unicode.scm"/>
<file name="rnrs/sorting.scm"/>
<file name="rnrs/programs.scm"/>
<file name="scheme/base.scm"/>
<file name="scheme/case-lambda.scm"/>
<file name="scheme/char.scm"/>
<file name="scheme/complex.scm"/>
<file name="scheme/cxr.scm"/>
<file name="scheme/eval.scm"/>
<file name="scheme/file.scm"/>
<file name="scheme/inexact.scm"/>
<file name="scheme/lazy.scm"/>
<file name="scheme/load.scm"/>
<file name="scheme/process-context.scm"/>
<file name="scheme/read.scm"/>
<file name="scheme/repl.scm"/>
<file name="scheme/time.scm"/>
<file name="scheme/write.scm"/>
<file name="scheme/r5rs.scm"/>
<file name="trace.scm"/>
</filelist>
<fileset dir="${src.dir}/kawa/lib">
<include name="windows.scm" if="${with-swing}"/>
<include name="kawa/swing.scm" if="${with-swing}"/>
</fileset>
</kawac>
</target>
<target name="commonlisp-scm-classes"
depends="java-classes">
<kawac failonerror="true" destdir="${build.classes}"
prefix="gnu.commonlisp.lisp." modulestatic="run" language="scheme">
<filelist dir="${src.dir}/gnu/commonlisp/lisp">
<file name="PrimOps.scm"/>
</filelist>
</kawac>
<kawac failonerror="true" destdir="${build.classes}"
prefix="gnu.commonlisp.lisp." modulestatic="run" language="clisp">
<filelist dir="${src.dir}/gnu/commonlisp/lisp">
<file name="primitives.lisp"/>
</filelist>
</kawac>
</target>
<target name="slib-scm-classes" depends="java-classes">
<kawac failonerror="true" destdir="${build.classes}"
prefix="gnu.kawa.slib." modulestatic="run"
language="scheme">
<filelist dir="${src.dir}/gnu/kawa/slib">
<file name="enums.scm"/>
<file name="readtable.scm"/>
<file name="receive.scm"/>
<file name="srfi1.scm"/>
<file name="srfi2.scm"/>
<file name="conditions.scm"/>
<file name="srfi13.scm"/>
<file name="srfi14.scm"/>
<file name="srfi34.scm"/>
<file name="srfi37.scm"/>
<file name="srfi60.scm"/>
<file name="srfi69.scm"/>
<file name="pregexp.scm"/>
<file name="Streams.scm"/>
<file name="StreamsDerived.scm"/>
<file name="StreamsPrimitive.scm"/>
<file name="StreamsType.scm"/>
<file name="genwrite.scm"/>
<file name="pp.scm"/>
<file name="ppfile.scm"/>
<file name="printf.scm"/>
<file name="syntaxutils.scm"/>
<file name="cut.scm"/>
<file name="testing.scm"/>
</filelist>
<fileset dir="${src.dir}/gnu/kawa/slib">
<include name="gui.scm" if="${with-awt}"/>
<include name="swing.scm" if="${with-swing}"/>
</fileset>
</kawac>
</target>
<target name="xml-classes"
depends="build-settings, java-classes"
if="${enable-xml}">
<javac srcdir="${src.dir}"
destdir="${build.classes}"
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimize}"
includeantruntime="false">
<include name="gnu/xml/"/>
<include name="gnu/kawa/xml/"/>
<include name="gnu/kawa/xslt/"/>
<include name="gnu/xquery/lang/"/>
<exclude name="gnu/xquery/lang/XQueryScriptEngineFactory.java" unless="has-java6"/>
<include name="gnu/xquery/util/"/>
<patternset refid="with-sax2-${with-sax2}"/>
</javac>
<kawac failonerror="true" destdir="${build.classes}"
prefix="gnu.kawa.slib." modulestatic="run" language="scheme">
<fileset dir="${src.dir}/gnu/kawa/slib">
<include name="XML.scm"/>
<include name="XStrings.scm"/>
</fileset>
</kawac>
<kawac failonerror="true" destdir="${build.classes}"
prefix="gnu.xquery.util." modulestatic="run" language="scheme">
<fileset dir="${src.dir}/gnu/xquery/util">
<include name="Xutils.scm"/>
</fileset>
</kawac>
</target>
<target name="brl-classes"
depends="build-settings, java-classes"
if="${enable-brl}">
<javac srcdir="${src.dir}"
destdir="${build.classes}"
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimize}"
includeantruntime="false">
<include name="gnu/brl/"/>
<include name="gnu/kawa/brl/"/>
<patternset refid="with-sax2-${with-sax2}"/>
</javac>
<kawac failonerror="true" destdir="${build.classes}"
prefix="gnu.brl." modulestatic="run" language="scheme">
<fileset dir="${src.dir}/gnu/brl">
<include name="stringfun.scm"/>
</fileset>
</kawac>
<kawac failonerror="true" destdir="${build.classes}"
prefix="gnu.kawa.brl." modulestatic="run" language="scheme">
<fileset dir="${src.dir}/gnu/kawa/brl">
<include name="progfun.scm"/>
</fileset>
</kawac>
</target>
<target name="javafx-classes"
depends="build-settings, java-classes"
if="${do.enable.javafx}">
<javac srcdir="${src.dir}"
destdir="${build.classes}"
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimize}"
classpathref="build.classpath"
includeantruntime="false">
<include name="gnu/kawa/javafx/"/>
</javac>
<kawac failonerror="true" destdir="${build.classes}"
classpathref="build.classpath"
prefix="gnu.kawa.javafx." modulestatic="run" language="scheme">
<fileset dir="${src.dir}/gnu/kawa/javafx">
<include name="defs.scm"/>
<include name="GroupObjectBuilder.scm"/>
<include name="MakeScene.scm"/>
</fileset>
</kawac>
</target>
<target name="servlet-classes"
depends="build-settings, java-classes"
if="${enable-servlet}">
<javac srcdir="${src.dir}"
destdir="${build.classes}"
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimize}"
includeantruntime="false">
<include name="gnu/kawa/servlet/"/>
</javac>
<apply taskname="kawa" executable="java"
failonerror="true" parallel="true">
<!-- I don't quite get why the Java classpath has to be tacked on here, but it does. -->
<arg value="-classpath"/> <arg path="${build.classes}:${java.class.path}"/>
<arg value="kawa.repl"/>
<arg value="-d"/> <arg path="${build.classes}"/>
<arg line="-P gnu.kawa.slib. --module-static-run -C"/>
<fileset dir="${src.dir}/gnu/kawa/servlet">
<include name="HTTP.scm"/>
</fileset>
</apply>
</target>
<target name="android-classes"
depends="build-settings, java-classes"
if="${enable-android}">
<fail message="android.path (value: ${android.path}) is not a file">
<condition>
<not><available file="${android.path}"/></not>
</condition>
</fail>
<apply taskname="kawa" executable="java"
failonerror="true" parallel="true">
<!-- I don't quite get why the Java classpath has to be tacked on here, but it does. -->
<arg value="-classpath"/> <arg path="${android.path}:${build.classes}:${java.class.path}"/>
<arg value="kawa.repl"/>
<arg value="-d"/> <arg path="${build.classes}"/>
<arg line="-P gnu.kawa.android. --module-static-run -C"/>
<fileset dir="${src.dir}/gnu/kawa/android">
<include name="utils.scm"/>
<include name="defs.scm"/>
<include name="ViewBuilder.scm"/>
</fileset>
</apply>
</target>
<target name="jemacs-java-classes"
depends="build-settings, java-classes"
if="${enable-jemacs}">
<javac srcdir="${src.dir}"
destdir="${build.classes}"
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimize}"
includeantruntime="false">
<include name="gnu/jemacs/buffer/"/>
<include name="gnu/jemacs/lang/"/>
<include name="gnu/jemacs/swing/" if="${with-swing}"/>
</javac>
</target>
<target name="jemacs-swt-classes" depends="jemacs-classes">
<javac srcdir="${src.dir}" destdir="${build.classes}"
includeantruntime="false">
<include name="gnu/jemacs/swt/"/>
</javac>
</target>
<target name="jemacs-classes"
depends="build-settings, java-classes, jemacs-java-classes"
if="${enable-jemacs}">
<kawac failonerror="true" destdir="${build.classes}"
prefix="gnu.kawa.slib" modulestatic="run" language="scheme">
<fileset dir="${src.dir}/gnu/kawa/slib">
<include name="gui.scm"/>
</fileset>
</kawac>
<kawac failonerror="true" destdir="${build.classes}"
prefix="gnu.jemacs.lisp." language="scheme">
<filelist dir="${src.dir}/gnu/jemacs/lisp">
<file name="MiscOps.scm"/>
<file name="NumberOps.scm"/>
<file name="emacs.scm"/>
</filelist>
</kawac>
<kawac failonerror="true" destdir="${build.classes}"
prefix="gnu.jemacs.lisp." language="elisp">
<filelist dir="${src.dir}/gnu/jemacs/lisp">
<file name="primitives.el"/>
<file name="alist.el"/>
<file name="simple.el"/>
<file name="keymap.el"/>
<file name="keydefs.el"/>
<file name="hanoi.el"/>
<file name="rect.el"/>
<file name="editfns.el"/>
<file name="subr.el"/>
<file name="autoloads.el"/>
</filelist>
</kawac>
</target>
<target name="script-factory-scheme" if="${-needs-scripting-inf}">
<mkdir dir="META-INF/services"/>
<echo message="kawa.standard.SchemeScriptEngineFactory #Scheme
"
append="true"
file="META-INF/services/javax.script.ScriptEngineFactory"/>
</target>
<target name="script-factory-xquery" if="${-needs-scripting-inf-xquery}">
<mkdir dir="META-INF/services"/>
<echo message="gnu.xquery.lang.XQueryScriptEngineFactory #XQuery
"
append="true"
file="META-INF/services/javax.script.ScriptEngineFactory"/>
</target>
<target name="jar" depends="script-factory-scheme,script-factory-xquery">
<jar jarfile="${dist.kawa.jar}"
manifest="${src.dir}/jar-manifest">
<fileset refid="build.classes"/>
<fileset dir="${build.classes}">
<include name="META-INF/services/*"/>
</fileset>
</jar>
</target>
<target name="kawa.bat" depends="build-settings" if="isWindows">
<copy file="bin/kawa.bat.in" toFile="bin/kawa.bat">
<filterset begintoken="%" endtoken="%">
<filter token="DEFAULT_KAWA_VERSION" value="${version}"/>
<filter token="DEFAULT_EXTRA_PATH" value="${extra.classpath};"/>
</filterset>
</copy>
</target>