This repository has been archived by the owner on Feb 23, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 58
/
build.xml
1999 lines (1799 loc) · 78.3 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" encoding="UTF-8"?>
<project name="sabbus" default="build">
<description>
SuperSabbus for Scala core, builds the scala library and compiler. It can also package it as a simple distribution, tests it for stable bootstrapping and against the Scala test suite.
</description>
<!-- ===========================================================================
END-USER TARGETS
============================================================================ -->
<target name="build" depends="pack.done"
description="Builds the Scala compiler and library. Executables are in 'build/pack/bin'."/>
<target name="build-opt"
description="Builds the optimised Scala compiler and library. Executables are in 'build/pack/bin'.">
<antcall target="build">
<param name="scalac.args.optimise" value="-optimise"/>
</antcall>
</target>
<target name="clean" depends="quick.clean"
description="Removes binaries of compiler and library. Distributions are untouched."/>
<target name="test" depends="test.done"
description="Runs test suite and bootstrapping test on Scala compiler and library."/>
<target name="test-opt"
description="Runs test suite and bootstrapping test, everything is optimised (compiler, library, tests).">
<antcall target="test">
<param name="scalac.args.optimise" value="-optimise"/>
</antcall>
</target>
<target name="docs" depends="docs.done"
description="Builds documentation for the Scala library. Scaladoc is in 'build/scaladoc/library'."/>
<target name="docscomp" depends="docs.comp"
description="Builds documentation for the Scala compiler and library. Scaladoc is in 'build/scaladoc'."/>
<target name="docsclean" depends="docs.clean"
description="Removes generated documentation. Distributions are untouched."/>
<target name="dist"
description="Makes a new distribution and tests it. Will remove existing binaries and documentation.">
<antcall target="locker.clean"/>
<antcall target="docs.clean"/>
<antcall target="all.done"/>
</target>
<target name="dist-opt"
description="Makes a new optimised distribution and tests it. Will remove existing binaries and documentation.">
<antcall target="dist">
<param name="scalac.args.optimise" value="-optimise"/>
</antcall>
</target>
<target name="fastdist" depends="dist.done"
description="Makes a new distribution without testing it or removing partially build elements."/>
<target name="fastdist-opt"
description="Makes a new optimised distribution without testing it or removing partially build elements.">
<antcall target="fastdist">
<param name="scalac.args.optimise" value="-optimise"/>
</antcall>
</target>
<target name="distclean" depends="dist.clean"
description="Removes all distributions. Binaries and documentation are untouched."/>
<target name="replacestarr"
description="Replaces the Starr compiler and library by fresh ones built from current sources and tests them.">
<fail message="This target is not available on Windows. Use 'ant replacestarrwin' instead.">
<condition>
<os family="windows"/>
</condition>
</fail>
<antcall target="locker.clean"/>
<antcall target="pack.done"/>
<antcall target="starr.done"/>
<antcall target="locker.clean"/>
<antcall target="test.done"/>
</target>
<target name="replacestarr-opt"
description="Replaces the Starr compiler and library by fresh, optimised ones built from current sources and tests them.">
<antcall target="replacestarr">
<param name="scalac.args.optimise" value="-optimise"/>
</antcall>
</target>
<!-- Ant on Windows is not able to delete jar files that are referenced in any <path>.
See ticket 1290 on trac. -->
<target name="replacestarrwin"
description="Creates a new Starr on Windows. Manually execute 'ant locker.clean build' first!">
<fail message="This target is only available on Windows. Use 'ant replacestarr' instead.">
<condition>
<not><os family="windows"/></not>
</condition>
</fail>
<echo message="CAUTION: Make sure to execute 'ant locker.clean build' prior to calling 'replacestarrwin'."/>
<antcall target="starr.done"/>
<antcall target="locker.clean"/>
<antcall target="test.done"/>
</target>
<target name="replacelocker"
description="Replaces the Locker compiler and library by fresh ones built from current sources.">
<antcall target="palo.clean"/>
<antcall target="unlocklocker"/>
</target>
<target name="replacelocker-opt"
description="Replaces the Locker compiler and library by fresh, optimised ones built from current sources.">
<antcall target="replacelocker">
<param name="scalac.args.optimise" value="-optimise"/>
</antcall>
</target>
<target name="unlocklocker"
description="Unlocks Locker, allowing its compiler and library to be rebuilt">
<antcall target="locker.unlock"/>
<antcall target="palo.done"/>
</target>
<target name="newlibs"
description="Requires libraries (MSIL, FJBG) to be rebuilt. Add this target before any other if class file format is incompatible.">
<property name="libs.outdated" value="yes"/>
</target>
<target name="newforkjoin"
description="Requires forkjoin library to be rebuilt. Add this target before any other if class file format is incompatible.">
<property name="forkjoin.outdated" value="yes"/>
</target>
<!-- ===========================================================================
PROPERTIES
============================================================================ -->
<property environment="env"/>
<!-- Prevents system classpath from being used -->
<property name="build.sysclasspath" value="ignore"/>
<!-- Defines the repository layout -->
<property name="docs.dir" value="${basedir}/docs"/>
<property name="lib.dir" value="${basedir}/lib"/>
<property name="lib-ant.dir" value="${lib.dir}/ant"/>
<property name="src.dir" value="${basedir}/src"/>
<property name="partest.dir" value="${basedir}/test"/>
<!-- For developers: any jars placed in this dir will be added to the classpath
of all targets and copied into quick/pack/etc builds. -->
<property name="lib-extra.dir" value="${lib.dir}/extra"/>
<!-- Loads custom properties definitions -->
<property file="${basedir}/build.properties"/>
<!-- Additional command line arguments for scalac. They are added to all build targets -->
<property name="scalac.args" value=""/>
<property name="javac.args" value=""/>
<!-- Sets location of pre-compiled libraries -->
<property name="lib.starr.jar" value="${lib.dir}/scala-library.jar"/>
<property name="comp.starr.jar" value="${lib.dir}/scala-compiler.jar"/>
<property name="jline.jar" value="${lib.dir}/jline.jar"/>
<property name="ant.jar" value="${ant.home}/lib/ant.jar"/>
<property name="scalacheck.jar" value="${lib.dir}/scalacheck.jar"/>
<!-- Sets location of build folders -->
<property name="build.dir" value="${basedir}/build"/>
<property name="build-locker.dir" value="${build.dir}/locker"/>
<property name="build-palo.dir" value="${build.dir}/palo"/>
<property name="build-quick.dir" value="${build.dir}/quick"/>
<property name="build-pack.dir" value="${build.dir}/pack"/>
<property name="build-strap.dir" value="${build.dir}/strap"/>
<property name="build-docs.dir" value="${build.dir}/scaladoc"/>
<property name="build-libs.dir" value="${build.dir}/libs"/>
<property name="dists.dir" value="${basedir}/dists"/>
<property name="copyright.string" value="Copyright 2002-2011, LAMP/EPFL"/>
<property name="partest.version.number" value="0.9.2"/>
<!-- These are NOT the flags used to run SuperSabbus, but the ones written
into the script runners created with scala.tools.ant.ScalaTool -->
<property name="java.flags" value="-Xmx256M -Xms32M"/>
<property name="jvm.opts" value=""/>
<!-- if ANT_OPTS is already set by the environment, it will be unaltered,
but if it is unset it will take this default value. -->
<property name="env.ANT_OPTS" value="-Xms1536M -Xmx1536M -Xss1M -XX:MaxPermSize=192M -XX:+UseParallelGC" />
<!-- to find max heap usage: -Xaprof ; currently at 980M for locker.comp -->
<echo message="Forking with JVM opts: ${env.ANT_OPTS} ${jvm.opts}" />
<property
name="scalacfork.jvmargs"
value="${env.ANT_OPTS} ${jvm.opts}"/>
<!-- ===========================================================================
INITIALISATION
============================================================================ -->
<target name="init">
<!-- scalac.args.optimise is selectively overridden in certain antcall tasks. -->
<property name="scalac.args.optimise" value=""/>
<!-- scalac.args.quickonly are added to quick.* targets but not others (particularly, locker.)
This is to facilitate testing new command line options which do not yet exist in starr. -->
<property name="scalac.args.quickonly" value=""/>
<property name="scalac.args.all" value="${scalac.args} ${scalac.args.optimise}"/>
<property name="scalac.args.quick" value="${scalac.args.all} ${scalac.args.quickonly}"/>
<!-- Setting-up Ant contrib tasks -->
<taskdef resource="net/sf/antcontrib/antlib.xml" classpath="${lib.dir}/ant/ant-contrib.jar"/>
<!-- This is the start time for the distribution -->
<tstamp prefix="time">
<format property="human" pattern="d MMMM yyyy, HH:mm:ss"/>
<format property="short" pattern="yyyyMMddHHmmss"/>
</tstamp>
<!-- Find out whether we are running on Windows -->
<condition property="os.win">
<os family="windows"/>
</condition>
<exec osfamily="unix" executable="tools/get-scala-revision" outputproperty="svn.number" failifexecutionfails="false" />
<exec osfamily="windows" executable="tools/get-scala-revision.bat" outputproperty="svn.number" failifexecutionfails="false" />
<!-- some default in case something went wrong getting the revision -->
<property name="svn.number" value="0"/>
<property name="init.avail" value="yes"/>
<!-- Generating version number -->
<property file="${basedir}/build.number"/>
<property
name="version.number"
value="${version.major}.${version.minor}.${version.patch}.r${svn.number}-b${time.short}"/>
<!-- And print-out what we are building -->
<echo level="info" message="Build number is '${version.number}'"/>
<echo level="info" message="Built ${time.human} from revision ${svn.number} with ${java.vm.name} ${java.version}"/>
<!-- Local libs (developer use.) -->
<mkdir dir="${lib-extra.dir}"/>
<path id="lib.extra">
<!-- needs ant 1.7.1 -->
<!-- <fileset dir="${lib-extra.dir}" erroronmissingdir="false"> -->
<fileset dir="${lib-extra.dir}">
<include name="**/*.jar"/>
</fileset>
</path>
<!-- Auxiliary libs placed on every classpath. -->
<path id="aux.libs">
<fileset dir="${lib.dir}">
<include name="fjbg.jar"/>
<include name="msil.jar"/>
<include name="forkjoin.jar"/>
</fileset>
<pathelement location="${ant.jar}"/>
<path refid="lib.extra"/>
</path>
<!-- Define tasks that can be run with Starr -->
<path id="starr.classpath">
<pathelement location="${lib.starr.jar}"/>
<pathelement location="${comp.starr.jar}"/>
<path refid="aux.libs"/>
</path>
<!-- What to have on the compilation path when compiling during certain phases -->
<path id="quick.compilation.path">
<pathelement location="${build-quick.dir}/classes/library"/>
<pathelement location="${lib.dir}/forkjoin.jar"/>
<path refid="lib.extra"/>
</path>
<path id="strap.compilation.path">
<pathelement location="${build-strap.dir}/classes/library"/>
<pathelement location="${lib.dir}/forkjoin.jar"/>
<path refid="lib.extra"/>
</path>
<taskdef resource="scala/tools/ant/sabbus/antlib.xml" classpathref="starr.classpath"/>
</target>
<!-- ===========================================================================
LOCAL REFERENCE BUILD (LOCKER)
============================================================================ -->
<target name="locker.start" depends="init">
<condition property="locker.available">
<available file="${build-locker.dir}/all.complete"/>
</condition>
</target>
<target name="locker.pre-lib" depends="locker.start" unless="locker.available">
<condition property="locker.lib.needed">
<not><available file="${build-locker.dir}/library.complete"/></not>
</condition>
</target>
<target name="locker.lib" depends="locker.pre-lib" if="locker.lib.needed">
<stopwatch name="locker.lib.timer"/>
<mkdir dir="${build-locker.dir}/classes/library"/>
<javac
srcdir="${src.dir}/library"
destdir="${build-locker.dir}/classes/library"
classpath="${build-locker.dir}/classes/library"
includes="**/*.java"
target="1.5" source="1.5">
<compilerarg line="${javac.args}"/>
</javac>
<!-- NOTE: Potential problem with maximal command line length on Windows
(32768 characters for XP, since executed with Java's "exec"). See
src/build/msil.xml in msil branch for more details. -->
<scalacfork
destdir="${build-locker.dir}/classes/library"
compilerpathref="starr.classpath"
srcpath="${src.dir}/library"
params="${scalac.args.all}"
srcdir="${src.dir}/library"
jvmargs="${scalacfork.jvmargs}">
<include name="**/*.scala"/>
<compilationpath>
<pathelement location="${build-locker.dir}/classes/library"/>
<pathelement location="${lib.dir}/forkjoin.jar"/>
</compilationpath>
</scalacfork>
<propertyfile file="${build-locker.dir}/classes/library/library.properties">
<entry key="version.number" value="${version.number}"/>
<entry key="copyright.string" value="${copyright.string}"/>
</propertyfile>
<copy todir="${build-locker.dir}/classes/library">
<fileset dir="${src.dir}/library">
<include name="**/*.tmpl"/>
<include name="**/*.xml"/>
<include name="**/*.js"/>
<include name="**/*.css"/>
</fileset>
</copy>
<touch file="${build-locker.dir}/library.complete" verbose="no"/>
<stopwatch name="locker.lib.timer" action="total"/>
</target>
<target name="locker.pre-comp" depends="locker.lib" unless="locker.available">
<condition property="locker.comp.needed">
<not><available file="${build-locker.dir}/compiler.complete"/></not>
</condition>
</target>
<target name="locker.comp" depends="locker.pre-comp" if="locker.comp.needed">
<stopwatch name="locker.comp.timer"/>
<mkdir dir="${build-locker.dir}/classes/compiler"/>
<scalacfork
destdir="${build-locker.dir}/classes/compiler"
compilerpathref="starr.classpath"
params="${scalac.args.all}"
srcdir="${src.dir}/compiler"
jvmargs="${scalacfork.jvmargs}">
<include name="**/*.scala"/>
<compilationpath>
<pathelement location="${build-locker.dir}/classes/library"/>
<pathelement location="${build-locker.dir}/classes/compiler"/>
<path refid="aux.libs"/>
<pathelement location="${jline.jar}"/>
</compilationpath>
</scalacfork>
<propertyfile file="${build-locker.dir}/classes/compiler/compiler.properties">
<entry key="version.number" value="${version.number}"/>
<entry key="copyright.string" value="${copyright.string}"/>
</propertyfile>
<copy todir="${build-locker.dir}/classes/compiler">
<fileset dir="${src.dir}/compiler">
<include name="**/*.tmpl"/>
<include name="**/*.xml"/>
<include name="**/*.js"/>
<include name="**/*.html"/>
<include name="**/*.css"/>
<include name="**/*.properties"/>
<include name="**/*.swf"/>
<include name="**/*.png"/>
<include name="**/*.gif"/>
</fileset>
</copy>
<touch file="${build-locker.dir}/compiler.complete" verbose="no"/>
<stopwatch name="locker.comp.timer" action="total"/>
</target>
<target name="locker.done" depends="locker.comp">
<touch file="${build-locker.dir}/all.complete" verbose="no"/>
<path id="locker.classpath">
<pathelement location="${build-locker.dir}/classes/library"/>
<pathelement location="${build-locker.dir}/classes/compiler"/>
<path refid="aux.libs"/>
</path>
<path id="quick.classpath">
<pathelement location="${build-quick.dir}/classes/library"/>
<pathelement location="${build-quick.dir}/classes/compiler"/>
<path refid="aux.libs"/>
</path>
</target>
<target name="locker.clean" depends="palo.clean">
<delete dir="${build-locker.dir}" includeemptydirs="yes" quiet="yes" failonerror="no"/>
</target>
<target name="locker.unlock">
<delete file="${build-locker.dir}/all.complete"/>
<delete file="${build-locker.dir}/library.complete"/>
<delete file="${build-locker.dir}/compiler.complete"/>
</target>
<!-- ===========================================================================
PACKED LOCKER BUILD (PALO)
============================================================================ -->
<target name="palo.start" depends="locker.done"/>
<target name="palo.pre-lib" depends="palo.start">
<uptodate
property="palo.lib.available"
targetfile="${build-palo.dir}/lib/scala-library.jar"
srcfile="${build-locker.dir}/library.complete"/>
</target>
<target name="palo.lib" depends="palo.pre-lib" unless="palo.lib.available">
<mkdir dir="${build-palo.dir}/lib"/>
<jar destfile="${build-palo.dir}/lib/scala-library.jar">
<fileset dir="${build-locker.dir}/classes/library"/>
</jar>
</target>
<target name="palo.pre-comp" depends="palo.lib">
<uptodate
property="palo.comp.available"
targetfile="${build-palo.dir}/lib/scala-compiler.jar"
srcfile="${build-locker.dir}/compiler.complete"/>
</target>
<target name="palo.comp" depends="palo.pre-comp" unless="palo.comp.available">
<mkdir dir="${build-palo.dir}/lib"/>
<jar destfile="${build-palo.dir}/lib/scala-compiler.jar" manifest="${basedir}/META-INF/MANIFEST.MF">
<fileset dir="${build-locker.dir}/classes/compiler"/>
<!-- filemode / dirmode: see trac ticket #1294 -->
</jar>
</target>
<target name="palo.done" depends="palo.comp">
</target>
<target name="palo.clean" depends="quick.clean">
<delete dir="${build-palo.dir}" includeemptydirs="yes" quiet="yes" failonerror="no"/>
</target>
<!-- ===========================================================================
QUICK BUILD (QUICK)
============================================================================ -->
<target name="quick.start" depends="locker.done"/>
<target name="quick.pre-lib" depends="quick.start">
<uptodate property="quick.lib.available" targetfile="${build-quick.dir}/library.complete">
<srcfiles dir="${src.dir}">
<include name="library/**"/>
<include name="dbc/**"/>
<include name="actors/**"/>
<include name="continuations/**"/>
<include name="swing/**"/>
</srcfiles>
</uptodate>
</target>
<target name="quick.lib" depends="quick.pre-lib" unless="quick.lib.available">
<stopwatch name="quick.lib.timer"/>
<mkdir dir="${build-quick.dir}/classes/library"/>
<javac
srcdir="${src.dir}/library"
destdir="${build-quick.dir}/classes/library"
classpath="${build-quick.dir}/classes/library"
includes="**/*.java"
target="1.5" source="1.5">
<compilerarg line="${javac.args}"/>
</javac>
<javac
srcdir="${src.dir}/actors"
destdir="${build-quick.dir}/classes/library"
classpath="${build-quick.dir}/classes/library"
includes="**/*.java"
target="1.5" source="1.5">
<compilerarg line="${javac.args}"/>
</javac>
<scalacfork
destdir="${build-quick.dir}/classes/library"
compilerpathref="locker.classpath"
srcpath="${src.dir}/library"
params="${scalac.args.quick}"
srcdir="${src.dir}/library"
jvmargs="${scalacfork.jvmargs}">
<include name="**/*.scala"/>
<compilationpath refid="quick.compilation.path"/>
</scalacfork>
<scalacfork
destdir="${build-quick.dir}/classes/library"
compilerpathref="locker.classpath"
params="${scalac.args.quick}"
srcdir="${src.dir}/actors"
jvmargs="${scalacfork.jvmargs}">
<include name="**/*.scala"/>
<compilationpath refid="quick.compilation.path"/>
</scalacfork>
<scalacfork
destdir="${build-quick.dir}/classes/library"
compilerpathref="locker.classpath"
params="${scalac.args.quick}"
srcdir="${src.dir}/dbc"
jvmargs="${scalacfork.jvmargs}">
<include name="**/*.scala"/>
<compilationpath refid="quick.compilation.path"/>
</scalacfork>
<scalacfork
destdir="${build-quick.dir}/classes/library"
compilerpathref="locker.classpath"
params="${scalac.args.quick}"
srcdir="${src.dir}/swing"
jvmargs="${scalacfork.jvmargs}">
<include name="**/*.scala"/>
<compilationpath refid="quick.compilation.path"/>
</scalacfork>
<propertyfile file="${build-quick.dir}/classes/library/library.properties">
<entry key="version.number" value="${version.number}"/>
<entry key="copyright.string" value="${copyright.string}"/>
</propertyfile>
<copy todir="${build-quick.dir}/classes/library">
<fileset dir="${src.dir}/library">
<include name="**/*.tmpl"/>
<include name="**/*.xml"/>
<include name="**/*.js"/>
<include name="**/*.css"/>
</fileset>
</copy>
<touch file="${build-quick.dir}/library.complete" verbose="no"/>
<stopwatch name="quick.lib.timer" action="total"/>
</target>
<target name="quick.newlibs" depends="quick.lib" if="libs.outdated">
<antcall target="libs.done" inheritRefs="true"/>
<property name="fjbg.jar" value="${build-libs.dir}/fjbg.jar"/>
<property name="msil.jar" value="${build-libs.dir}/msil.jar"/>
</target>
<target name="quick.libs" depends="quick.newlibs" unless="libs.outdated">
<property name="fjbg.jar" value="${lib.dir}/fjbg.jar"/>
<property name="msil.jar" value="${lib.dir}/msil.jar"/>
</target>
<target name="quick.newforkjoin" depends="quick.libs" if="forkjoin.outdated">
<antcall target="forkjoin.done" inheritRefs="true"/>
<property name="forkjoin.jar" value="${build-libs.dir}/forkjoin.jar"/>
</target>
<target name="quick.forkjoin" depends="quick.newforkjoin" unless="forkjoin.outdated">
<property name="forkjoin.jar" value="${lib.dir}/forkjoin.jar"/>
</target>
<target name="quick.pre-comp" depends="quick.forkjoin">
<uptodate property="quick.comp.available" targetfile="${build-quick.dir}/compiler.complete">
<srcfiles dir="${src.dir}/compiler"/>
</uptodate>
</target>
<target name="quick.comp" depends="quick.pre-comp" unless="quick.comp.available">
<stopwatch name="quick.comp.timer"/>
<mkdir dir="${build-quick.dir}/classes/compiler"/>
<scalacfork
destdir="${build-quick.dir}/classes/compiler"
compilerpathref="locker.classpath"
params="${scalac.args.quick}"
srcdir="${src.dir}/compiler"
jvmargs="${scalacfork.jvmargs}">
<include name="**/*.scala"/>
<compilationpath>
<pathelement location="${build-quick.dir}/classes/library"/>
<pathelement location="${build-quick.dir}/classes/compiler"/>
<path refid="aux.libs"/>
<pathelement location="${jline.jar}"/>
</compilationpath>
</scalacfork>
<propertyfile file="${build-quick.dir}/classes/compiler/compiler.properties">
<entry key="version.number" value="${version.number}"/>
<entry key="copyright.string" value="${copyright.string}"/>
</propertyfile>
<copy todir="${build-quick.dir}/classes/compiler">
<fileset dir="${src.dir}/compiler">
<include name="**/*.tmpl"/>
<include name="**/*.xml"/>
<include name="**/*.js"/>
<include name="**/*.css"/>
<include name="**/*.html"/>
<include name="**/*.properties"/>
<include name="**/*.swf"/>
<include name="**/*.png"/>
<include name="**/*.gif"/>
<include name="**/*.txt"/>
</fileset>
</copy>
<touch file="${build-quick.dir}/compiler.complete" verbose="no"/>
<stopwatch name="quick.comp.timer" action="total"/>
</target>
<target name="quick.pre-plugins" depends="quick.comp">
<uptodate property="quick.plugins.available" targetfile="${build-quick.dir}/plugins.complete">
<srcfiles dir="${src.dir}/continuations"/>
</uptodate>
</target>
<target name="quick.plugins" depends="quick.pre-plugins" unless="quick.plugins.available">
<stopwatch name="quick.plugins.timer"/>
<mkdir dir="${build-quick.dir}/classes/continuations-plugin"/>
<scalacfork
destdir="${build-quick.dir}/classes/continuations-plugin"
compilerpathref="quick.classpath"
params="${scalac.args.quick}"
srcdir="${src.dir}/continuations/plugin"
jvmargs="${scalacfork.jvmargs}">
<include name="**/*.scala"/>
<compilationpath>
<pathelement location="${build-quick.dir}/classes/library"/>
<pathelement location="${build-quick.dir}/classes/compiler"/>
<pathelement location="${build-quick.dir}/classes/continuations-plugin"/>
<path refid="aux.libs"/>
</compilationpath>
</scalacfork>
<copy
file="${src.dir}/continuations/plugin/scalac-plugin.xml"
todir="${build-quick.dir}/classes/continuations-plugin"/>
<!-- not very nice to create jar here but needed to load plugin -->
<mkdir dir="${build-quick.dir}/misc/scala-devel/plugins"/>
<jar destfile="${build-quick.dir}/misc/scala-devel/plugins/continuations.jar">
<fileset dir="${build-quick.dir}/classes/continuations-plugin"/>
</jar>
<!-- might split off library part into its own ant target -->
<scalacfork
destdir="${build-quick.dir}/classes/library"
compilerpathref="quick.classpath"
params="${scalac.args.quick} -Xplugin-require:continuations -P:continuations:enable"
srcdir="${src.dir}/continuations/library"
jvmargs="${scalacfork.jvmargs}">
<include name="**/*.scala"/>
<compilationpath refid="quick.compilation.path"/>
<compilerarg value="-Xpluginsdir"/>
<compilerarg file="${build-quick.dir}/misc/scala-devel/plugins"/>
</scalacfork>
<touch file="${build-quick.dir}/plugins.complete" verbose="no"/>
<stopwatch name="quick.plugins.timer" action="total"/>
</target>
<target name="quick.scalacheck" depends="quick.plugins">
<mkdir dir="${build-quick.dir}/classes/scalacheck"/>
<scalacfork
destdir="${build-quick.dir}/classes/scalacheck"
compilerpathref="quick.classpath"
params="${scalac.args.all}"
srcdir="${src.dir}/scalacheck"
jvmargs="${scalacfork.jvmargs}">
<include name="**/*.scala"/>
<compilationpath>
<pathelement location="${build-quick.dir}/classes/library"/>
<pathelement location="${build-quick.dir}/classes/scalacheck"/>
</compilationpath>
</scalacfork>
</target>
<target name="quick.pre-scalap" depends="quick.scalacheck">
<uptodate property="quick.scalap.available" targetfile="${build-quick.dir}/scalap.complete">
<srcfiles dir="${src.dir}/scalap"/>
</uptodate>
</target>
<target name="quick.scalap" depends="quick.pre-scalap" unless="quick.scalap.available">
<stopwatch name="quick.scalap.timer"/>
<mkdir dir="${build-quick.dir}/classes/scalap"/>
<scalacfork
destdir="${build-quick.dir}/classes/scalap"
compilerpathref="quick.classpath"
params="${scalac.args.quick}"
srcdir="${src.dir}/scalap"
jvmargs="${scalacfork.jvmargs}">
<include name="**/*.scala"/>
<compilationpath>
<pathelement location="${build-quick.dir}/classes/library"/>
<pathelement location="${build-quick.dir}/classes/compiler"/>
<pathelement location="${build-quick.dir}/classes/scalap"/>
<pathelement location="${build-quick.dir}/classes/partest"/>
<pathelement location="${ant.jar}"/>
<pathelement location="${lib.dir}/forkjoin.jar"/>
</compilationpath>
</scalacfork>
<touch file="${build-quick.dir}/scalap.complete" verbose="no"/>
<stopwatch name="quick.scalap.timer" action="total"/>
</target>
<target name="quick.pre-partest" depends="quick.scalap">
<uptodate property="quick.partest.available" targetfile="${build-quick.dir}/partest.complete">
<srcfiles dir="${src.dir}/partest"/>
</uptodate>
</target>
<target name="quick.partest" depends="quick.pre-partest" unless="quick.partest.available">
<stopwatch name="quick.partest.timer"/>
<mkdir dir="${build-quick.dir}/classes/partest"/>
<javac
srcdir="${src.dir}/partest"
destdir="${build-quick.dir}/classes/partest"
target="1.5" source="1.5">
<classpath>
<pathelement location="${build-quick.dir}/classes/library"/>
<pathelement location="${build-quick.dir}/classes/compiler"/>
<pathelement location="${build-quick.dir}/classes/scalap"/>
<pathelement location="${build-quick.dir}/classes/partest"/>
</classpath>
<include name="**/*.java"/>
<compilerarg line="${javac.args}"/>
</javac>
<scalacfork
destdir="${build-quick.dir}/classes/partest"
compilerpathref="quick.classpath"
params="${scalac.args.quick}"
srcdir="${src.dir}/partest"
jvmargs="${scalacfork.jvmargs}">
<include name="**/*.scala"/>
<compilationpath>
<pathelement location="${build-quick.dir}/classes/library"/>
<pathelement location="${build-quick.dir}/classes/compiler"/>
<pathelement location="${build-quick.dir}/classes/scalap"/>
<pathelement location="${build-quick.dir}/classes/partest"/>
<pathelement location="${ant.jar}"/>
<pathelement location="${lib.dir}/forkjoin.jar"/>
<pathelement location="${scalacheck.jar}"/>
</compilationpath>
</scalacfork>
<propertyfile file="${build-quick.dir}/classes/partest/partest.properties">
<entry key="version.number" value="${partest.version.number}"/>
<entry key="copyright.string" value="${copyright.string}"/>
</propertyfile>
<copy todir="${build-quick.dir}/classes/partest">
<fileset dir="${src.dir}/partest">
<include name="**/*.xml"/>
</fileset>
</copy>
<touch file="${build-quick.dir}/partest.complete" verbose="no"/>
<stopwatch name="quick.partest.timer" action="total"/>
</target>
<target name="quick.pre-bin" depends="quick.partest">
<condition property="quick.bin.available">
<isset property="quick.comp.available"/>
</condition>
</target>
<target name="quick.bin" depends="quick.pre-bin" unless="quick.bin.available">
<path id="quick.bin.classpath">
<pathelement location="${build-quick.dir}/classes/library"/>
<pathelement location="${build-quick.dir}/classes/compiler"/>
<pathelement location="${build-quick.dir}/classes/scalap"/>
<path refid="aux.libs"/>
<pathelement location="${jline.jar}"/>
</path>
<taskdef name="quick-bin" classname="scala.tools.ant.ScalaTool" classpathref="quick.bin.classpath"/>
<mkdir dir="${build-quick.dir}/bin"/>
<quick-bin
file="${build-quick.dir}/bin/scala"
class="scala.tools.nsc.MainGenericRunner"
javaFlags="${java.flags}"
classpathref="quick.bin.classpath"/>
<quick-bin
file="${build-quick.dir}/bin/scalac"
class="scala.tools.nsc.Main"
javaFlags="${java.flags}"
classpathref="quick.bin.classpath"/>
<quick-bin
file="${build-quick.dir}/bin/scaladoc"
class="scala.tools.nsc.ScalaDoc"
javaFlags="${java.flags}"
classpathref="quick.bin.classpath"/>
<quick-bin
file="${build-quick.dir}/bin/fsc"
class="scala.tools.nsc.CompileClient"
javaFlags="${java.flags}"
classpathref="quick.bin.classpath"/>
<quick-bin
file="${build-quick.dir}/bin/scalap"
class="scala.tools.scalap.Main"
javaFlags="${java.flags}"
classpathref="quick.bin.classpath"/>
<chmod perm="ugo+rx" file="${build-quick.dir}/bin/scala"/>
<chmod perm="ugo+rx" file="${build-quick.dir}/bin/scalac"/>
<chmod perm="ugo+rx" file="${build-quick.dir}/bin/scaladoc"/>
<chmod perm="ugo+rx" file="${build-quick.dir}/bin/fsc"/>
<chmod perm="ugo+rx" file="${build-quick.dir}/bin/scalap"/>
<touch file="${build-quick.dir}/bin.complete" verbose="no"/>
</target>
<target name="quick.done" depends="quick.bin">
<path id="quick.classpath">
<pathelement location="${build-quick.dir}/classes/library"/>
<pathelement location="${build-quick.dir}/classes/compiler"/>
<path refid="aux.libs"/>
</path>
</target>
<target name="quick.clean" depends="libs.clean">
<delete dir="${build-quick.dir}" includeemptydirs="yes" quiet="yes" failonerror="no"/>
</target>
<!-- ===========================================================================
PACKED QUICK BUILD (PACK)
============================================================================ -->
<target name="pack.start" depends="quick.done"/>
<target name="pack.pre-lib" depends="pack.start">
<uptodate
property="pack.lib.available"
targetfile="${build-pack.dir}/lib/scala-library.jar"
srcfile="${build-quick.dir}/library.complete"/>
</target>
<target name="pack.lib" depends="pack.pre-lib" unless="pack.lib.available">
<mkdir dir="${build-pack.dir}/lib"/>
<jar destfile="${build-pack.dir}/lib/scala-library.jar">
<fileset dir="${build-quick.dir}/classes/library">
<exclude name="scala/dbc/**"/>
<exclude name="scala/swing/**"/>
</fileset>
<zipfileset dirmode="755" filemode="644" src="${forkjoin.jar}"/>
</jar>
<jar destfile="${build-pack.dir}/lib/scala-dbc.jar">
<fileset dir="${build-quick.dir}/classes/library">
<include name="scala/dbc/**"/>
</fileset>
</jar>
<jar destfile="${build-pack.dir}/lib/scala-swing.jar">
<fileset dir="${build-quick.dir}/classes/library">
<include name="scala/swing/**"/>
</fileset>
<fileset dir="${src.dir}/swing">
<include name="scala/swing/test/images/**"/>
</fileset>
</jar>
</target>
<target name="pack.pre-comp" depends="pack.lib">
<uptodate
property="pack.comp.available"
targetfile="${build-pack.dir}/lib/scala-compiler.jar"
srcfile="${build-quick.dir}/compiler.complete"/>
</target>
<target name="pack.comp" depends="pack.pre-comp" unless="pack.comp.available">
<mkdir dir="${build-pack.dir}/META-INF"/>
<copy file="META-INF/MANIFEST.MF" toDir="${build-pack.dir}/META-INF"/>
<manifest file="${build-pack.dir}/META-INF/MANIFEST.MF" mode="update">
<attribute name="Bundle-Version" value="${version.number}"/>
</manifest>
<mkdir dir="${build-pack.dir}/lib"/>
<jar destfile="${build-pack.dir}/lib/scala-compiler.jar" manifest="${build-pack.dir}/META-INF/MANIFEST.MF">
<fileset dir="${build-quick.dir}/classes/compiler"/>
<!-- filemode / dirmode: see trac ticket #1294 -->
<zipfileset dirmode="755" filemode="644" src="${fjbg.jar}"/>
<zipfileset dirmode="755" filemode="644" src="${msil.jar}"/>
</jar>
<copy file="${jline.jar}" toDir="${build-pack.dir}/lib"/>
<copy todir="${build-pack.dir}/lib">
<fileset dir="${lib-extra.dir}">
<include name="**/*.jar"/>
</fileset>
</copy>
</target>
<target name="pack.pre-plugins" depends="pack.comp">
<uptodate
property="pack.plugins.available"
targetfile="${build-pack.dir}/misc/scala-devel/plugins/continuations.jar"
srcfile="${build-quick.dir}/plugins.complete"/>
</target>
<target name="pack.plugins" depends="pack.pre-plugins" unless="pack.plugins.available">
<mkdir dir="${build-pack.dir}/misc/scala-devel/plugins"/>
<jar destfile="${build-pack.dir}/misc/scala-devel/plugins/continuations.jar">
<fileset dir="${build-quick.dir}/classes/continuations-plugin"/>
</jar>
</target>
<target name="pack.scalacheck" depends="pack.plugins">
<jar destfile="${build-pack.dir}/lib/scalacheck.jar">
<fileset dir="${build-quick.dir}/classes/scalacheck"/>
</jar>
</target>
<target name="pack.pre-partest" depends="pack.scalacheck">
<uptodate
property="pack.partest.available"
targetfile="${build-pack.dir}/lib/scala-partest.jar"
srcfile="${build-quick.dir}/partest.complete"/>
</target>
<target name="pack.partest" depends="pack.pre-partest" unless="pack.partest.available">
<mkdir dir="${build-pack.dir}/lib"/>
<jar destfile="${build-pack.dir}/lib/scala-partest.jar">
<fileset dir="${build-quick.dir}/classes/partest"/>
</jar>
</target>
<target name="pack.pre-scalap" depends="pack.partest">
<uptodate
property="pack.scalap.available"
targetfile="${build-pack.dir}/lib/scalap.jar"
srcfile="${build-quick.dir}/scalap.complete"/>
</target>
<target name="pack.scalap" depends="pack.pre-scalap" unless="pack.scalap.available">
<mkdir dir="${build-pack.dir}/lib"/>
<jar destfile="${build-pack.dir}/lib/scalap.jar">
<fileset dir="${build-quick.dir}/classes/scalap"/>
<fileset file="${src.dir}/scalap/decoder.properties"/>
</jar>
</target>
<target name="pack.pre-bin" depends="pack.scalap">
<uptodate
property="pack.bin.available"
srcfile="${build-pack.dir}/lib/scala-compiler.jar"
targetfile="${build-pack.dir}/bin.complete"/>
</target>
<target name="pack.bin" depends="pack.pre-bin" unless="pack.bin.available">
<taskdef name="pack-bin" classname="scala.tools.ant.ScalaTool">
<classpath>
<pathelement location="${build-pack.dir}/lib/scala-library.jar"/>
<pathelement location="${build-pack.dir}/lib/scala-compiler.jar"/>
<pathelement location="${build-pack.dir}/lib/jline.jar"/>
</classpath>
</taskdef>
<mkdir dir="${build-pack.dir}/bin"/>
<pack-bin
file="${build-pack.dir}/bin/scala"
class="scala.tools.nsc.MainGenericRunner"
javaFlags="${java.flags}"/>
<pack-bin
file="${build-pack.dir}/bin/scalac"
class="scala.tools.nsc.Main"
javaFlags="${java.flags}"/>
<pack-bin
file="${build-pack.dir}/bin/scaladoc"
class="scala.tools.nsc.ScalaDoc"
javaFlags="${java.flags}"/>
<pack-bin
file="${build-pack.dir}/bin/fsc"
class="scala.tools.nsc.CompileClient"
javaFlags="${java.flags}"/>
<pack-bin
file="${build-pack.dir}/bin/scalap"
class="scala.tools.scalap.Main"
javaFlags="${java.flags}"/>
<chmod perm="ugo+rx" file="${build-pack.dir}/bin/scala"/>
<chmod perm="ugo+rx" file="${build-pack.dir}/bin/scalac"/>
<chmod perm="ugo+rx" file="${build-pack.dir}/bin/scaladoc"/>
<chmod perm="ugo+rx" file="${build-pack.dir}/bin/fsc"/>
<chmod perm="ugo+rx" file="${build-pack.dir}/bin/scalap"/>
<touch file="${build-pack.dir}/bin.complete" verbose="no"/>
</target>
<target name="pack.done" depends="pack.bin">
<path id="pack.classpath">
<pathelement location="${build-pack.dir}/lib/scala-library.jar"/>
<pathelement location="${build-pack.dir}/lib/scala-compiler.jar"/>
<pathelement location="${build-pack.dir}/lib/scala-partest.jar"/>
<pathelement location="${build-pack.dir}/lib/scalap.jar"/>
<pathelement location="${ant.jar}"/>
<pathelement location="${jline.jar}"/>
<path refid="lib.extra"/>
</path>
<taskdef resource="scala/tools/ant/antlib.xml" classpathref="pack.classpath"/>
<taskdef resource="scala/tools/partest/antlib.xml" classpathref="pack.classpath"/>
</target>
<target name="pack.clean" depends="strap.clean">
<delete dir="${build-pack.dir}" includeemptydirs="yes" quiet="yes" failonerror="no"/>
</target>
<!-- ===========================================================================
BOOTSTRAPPING BUILD (STRAP)
============================================================================ -->
<target name="strap.start" depends="pack.done"/>
<target name="strap.pre-lib" depends="strap.start">
<uptodate property="strap.lib.available" targetfile="${build-strap.dir}/library.complete">
<srcfiles dir="${src.dir}">
<include name="library/**"/>
<include name="dbc/**"/>
<include name="actors/**"/>
<include name="swing/**"/>