forked from scala/scala
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
2895 lines (2617 loc) · 115 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" xmlns:artifact="urn:maven-artifact-ant">
<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="partialdist" depends="dist.partial"
description="Makes a new distribution without documentation, so just for testing."/>
<target name="partialdist-opt"
description="Makes a new optimised distribution without testing it or removing partially build elements.">
<antcall target="partialdist">
<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="replacestarrwin-opt"
description="Creates a new Starr on Windows. Manually execute 'ant locker.clean build' first!">
<antcall target="replacestarrwin">
<param name="scalac.args.optimise" value="-optimise"/>
</antcall>
</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="fastlocker.lib"
description="Buildlocker without extra fuss">
<property name="fastlocker" value="true"/>
<antcall target="locker.unlock"/>
<antcall target="locker.lib"/>
</target>
<target name="fastlocker.reflect"
description="Buildlocker without extra fuss">
<property name="fastlocker" value="true"/>
<antcall target="locker.unlock"/>
<antcall target="locker.reflect"/>
</target>
<target name="fastlocker.comp"
description="Buildlocker without extra fuss">
<property name="fastlocker" value="true"/>
<antcall target="locker.unlock"/>
<antcall target="locker.comp"/>
</target>
<target name="fastlocker"
description="Buildlocker without extra fuss">
<antcall target="fastlocker.comp"/>
</target>
<target name="buildlocker"
description="Does the same for locker as build does for quick">
<antcall target="locker.unlock"/>
<antcall target="palo.bin"/>
</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"/>
<!-- Generating version number -->
<property file="${basedir}/build.number"/>
<!-- 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="msil.starr.jar" value="${lib.dir}/msil.jar"/>
<property name="reflect.starr.jar" value="${lib.dir}/scala-reflect.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-asm.dir" value="${build.dir}/asm"/>
<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="build-sbt.dir" value="${build.dir}/sbt-interface"/>
<property name="dists.dir" value="${basedir}/dists"/>
<property name="copyright.string" value="Copyright 2002-2012, 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" />
<property
name="scalacfork.jvmargs"
value="${env.ANT_OPTS} ${jvm.opts}"/>
<!-- ===========================================================================
INITIALISATION
============================================================================ -->
<target name="init.jars.check">
<uptodate property="lib.jars.uptodate">
<srcfiles dir="${basedir}">
<include name="lib/**/*.desired.sha1"/>
<include name="test/files/**/*.desired.sha1"/>
<include name="tools/**/*.desired.sha1"/>
</srcfiles>
<mapper type="glob" from="*.desired.sha1" to="*"/>
</uptodate>
</target>
<target name="init.jars" depends="init.jars.check" unless="lib.jars.uptodate">
<echo level="warn" message="Updating bootstrap libs. (To do this by hand, run ./pull-binary-libs.sh)"/>
<exec osfamily="unix" vmlauncher="false" executable="./pull-binary-libs.sh" failifexecutionfails="true" />
<exec osfamily="windows" vmlauncher="false" executable="pull-binary-libs.sh" failifexecutionfails="true" />
<!-- uptodate task needs to know these are what's in the sha. -->
<touch>
<fileset dir="${basedir}">
<include name="lib/**/*.desired.sha1"/>
<include name="test/files/**/*.desired.sha1"/>
<include name="tools/**/*.desired.sha1"/>
</fileset>
<mapper type="glob" from="*.desired.sha1" to="*"/>
</touch>
</target>
<!-- Add our maven ant tasks -->
<target name="init.maven.tasks" depends="init.jars.check" unless="init.maven.tasks.finished">
<path id="maven-ant-tasks.classpath" path="${lib.dir}/ant/maven-ant-tasks-2.1.1.jar" />
<typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant" classpathref="maven-ant-tasks.classpath" />
<property name="init.maven.tasks.finished" value="true" />
</target>
<!-- Resolve maven dependencies -->
<target name="init.maven.jars" depends="init.maven.tasks">
<artifact:dependencies pathId="dependency.classpath" filesetId="dependency.fileset">
<!--<dependency groupId="com.typesafe" artifactId="config" version="0.4.0"/>-->
</artifact:dependencies>
</target>
<!-- Determines OSGi string + maven extension. -->
<target name="init.hasbuildnum">
<condition property="version.hasbuildnum">
<not><equals arg1="${version.bnum}" arg2="0"/></not>
</condition>
</target>
<target name="init.build.snapshot" unless="build.release">
<property name="maven.version.suffix" value="-SNAPSHOT"/>
</target>
<target name="init.build.release" if="build.release" depends="init.hasbuildnum, init.build.snapshot">
<property name="maven.version.suffix" value=""/>
</target>
<target name="init.build.nopatch.release" unless="version.hasbuildnum" depends="init.hasbuildnum">
<property name="version.suffix" value=""/>
</target>
<!-- funny thing, ant is. Can only specify *one* property in if check. Guaranteed that both are true here,
since properties are immutable. -->
<target name="init.build.patch.release" if="version.hasbuildnum" depends="init.build.nopatch.release">
<property name="version.suffix" value="-${version.bnum}"/>
</target>
<target name="init.hasmavensuffix" if="build.release" depends="init.build.patch.release, init.build.release">
<condition property="version.hasmavensuffix">
<not><equals arg1="${maven.version.suffix}" arg2=""/></not>
</condition>
</target>
<target name="init.osgi.suffix" if="version.hasmavensuffix" depends="init.hasmavensuffix">
<property name="osgi.version.suffix" value="${maven.version.suffix}"/>
</target>
<target name="init.osgi.suffix.final" if="build.release" unless="version.hasmavensuffix" depends="init.hasmavensuffix">
<property name="osgi.version.suffix" value="-VFINAL"/>
</target>
<target name="init.osgi.suffix.snapshot" unless="build.release" depends="init.hasmavensuffix">
<property name="osgi.version.suffix" value=""/>
</target>
<target name="init.build.suffix.done" depends="init.build.release, init.build.patch.release, init.osgi.suffix, init.osgi.suffix.final, init.osgi.suffix.snapshot"/>
<target name="init.version.git" depends="init.build.suffix.done">
<!-- Find out whether we are running on Windows -->
<condition property="os.win">
<os family="windows"/>
</condition>
<exec osfamily="unix" executable="tools/get-scala-commit-sha" outputproperty="git.commit.sha" failifexecutionfails="false" />
<exec osfamily="windows" executable="cmd.exe" outputproperty="git.commit.sha" failifexecutionfails="false">
<arg value="/c"/>
<arg value="tools\get-scala-commit-sha.bat"/>
<arg value="-p"/>
</exec>
<exec osfamily="unix" executable="tools/get-scala-commit-date" outputproperty="git.commit.date" failifexecutionfails="false" />
<exec osfamily="windows" executable="cmd.exe" outputproperty="git.commit.date" failifexecutionfails="false">
<arg value="/c"/>
<arg value="tools\get-scala-commit-date.bat"/>
<arg value="-p"/>
</exec>
<!-- some default in case something went wrong getting the revision -->
<property name="git.commit.sha" value="unknown"/>
<property name="git.commit.date" value="unknown"/>
<!-- We use the git describe to determine the OSGi modifier for our build. -->
<property
name="maven.version.number"
value="${version.major}.${version.minor}.${version.patch}${version.suffix}${maven.version.suffix}"/>
<property
name="osgi.version.number"
value="${version.major}.${version.minor}.${version.patch}.v${git.commit.date}${version.suffix}${osgi.version.suffix}-${git.commit.sha}"/>
</target>
<target name="init.version.snapshot" unless="build.release" depends="init.version.git">
<property
name="version.number"
value="${version.major}.${version.minor}.${version.patch}${version.suffix}-${git.commit.date}-${git.commit.sha}"/>
</target>
<target name="init.version.release" if="build.release" depends="init.version.git">
<property
name="version.number"
value="${maven.version.number}"/>
</target>
<target name="init.version.done" depends="init.version.release, init.version.snapshot"/>
<target name="init.testjava6">
<condition property="has.java6">
<equals arg1="${ant.java.version}" arg2="1.6"/>
</condition>
<condition property="has.java7">
<equals arg1="${ant.java.version}" arg2="1.7"/>
</condition>
<condition property="has.unsupported.jdk">
<not><or>
<isset property="has.java7" />
<isset property="has.java6" />
</or></not>
</condition>
</target>
<target name="init.fail.bad.jdk" depends="init.testjava6">
<fail if="has.unsupported.jdk"
message="JDK ${ant.java.version} is not supported by this build!"/>
</target>
<target name="init.warn.jdk7" depends="init.testjava6" if="has.java7">
<echo level="warning"> You are using JDK7 for this build. While this will be able to build most of Scala, it will
not build the Swing project. You will be unable to create a distribution.
</echo>
</target>
<target name="init" depends="init.jars, init.maven.jars, init.version.done, init.fail.bad.jdk, init.warn.jdk7">
<property name="scalac.args.always" value="-Yreify-copypaste" />
<!-- 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.
Note: These are also used by strap since they may affect JVM target or other and we'd like
to be able to test binary stability of features. -->
<property name="scalac.args.quickonly" value=""/>
<property name="scalac.args.all" value="${scalac.args.always} ${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" locale="en,US"/>
<format property="short" pattern="yyyyMMddHHmmss"/>
</tstamp>
<!-- some default in case something went wrong getting the revision -->
<property name="version.number" value="-unknown-"/>
<property name="init.avail" value="yes"/>
<!-- 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>
<!-- Libraries only used for STARR -->
<path id="starr.dep.libs">
<fileset dir="${lib.dir}">
<include name="fjbg.jar"/>
<include name="forkjoin.jar"/>
<include name="msil.jar"/>
</fileset>
</path>
<!-- Auxiliary libs placed on every classpath. -->
<path id="aux.libs">
<pathelement location="${ant.jar}"/>
<path refid="lib.extra"/>
<path refid="dependency.classpath"/>
</path>
<!-- And print-out what we are building -->
<echo message=" build time: ${time.human}" />
<echo message=" java version: ${java.vm.name} ${java.version} (${ant.java.version})" />
<echo message=" java args: ${env.ANT_OPTS} ${jvm.opts}" />
<echo message=" javac args: ${javac.args}" />
<echo message=" scalac args: ${scalac.args.all}" />
<echo message="scalac quick args: ${scalac.args.quick}" />
<echo message=" git date: ${git.commit.date}" />
<echo message=" git hash: ${git.commit.sha}" />
<echo message=" maven version: ${maven.version.number}"/>
<echo message=" OSGi version: ${osgi.version.number}" />
<echo message="canonical version: ${version.number}" />
<!-- Define tasks that can be run with Starr -->
<path id="starr.classpath">
<pathelement location="${lib.starr.jar}"/>
<pathelement location="${reflect.starr.jar}"/>
<pathelement location="${comp.starr.jar}"/>
<path refid="aux.libs"/>
<path refid="starr.dep.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="${build-libs.dir}/classes/forkjoin"/>
<path refid="lib.extra"/>
</path>
<path id="strap.compilation.path">
<pathelement location="${build-strap.dir}/classes/library"/>
<pathelement location="${build-libs.dir}/classes/forkjoin"/>
<path refid="lib.extra"/>
</path>
<taskdef resource="scala/tools/ant/sabbus/antlib.xml" classpathref="starr.classpath"/>
</target>
<!-- ===========================================================================
LOCAL DEPENDENCY (Adapted ASM)
============================================================================ -->
<target name="asm.start" depends="init">
<condition property="asm.available">
<available file="${build-asm.dir}/asm.complete"/>
</condition>
</target>
<target name="asm.lib" depends="asm.start" unless="asm.available">
<stopwatch name="asm.lib.timer"/>
<mkdir dir="${build-asm.dir}/classes/"/>
<javac
srcdir="${src.dir}/asm"
destdir="${build-asm.dir}/classes"
classpath="${build-asm.dir}/classes"
includes="**/*.java"
target="1.6" source="1.5">
<compilerarg line="${javac.args} -XDignore.symbol.file"/>
</javac>
<touch file="${build-asm.dir}/asm.complete" verbose="no"/>
<stopwatch name="asm.lib.timer" action="total"/>
</target>
<target name="asm.done" depends="asm.lib">
<path id="asm.classpath">
<pathelement location="${build-asm.dir}/classes/"/>
</path>
</target>
<target name="asm.clean" depends="init">
<delete dir="${build-asm.dir}" includeemptydirs="yes" quiet="yes" failonerror="no"/>
</target>
<!-- ===========================================================================
LOCAL DEPENDENCY (FORKJOIN)
============================================================================ -->
<target name="forkjoin.start" depends="init">
<uptodate property="forkjoin.available" targetfile="${build-libs.dir}/forkjoin.complete">
<srcfiles dir="${src.dir}/forkjoin">
<include name="**/*.java"/>
<include name="**/*.scala"/>
</srcfiles>
</uptodate>
</target>
<target name="forkjoin.lib" depends="forkjoin.start" unless="forkjoin.available">
<stopwatch name="forkjoin.lib.timer"/>
<mkdir dir="${build-libs.dir}/classes/forkjoin"/>
<javac
fork="yes"
compiler="javac1.6"
srcdir="${src.dir}/forkjoin"
destdir="${build-libs.dir}/classes/forkjoin"
classpath="${build-libs.dir}/classes/forkjoin"
includes="**/*.java"
debug="true"
target="1.6" source="1.5">
<compilerarg line="${javac.args} -XDignore.symbol.file"/>
</javac>
<touch file="${build-libs.dir}/forkjoin.complete" verbose="no"/>
<stopwatch name="forkjoin.lib.timer" action="total"/>
</target>
<target name="forkjoin.pack" depends="forkjoin.lib">
<jar destfile="${build-libs.dir}/forkjoin.jar">
<fileset dir="${build-libs.dir}/classes/forkjoin"/>
</jar>
</target>
<target name="forkjoin.done" depends="forkjoin.pack">
<!-- TODO - jar or classfiles? -->
<path id="forkjoin.classpath">
<pathelement location="${build-libs.dir}/classes/forkjoin"/>
</path>
</target>
<target name="forkjoin.clean" depends="init">
<delete dir="${build-libs.dir}/classes/forkjoin" includeemptydirs="yes" quiet="yes" failonerror="no"/>
<delete file="${build-libs.dir}/forkjoin.complete" quiet="yes" failonerror="no"/>
</target>
<!-- ===========================================================================
LOCAL DEPENDENCY (FJBG)
============================================================================ -->
<target name="fjbg.init" depends="init">
<uptodate property="fjbg.available" targetfile="${build-libs.dir}/fjbg.complete">
<srcfiles dir="${src.dir}/fjbg">
<include name="**/*.java"/>
<include name="**/*.scala"/>
</srcfiles>
</uptodate>
</target>
<target name="fjbg.lib" depends="fjbg.init" unless="fjbg.available">
<stopwatch name="fjbg.lib.timer" />
<mkdir dir="${build-libs.dir}/classes/fjbg"/>
<javac
srcdir="${src.dir}/fjbg"
destdir="${build-libs.dir}/classes/fjbg"
classpath="${build-libs.dir}/classes/fjbg"
includes="**/*.java"
debug="true"
target="1.6" source="1.4">
<compilerarg line="${javac.args} -XDignore.symbol.file"/>
</javac>
<touch file="${build-libs.dir}/fjbg.complete" verbose="no"/>
<stopwatch name="fjbg.lib.timer" action="total"/>
</target>
<target name="fjbg.pack" depends="fjbg.lib">
<jar destfile="${build-libs.dir}/fjbg.jar">
<fileset dir="${build-libs.dir}/classes/fjbg"/>
</jar>
</target>
<target name="fjbg.done" depends="fjbg.pack">
<!-- TODO - jar or classfiles? -->
<path id="fjbg.classpath">
<pathelement location="${build-libs.dir}/classes/fjbg"/>
</path>
</target>
<target name="fjbg.clean" depends="init">
<delete dir="${build-libs.dir}/classes/fjbg" includeemptydirs="yes" quiet="yes" failonerror="no"/>
<delete file="${build-libs.dir}/fjbg.complete" quiet="yes" failonerror="no"/>
</target>
<!-- ===========================================================================
LOCAL REFERENCE BUILD (LOCKER)
============================================================================ -->
<target name="locker.start" depends="asm.done, forkjoin.done, fjbg.done">
<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"
includes="**/*.java"
target="1.6" source="1.5">
<compilerarg line="${javac.args} -XDignore.symbol.file"/>
<classpath>
<path refid="forkjoin.classpath"/>
<pathelement location="${build-locker.dir}/classes/library"/>
</classpath>
</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"/>
<path refid="forkjoin.classpath"/>
</compilationpath>
</scalacfork>
<propertyfile file="${build-locker.dir}/classes/library/library.properties">
<entry key="version.number" value="${version.number}"/>
<entry key="maven.version.number" value="${maven.version.number}"/>
<entry key="osgi.version.number" value="${osgi.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-reflect" depends="locker.lib" unless="locker.available">
<condition property="locker.reflect.needed">
<not><available file="${build-locker.dir}/reflect.complete"/></not>
</condition>
</target>
<target name="locker.reflect" depends="locker.pre-reflect" if="locker.reflect.needed">
<stopwatch name="locker.reflect.timer"/>
<mkdir dir="${build-locker.dir}/classes/reflect"/>
<scalacfork
destdir="${build-locker.dir}/classes/reflect"
compilerpathref="starr.classpath"
params="${scalac.args.all}"
srcdir="${src.dir}/reflect"
jvmargs="${scalacfork.jvmargs}">
<include name="**/*.scala"/>
<compilationpath>
<pathelement location="${build-locker.dir}/classes/library"/>
<pathelement location="${build-locker.dir}/classes/reflect"/>
<path refid="aux.libs"/>
<pathelement location="${jline.jar}"/>
</compilationpath>
</scalacfork>
<!-- TODO - needed? -->
<propertyfile file="${build-locker.dir}/classes/reflect/reflect.properties">
<entry key="version.number" value="${version.number}"/>
<entry key="maven.version.number" value="${maven.version.number}"/>
<entry key="osgi.version.number" value="${osgi.version.number}"/>
<entry key="copyright.string" value="${copyright.string}"/>
</propertyfile>
<copy todir="${build-locker.dir}/classes/reflect">
<fileset dir="${src.dir}/reflect">
<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}/reflect.complete" verbose="no"/>
<stopwatch name="locker.reflect.timer" action="total"/>
</target>
<target name="locker.pre-comp" depends="locker.reflect" 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"/>
<if>
<equals arg1="${fastlocker}" arg2="true" />
<then>
<!-- Fastlocker build: don't compile MSIL, use its starr version.... -->
<property name="locker.comp.msil" value="${msil.starr.jar}"/>
</then>
<else>
<!-- Regular build: Compile MSIL inside of locker.... -->
<javac
srcdir="${src.dir}/msil"
destdir="${build-locker.dir}/classes/compiler"
classpath="${build-locker.dir}/classes/compiler"
includes="**/*.java"
excludes="**/tests/**"
debug="true"
target="1.6" source="1.4">
<compilerarg line="${javac.args}"/>
</javac>
<scalacfork
destdir="${build-locker.dir}/classes/compiler"
compilerpathref="starr.classpath"
params="${scalac.args.all}"
srcdir="${src.dir}/msil"
jvmargs="${scalacfork.jvmargs}">
<include name="**/*.scala"/>
<compilationpath>
<pathelement location="${build-locker.dir}/classes/library"/>
<pathelement location="${build-locker.dir}/classes/reflect"/>
<pathelement location="${build-locker.dir}/classes/compiler"/>
<path refid="fjbg.classpath"/>
<path refid="aux.libs"/>
<pathelement location="${jline.jar}"/>
</compilationpath>
</scalacfork>
<property name="locker.comp.msil" value="${build-locker.dir}/classes/compiler"/>
</else>
</if>
<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/reflect"/>
<pathelement location="${build-locker.dir}/classes/compiler"/>
<path refid="fjbg.classpath"/>
<path refid="aux.libs"/>
<path refid="asm.classpath"/>
<pathelement location="${locker.comp.msil}" />
<pathelement location="${jline.jar}"/>
</compilationpath>
</scalacfork>
<propertyfile file="${build-locker.dir}/classes/compiler/compiler.properties">
<entry key="version.number" value="${version.number}"/>
<entry key="maven.version.number" value="${maven.version.number}"/>
<entry key="osgi.version.number" value="${osgi.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/reflect"/>
<pathelement location="${build-locker.dir}/classes/compiler"/>
<path refid="fjbg.classpath"/>
<path refid="forkjoin.classpath"/>
<path refid="asm.classpath"/>
<path refid="aux.libs"/>
</path>
<!-- TODO - Why is this *here* ? -->
<path id="quick.classpath">
<pathelement location="${build-quick.dir}/classes/library"/>
<pathelement location="${build-quick.dir}/classes/reflect"/>
<pathelement location="${build-quick.dir}/classes/compiler"/>
<path refid="fjbg.classpath"/>
<path refid="forkjoin.classpath"/>
<path refid="asm.classpath"/>
<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.pre-lib">
<uptodate property="locker.lib.available" targetfile="${build-locker.dir}/library.complete">
<srcfiles dir="${src.dir}">
<include name="library/**"/>
</srcfiles>
</uptodate>
</target>
<target name="locker.unlock.lib" depends="locker.unlock.pre-lib" unless="locker.lib.available">
<delete file="${build-locker.dir}/library.complete"/>
</target>
<target name="locker.unlock.pre-reflect" depends="locker.unlock.lib">
<uptodate property="locker.reflect.available" targetfile="${build-locker.dir}/reflect.complete">
<srcfiles dir="${src.dir}">
<include name="reflect/**"/>
</srcfiles>
</uptodate>
</target>
<target name="locker.unlock.reflect" depends="locker.unlock.pre-reflect" unless="locker.reflect.available">
<delete file="${build-locker.dir}/reflect.complete"/>
</target>
<target name="locker.unlock.pre-comp" depends="locker.unlock.reflect">
<uptodate property="locker.comp.available" targetfile="${build-locker.dir}/compiler.complete">
<srcfiles dir="${src.dir}">
<include name="compiler/**"/>
</srcfiles>
</uptodate>
</target>
<target name="locker.unlock.comp" depends="locker.unlock.pre-comp" unless="locker.comp.available">
<delete file="${build-locker.dir}/compiler.complete"/>
</target>
<target name="locker.unlock" depends="locker.unlock.comp">
<delete file="${build-locker.dir}/all.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"/>
<fileset dir="${build-libs.dir}/classes/forkjoin"/>
</jar>
</target>
<target name="palo.pre-reflect" depends="palo.lib">
<uptodate
property="palo.reflect.available"
targetfile="${build-palo.dir}/lib/scala-reflect.jar"
srcfile="${build-locker.dir}/reflect.complete"/>
</target>
<target name="palo.reflect" depends="palo.pre-reflect" unless="palo.reflect.available">
<mkdir dir="${build-palo.dir}/lib"/>
<jar destfile="${build-palo.dir}/lib/scala-reflect.jar" manifest="${basedir}/META-INF/MANIFEST.MF">
<fileset dir="${build-locker.dir}/classes/reflect"/>
</jar>
</target>
<target name="palo.pre-comp" depends="palo.reflect">
<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"/>
<fileset dir="${build-asm.dir}/classes/"/>
<fileset dir="${build-libs.dir}/classes/fjbg"/>
</jar>
<copy file="${jline.jar}" toDir="${build-palo.dir}/lib"/>
</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>
<target name="palo.pre-bin" depends="palo.comp">
<uptodate property="palo.bin.available" targetfile="${build-locker.dir}/bin.complete">
<srcfiles dir="${src.dir}">
<include name="compiler/scala/tools/ant/templates/**"/>
</srcfiles>
</uptodate>
</target>
<target name="palo.bin" depends="palo.pre-bin" unless="palo.bin.available">
<taskdef name="palo-bin" classname="scala.tools.ant.ScalaTool">
<classpath>
<pathelement location="${build-palo.dir}/lib/scala-library.jar"/>
<pathelement location="${build-palo.dir}/lib/scala-reflect.jar"/>
<pathelement location="${build-palo.dir}/lib/scala-compiler.jar"/>
<pathelement location="${build-palo.dir}/lib/jline.jar"/>
</classpath>
</taskdef>
<mkdir dir="${build-palo.dir}/bin"/>
<palo-bin
file="${build-palo.dir}/bin/scala"
class="scala.tools.nsc.MainGenericRunner"
javaFlags="${java.flags}"/>
<palo-bin
file="${build-palo.dir}/bin/scalac"
class="scala.tools.nsc.Main"
javaFlags="${java.flags}"/>
<palo-bin
file="${build-palo.dir}/bin/scaladoc"
class="scala.tools.nsc.ScalaDoc"
javaFlags="${java.flags}"/>
<palo-bin
file="${build-palo.dir}/bin/fsc"
class="scala.tools.nsc.CompileClient"
javaFlags="${java.flags}"/>
<palo-bin
file="${build-palo.dir}/bin/scalap"
class="scala.tools.scalap.Main"
javaFlags="${java.flags}"/>
<chmod perm="ugo+rx" file="${build-palo.dir}/bin/scala"/>
<chmod perm="ugo+rx" file="${build-palo.dir}/bin/scalac"/>
<chmod perm="ugo+rx" file="${build-palo.dir}/bin/scaladoc"/>
<chmod perm="ugo+rx" file="${build-palo.dir}/bin/fsc"/>
<chmod perm="ugo+rx" file="${build-palo.dir}/bin/scalap"/>
<touch file="${build-locker.dir}/bin.complete" verbose="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="continuations/**"/>
<include name="swing/**"/>