forked from scala/scala
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
executable file
·1942 lines (1676 loc) · 89.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" encoding="UTF-8"?>
<project name="sabbus" default="build" xmlns:artifact="urn:maven-artifact-ant">
<include file="test/build-partest.xml" as="partest"/>
<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>
<!-- HINTS
- for faster builds, have a build.properties in the same directory as build.xml that says:
locker.skip=1
starr.use.released=1
-->
<!-- USAGE FROM JENKINS SCRIPTS IS (CURRENTLY) AS FOLLOWS:
ant $antArgs $scalacArgs $targets
antArgs tend to be:
-Darchives.skipxz=true
-Dscalac.args.optimise=-optimise
scalacArgs examples:
"-Dscalac.args=\"-Yrangepos\" -Dpartest.scalac_opts=\"-Yrangepos\""
targets exercised:
locker.done build-opt nightly test.suite test.continuations.suite test.scaladoc
-->
<!-- To use Zinc with the ant build:
- install zinc and symlink the installed zinc script to ${basedir}/tools/zinc (${basedir} is where build.xml and the rest of your checkout resides)
- make sure to set ZINC_OPTS to match ANT_OPTS!
-->
<!--
TODO:
- detect zinc anywhere on PATH
- automatically set ZINC_OPTS
- skip locker (and test.stability) by default to speed up PR validation, still do full build & testing during nightly
- (rework the build to pack locker and build using that when using zinc)
-->
<!-- ===========================================================================
END-USER TARGETS
============================================================================ -->
<target name="build" depends="pack.done" description="Builds the Scala compiler and library. Executables are in 'build/pack/bin'."/>
<target name="test" depends="test.done" description="Runs test suite and bootstrapping test on Scala compiler and library."/>
<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="dist" depends="all.clean, all.done" description="Cleans all and builds and tests a new distribution."/>
<target name="partialdist" depends="dist.partial" description="Makes a new distribution without documentation, so just for testing."/>
<target name="fastdist" depends="dist.done" description="Makes a new distribution without testing it or removing partially build elements."/>
<target name="build-opt" description="Optimized version of build."> <optimized name="build"/></target>
<target name="test-opt" description="Optimized version of test."> <optimized name="test"/></target>
<target name="dist-opt" description="Optimized version of dist."> <optimized name="dist"/></target>
<target name="partialdist-opt" description="Optimized version of partialdist."> <optimized name="partialdist"/></target>
<target name="fastdist-opt" description="Optimized version of fastdist."> <optimized name="fastdist"/></target>
<!-- packaging -->
<target name="distpack" depends="dist.done, docs.done">
<ant antfile="${src.dir}/build/pack.xml" target="pack-all.done" inheritall="yes" inheritrefs="yes"/></target>
<target name="distpack-maven" depends="dist.done, docs.done">
<ant antfile="${src.dir}/build/pack.xml" target="pack-maven.done" inheritall="yes" inheritrefs="yes"/></target>
<target name="distpack-opt" description="Builds an optimised distribution."> <optimized name="distpack"/></target>
<target name="distpack-maven-opt" description="Builds an optimised maven distribution."><optimized name="distpack-maven"/></target>
<target name="all.done" depends="dist.done, test.done"/>
<!-- must use depends for all.done, not antcall: need the properties defined in there (dist.dir) -->
<target name="nightly-nopt" depends="all.done, docs.done">
<ant antfile="${src.dir}/build/pack.xml" target="pack-all.done" inheritall="yes" inheritrefs="yes"/></target>
<target name="nightly"><optimized name="nightly-nopt"/></target>
<target name="nightly.checkall">
<antcall target="nightly-nopt"> <param name="partest.scalac_opts" value="-Ycheck:all"/></antcall></target>
<target name="clean" depends="quick.clean" description="Removes binaries of compiler and library. Locker and distributions are untouched."/>
<target name="docsclean" depends="docs.clean" description="Removes generated documentation. Distributions are untouched."/>
<target name="distclean" depends="dist.clean" description="Removes all distributions. Binaries and documentation are untouched."/>
<macrodef name="optimized" >
<attribute name="name"/>
<sequential>
<antcall target="@{name}"><param name="scalac.args.optimise" value="-optimise"/></antcall>
</sequential>
</macrodef>
<!-- ===========================================================================
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="src.dir" value="${basedir}/src"/>
<property name="partest.dir" value="${basedir}/test"/>
<property name="lib-ant.dir" value="${lib.dir}/ant"/>
<!-- 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"/>
<!-- read starr.version -->
<property file="${basedir}/starr.number"/>
<!-- Sets location of pre-compiled libraries -->
<property name="library.starr.jar" value="${lib.dir}/scala-library.jar"/>
<property name="reflect.starr.jar" value="${lib.dir}/scala-reflect.jar"/>
<property name="compiler.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-libs.dir" value="${build.dir}/libs"/>
<property name="build-asm.dir" value="${build.dir}/asm"/>
<property name="build-forkjoin.dir" value="${build-libs.dir}"/>
<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-osgi.dir" value="${build.dir}/osgi"/>
<property name="build-strap.dir" value="${build.dir}/strap"/>
<property name="build-docs.dir" value="${build.dir}/scaladoc"/>
<property name="build-sbt.dir" value="${build.dir}/sbt-interface"/>
<property name="test.osgi.src" value="${partest.dir}/osgi/src"/>
<property name="test.osgi.classes" value="${build-osgi.dir}/classes"/>
<property name="dists.dir" value="${basedir}/dists"/>
<property name="copyright.string" value="Copyright 2002-2013, LAMP/EPFL"/>
<property name="partest.version.number" value="0.9.3"/>
<!-- 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}"/>
<!-- ===========================================================================
INITIALIZATION
============================================================================ -->
<target name="desired.jars.uptodate">
<patternset id="desired.jars">
<include name="lib/**/*.desired.sha1"/>
<include name="test/files/**/*.desired.sha1"/>
<include name="tools/**/*.desired.sha1"/>
</patternset>
<uptodate property="lib.jars.uptodate">
<srcfiles dir="${basedir}"><patternset refid="desired.jars"/></srcfiles>
<mapper type="glob" from="*.desired.sha1" to="*"/>
</uptodate>
</target>
<target name="boot" depends="desired.jars.uptodate" 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}"><patternset refid="desired.jars"/></fileset>
<mapper type="glob" from="*.desired.sha1" to="*"/>
</touch>
</target>
<target name="init" depends="boot">
<!-- Set up Ant contrib tasks so we can use <if><then><else> instead of the clunky `unless` attribute -->
<taskdef resource="net/sf/antcontrib/antlib.xml" classpath="${lib-ant.dir}/ant-contrib.jar"/>
<!-- Add our maven ant tasks -->
<path id="maven-ant-tasks.classpath" path="${lib-ant.dir}/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" />
<!-- Resolve maven dependencies -->
<!-- work around http://jira.codehaus.org/browse/MANTTASKS-203:
java.lang.ClassCastException: org.codehaus.plexus.DefaultPlexusContainer cannot be cast to org.codehaus.plexus.PlexusContainer
on repeated use of artifact:dependencies
-->
<if><not><isset property="maven-deps-done"></isset></not><then>
<mkdir dir="${user.home}/.m2/repository"/>
<!-- This task has an issue where if the user directory does not exist, so we create it above. UGH. -->
<artifact:dependencies pathId="extra.tasks.classpath" filesetId="extra.tasks.fileset">
<dependency groupId="biz.aQute" artifactId="bnd" version="1.50.0"/>
</artifact:dependencies>
<!-- Pax runner -->
<property name="pax.exam.version" value="2.5.0"/>
<artifact:dependencies pathId="pax.exam.classpath" filesetId="pax.exam.fileset">
<dependency groupId="org.ops4j.pax.exam" artifactId="pax-exam-container-native" version="${pax.exam.version}"/>
<dependency groupId="org.ops4j.pax.exam" artifactId="pax-exam-junit4" version="${pax.exam.version}"/>
<dependency groupId="org.ops4j.pax.exam" artifactId="pax-exam-link-assembly" version="${pax.exam.version}"/>
<dependency groupId="org.ops4j.pax.url" artifactId="pax-url-aether" version="1.4.0"/>
<dependency groupId="org.ops4j.pax.swissbox" artifactId="pax-swissbox-framework" version="1.5.1"/>
<dependency groupId="ch.qos.logback" artifactId="logback-core" version="0.9.20"/>
<dependency groupId="ch.qos.logback" artifactId="logback-classic" version="0.9.20"/>
<dependency groupId="junit" artifactId="junit" version="4.10"/>
<dependency groupId="org.apache.felix" artifactId="org.apache.felix.framework" version="3.2.2"/>
</artifact:dependencies>
<artifact:dependencies pathId="partest.extras.classpath" filesetId="partest.extras.fileset" versionsId="partest.extras.versions">
<dependency groupId="com.googlecode.java-diff-utils" artifactId="diffutils" version="1.3.0"/>
<dependency groupId="org.scala-tools.testing" artifactId="test-interface" version="0.5" />
</artifact:dependencies>
<!-- BND support -->
<typedef resource="aQute/bnd/ant/taskdef.properties" classpathref="extra.tasks.classpath" />
<!-- Download STARR via maven if `starr.use.released` is set,
and `starr.version` is specified (see the starr.number properties file).
Want to slow down STARR changes, using only released versions. -->
<if><isset property="starr.use.released"/><then>
<echo message="Using Scala ${starr.version} for STARR."/>
<artifact:dependencies pathId="starr.core.path">
<dependency groupId="org.scala-lang" artifactId="scala-library" version="${starr.version}"/>
<dependency groupId="org.scala-lang" artifactId="scala-reflect" version="${starr.version}"/>
<dependency groupId="org.scala-lang" artifactId="scala-compiler" version="${starr.version}"/>
</artifact:dependencies></then>
<else>
<path id="starr.core.path">
<pathelement location="${library.starr.jar}"/>
<pathelement location="${reflect.starr.jar}"/>
<pathelement location="${compiler.starr.jar}"/>
</path></else>
</if>
<property name="maven-deps-done" value="yep!"/>
</then></if>
<!-- NOTE: ant properties are write-once: second writes are silently discarded; the logic below relies on this -->
<!-- Compute defaults (i.e., if not specified on command-line) for OSGi/maven version suffixes.
Try to establish the invariant (verified below):
`version.suffix == maven.version.suffix == osgi.version.suffix`,
except for:
- snapshot builds, where:
- `maven.suffix == "-SNAPSHOT"`
- `version.suffix == osgi.version.suffix == ""`
- final builds, where:
- `osgi.suffix == "-VFINAL"`
- `version.suffix == maven.version.suffix == ""`
-->
<if><not><equals arg1="${version.bnum}" arg2="0"/></not><then>
<property name="version.suffix" value="-${version.bnum}"/>
</then></if>
<if><or><not><isset property="version.suffix"/></not><equals arg1="${version.suffix}" arg2=""/></or><then>
<if><isset property="build.release"/><then>
<property name="maven.version.suffix" value=""/>
<property name="version.suffix" value="${maven.version.suffix}"/>
<if><equals arg1="${maven.version.suffix}" arg2=""/><then>
<property name="osgi.version.suffix" value="-VFINAL"/></then>
<else>
<property name="osgi.version.suffix" value="${maven.version.suffix}"/></else></if></then></if></then>
<else> <!-- version.suffix set and not empty -->
<property name="maven.version.suffix" value="${version.suffix}"/>
<property name="osgi.version.suffix" value="${version.suffix}"/></else></if>
<!-- if a maven version suffix was set (or inferred), assume we're building a release -->
<if><isset property="maven.version.suffix"/><then>
<property name="build.release" value="1"/></then></if>
<!-- not building a release and no version.suffix specified -->
<property name="maven.version.suffix" value="-SNAPSHOT"/>
<if><equals arg1="${maven.version.suffix}" arg2="-SNAPSHOT"/><then>
<property name="osgi.version.suffix" value=""/>
<property name="version.suffix" value=""/></then>
<else>
<property name="osgi.version.suffix" value="${maven.version.suffix}"/>
<property name="version.suffix" value="${maven.version.suffix}"/></else></if>
<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}${maven.version.suffix}"/>
<property name="osgi.version.number"
value="${version.major}.${version.minor}.${version.patch}.v${git.commit.date}${osgi.version.suffix}-${git.commit.sha}"/>
<if><isset property="build.release"/><then>
<property name="version.number" value="${maven.version.number}"/>
</then><else>
<property name="version.number" value="${version.major}.${version.minor}.${version.patch}${version.suffix}-${git.commit.date}-${git.commit.sha}"/>
</else></if>
<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>
<fail if="has.unsupported.jdk" message="JDK ${ant.java.version} is not supported by this build!"/>
<if><isset property="has.java7"/><then>
<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>
</then></if>
<!-- Allow this to be overridden simply -->
<property name="sbt.latest.version" value="0.12.2"/>
<property name="sbt.src.dir" value="${build-sbt.dir}/${sbt.latest.version}/src"/>
<property name="sbt.lib.dir" value="${build-sbt.dir}/${sbt.latest.version}/lib"/>
<property name="sbt.interface.jar" value="${sbt.lib.dir}/interface.jar"/>
<property name="sbt.interface.url" value="http://typesafe.artifactoryonline.com/typesafe/ivy-releases/org.scala-sbt/interface/${sbt.latest.version}/jars/interface.jar"/>
<property name="sbt.interface.src.jar" value="${sbt.src.dir}/compiler-interface-src.jar"/>
<property name="sbt.interface.src.url" value="http://typesafe.artifactoryonline.com/typesafe/ivy-releases/org.scala-sbt/compiler-interface/${sbt.latest.version}/jars/compiler-interface-src.jar"/>
<!-- Additional command line arguments for scalac. They are added to all build targets -->
<property name="scalac.args" value=""/>
<property name="javac.args" value=""/>
<property name="scalac.args.always" value="" />
<property name="scalac.args.optimise" value=""/> <!-- scalac.args.optimise is selectively overridden in certain antcall tasks. -->
<property name="scalac.args.all" value="${scalac.args.always} ${scalac.args} ${scalac.args.optimise}"/>
<property name="scalac.args.locker" value="${scalac.args.all}"/>
<property name="scalac.args.quick" value="${scalac.args.all}"/>
<property name="scalac.args.strap" value="${scalac.args.quick}"/>
<!-- 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}"/>
<!-- Auxiliary libs placed on every classpath. -->
<path id="aux.libs">
<pathelement location="${ant.jar}"/>
<!-- needs ant 1.7.1 -->
<!-- <fileset dir="${lib-extra.dir}" erroronmissingdir="false"> -->
<fileset dir="${lib-extra.dir}">
<include name="**/*.jar"/>
</fileset>
</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}" />
<!-- validate version suffixes -->
<if><equals arg1="${maven.version.suffix}" arg2="-SNAPSHOT"/><then>
<condition property="version.suffixes.consistent"><and>
<equals arg1="${osgi.version.suffix}" arg2=""/>
<equals arg1="${version.suffix}" arg2=""/>
</and></condition></then>
<else>
<if><equals arg1="${osgi.version.suffix}" arg2="-VFINAL"/><then>
<condition property="version.suffixes.consistent"><and>
<equals arg1="${maven.version.suffix}" arg2=""/>
<equals arg1="${version.suffix}" arg2=""/>
</and></condition></then>
<else>
<condition property="version.suffixes.consistent"><and>
<equals arg1="${osgi.version.suffix}" arg2="${maven.version.suffix}"/>
<equals arg1="${version.suffix}" arg2="${maven.version.suffix}"/>
</and></condition></else></if></else></if>
<!-- <echo message=" maven suffix: ${maven.version.suffix}"/>
<echo message=" OSGi suffix: ${osgi.version.suffix}" />
<echo message="canonical suffix: ${version.suffix}" /> -->
<fail unless="version.suffixes.consistent" message="Version suffixes inconsistent!"/>
<path id="forkjoin.classpath" path="${build-libs.dir}/classes/forkjoin"/>
<path id="asm.classpath" path="${build-asm.dir}/classes"/>
<property name="forkjoin-classes" refid="forkjoin.classpath"/>
<property name="asm-classes" refid="asm.classpath"/>
<!-- Compilers to use for the various stages.
There must be a variable of the shape @{stage}.compiler.path for all @{stage} in starr, locker, quick, strap.
-->
<path id="starr.compiler.path">
<path refid="starr.core.path"/>
<pathelement location="${lib.dir}/forkjoin.jar"/>
<path refid="aux.libs"/>
</path>
<!-- To skip locker, use -Dlocker.skip=1 -->
<if><isset property="locker.skip"/><then>
<echo message="Using STARR to build the quick stage (skipping locker)."/>
<path id="locker.compiler.path" refid="starr.compiler.path"/>
<property name="locker.locked" value="locker skipped"/></then>
<else>
<path id="locker.compiler.path"><path refid="locker.compiler.build.path"/></path></else></if>
<!-- compilerpathref for compiling with quick -->
<path id="quick.compiler.path"> <path refid="quick.compiler.build.path"/></path>
<!-- What to have on the compilation path when compiling during certain phases.
There must be a variable of the shape @{stage}.@{project}.build.path
for all @{stage} in locker, quick, strap
and all @{project} in library, reflect, compiler
when stage is quick, @{project} also includes: actors, repl, swing, plugins, scalacheck, interactive, scaladoc, partest, scalap
-->
<!-- LOCKER -->
<path id="locker.library.build.path">
<pathelement location="${build-locker.dir}/classes/library"/>
<path refid="forkjoin.classpath"/>
<path refid="aux.libs"/>
</path>
<path id="locker.actors.build.path">
<path refid="locker.library.build.path"/>
<pathelement location="${build-locker.dir}/classes/actors"/>
</path>
<path id="locker.reflect.build.path">
<path refid="locker.library.build.path"/>
<pathelement location="${build-locker.dir}/classes/reflect"/>
</path>
<path id="locker.compiler.build.path">
<path refid="locker.reflect.build.path"/>
<pathelement location="${build-locker.dir}/classes/compiler"/>
<path refid="asm.classpath"/>
</path>
<!-- QUICK -->
<path id="quick.library.build.path">
<pathelement location="${build-quick.dir}/classes/library"/>
<path refid="forkjoin.classpath"/>
<path refid="aux.libs"/>
</path>
<path id="quick.actors.build.path">
<path refid="quick.library.build.path"/>
<pathelement location="${build-quick.dir}/classes/actors"/>
</path>
<path id="quick.reflect.build.path">
<path refid="quick.library.build.path"/>
<pathelement location="${build-quick.dir}/classes/reflect"/>
</path>
<path id="quick.compiler.build.path">
<path refid="quick.reflect.build.path"/>
<pathelement location="${build-quick.dir}/classes/compiler"/>
<path refid="asm.classpath"/>
</path>
<path id="quick.repl.build.path">
<path refid="quick.compiler.build.path"/>
<pathelement location="${build-quick.dir}/classes/repl"/>
<pathelement location="${jline.jar}"/>
</path>
<path id="quick.swing.build.path">
<path refid="quick.library.build.path"/>
<path refid="quick.actors.build.path"/>
<pathelement location="${build-quick.dir}/classes/swing"/>
</path>
<path id="quick.plugins.build.path">
<path refid="quick.compiler.build.path"/>
<pathelement location="${build-quick.dir}/classes/continuations-plugin"/>
</path>
<path id="quick.scalacheck.build.path">
<pathelement location="${build-quick.dir}/classes/library"/>
<pathelement location="${build-quick.dir}/classes/actors"/>
<pathelement location="${build-quick.dir}/classes/scalacheck"/>
<path refid="partest.extras.classpath"/>
</path>
<path id="quick.scalap.build.path">
<path refid="quick.compiler.build.path"/>
<pathelement location="${build-quick.dir}/classes/scalap"/>
<pathelement location="${build-quick.dir}/classes/partest"/>
</path>
<path id="quick.partest.build.path">
<path refid="quick.scalap.build.path"/>
<path refid="partest.extras.classpath"/>
<pathelement location="${build-quick.dir}/classes/repl"/>
<pathelement location="${scalacheck.jar}"/>
</path>
<path id="quick.scaladoc.build.path">
<path refid="quick.compiler.build.path"/>
<pathelement location="${build-quick.dir}/classes/partest"/>
<pathelement location="${build-quick.dir}/classes/scaladoc"/>
</path>
<path id="quick.interactive.build.path">
<path refid="quick.compiler.build.path"/>
<pathelement location="${build-quick.dir}/classes/scaladoc"/>
<pathelement location="${build-quick.dir}/classes/interactive"/>
</path>
<path id="quick.bin.tool.path">
<path refid="quick.repl.build.path"/>
<path refid="quick.actors.build.path"/>
<pathelement location="${build-quick.dir}/classes/scalap"/>
<pathelement location="${build-quick.dir}/classes/continuations-library"/>
</path>
<!-- PACK -->
<!-- also used for docs.* targets TODO: use separate paths for those -->
<path id="pack.compiler.path">
<pathelement location="${build-pack.dir}/lib/scala-library.jar"/>
<pathelement location="${build-pack.dir}/lib/scala-reflect.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="${build-pack.dir}/lib/scala-actors.jar"/>
<pathelement location="${ant.jar}"/>
<path refid="partest.extras.classpath"/>
<path refid="aux.libs"/>
</path>
<path id="pack.bin.tool.path">
<pathelement location="${build-pack.dir}/lib/scala-library.jar"/>
<pathelement location="${build-pack.dir}/lib/scala-reflect.jar"/>
<pathelement location="${build-pack.dir}/lib/scala-compiler.jar"/>
<pathelement location="${build-pack.dir}/lib/scalap.jar"/>
<pathelement location="${build-pack.dir}/lib/jline.jar"/>
<path refid="aux.libs"/>
</path>
<path id="pack.library.files">
<fileset dir="${build-quick.dir}/classes/library"/>
<fileset dir="${build-quick.dir}/classes/continuations-library"/>
<fileset dir="${forkjoin-classes}"/>
</path>
<path id="pack.actors.files">
<fileset dir="${build-quick.dir}/classes/actors"/>
</path>
<path id="pack.compiler.files">
<fileset dir="${build-quick.dir}/classes/compiler"/>
<fileset dir="${build-quick.dir}/classes/repl"/>
<fileset dir="${build-quick.dir}/classes/scaladoc"/>
<fileset dir="${build-quick.dir}/classes/interactive"/>
<fileset dir="${asm-classes}"/>
</path>
<path id="pack.swing.files"> <fileset dir="${build-quick.dir}/classes/swing"/> </path>
<path id="pack.reflect.files"> <fileset dir="${build-quick.dir}/classes/reflect"/> </path>
<path id="pack.plugins.files"> <fileset dir="${build-quick.dir}/classes/continuations-plugin"/> </path>
<path id="pack.scalacheck.files"> <fileset dir="${build-quick.dir}/classes/scalacheck"/> </path>
<path id="pack.scalap.files"> <fileset dir="${build-quick.dir}/classes/scalap"/>
<fileset file="${src.dir}/scalap/decoder.properties"/> </path>
<path id="pack.partest.files">
<fileset dir="${build-quick.dir}/classes/partest">
<exclude name="scala/tools/partest/javaagent/**"/>
</fileset>
</path>
<path id="pack.partest-javaagent.files">
<fileset dir="${build-quick.dir}/classes/partest">
<include name="scala/tools/partest/javaagent/**"/>
</fileset>
</path>
<!-- STRAP -->
<path id="strap.library.build.path">
<pathelement location="${build-strap.dir}/classes/library"/>
<path refid="forkjoin.classpath"/>
<path refid="aux.libs"/>
</path>
<path id="strap.reflect.build.path">
<path refid="strap.library.build.path"/>
<pathelement location="${build-strap.dir}/classes/reflect"/>
</path>
<path id="strap.compiler.build.path">
<path refid="strap.reflect.build.path"/>
<pathelement location="${build-strap.dir}/classes/compiler"/>
<path refid="asm.classpath"/>
</path>
<!-- MISC -->
<path id="sbt.compile.build.path">
<path refid="quick.compiler.build.path"/>
<pathelement location="${build-quick.dir}/classes/repl"/>
<pathelement location="${build-quick.dir}/classes/scaladoc"/>
<pathelement location="${build-quick.dir}/classes/interactive"/>
<pathelement location="${sbt.interface.jar}"/>
</path>
<path id="manual.classpath">
<pathelement location="${build-pack.dir}/lib/scala-library.jar"/>
<pathelement location="${build.dir}/manmaker/classes"/>
</path>
<path id="partest.classpath">
<path refid="pack.compiler.path"/>
<path refid="partest.extras.classpath"/>
</path>
<!-- obsolete? -->
<!-- TODO - segregate swing tests (there can't be many) -->
<!--
<path id="partest.build.path">
<path refid="pack.compiler.path"/>
<fileset dir="${partest.dir}/files/lib" includes="*.jar" />
<pathelement location="${pack.dir}/lib/scala-swing.jar"/>
</path>
-->
<path id="test.osgi.compiler.build.path">
<pathelement location="${test.osgi.classes}"/>
<pathelement location="${build-osgi.dir}/org.scala-lang.scala-library.jar"/>
<pathelement location="${build-osgi.dir}/org.scala-lang.scala-reflect.jar"/>
<pathelement location="${build-osgi.dir}/org.scala-lang.scala-compiler.jar"/>
<pathelement location="${build-osgi.dir}/org.scala-lang.scala-actors.jar"/>
<path refid="pax.exam.classpath"/>
<path refid="forkjoin.classpath"/>
</path>
<path id="palo.bin.tool.path">
<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"/>
</path>
<path id="test.positions.sub.build.path" path="${build-quick.dir}/classes/library"/>
<!-- TODO: consolidate *.includes -->
<patternset id="partest.includes">
<include name="**/*.xml"/>
</patternset>
<patternset id="lib.includes">
<include name="**/*.tmpl"/>
<include name="**/*.xml"/>
<include name="**/*.js"/>
<include name="**/*.css"/>
</patternset>
<patternset id="lib.rootdoc.includes">
<include name="**/*.tmpl"/>
<include name="**/*.xml"/>
<include name="**/*.js"/>
<include name="**/*.css"/>
<include name="rootdoc.txt"/>
</patternset>
<patternset id="comp.includes">
<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"/>
</patternset>
<taskdef resource="scala/tools/ant/sabbus/antlib.xml" classpathref="starr.compiler.path"/>
</target>
<!-- ===========================================================================
CLEANLINESS
=============================================================================-->
<target name="libs.clean"> <clean build="libs"/> <clean build="asm"/> </target>
<target name="quick.clean" depends="libs.clean"> <clean build="quick"/> <clean build="pack"/> <clean build="strap"/> </target>
<target name="palo.clean" depends="quick.clean"> <clean build="palo"/> </target>
<target name="locker.clean" depends="palo.clean"> <clean build="locker"/> </target>
<target name="docs.clean"> <clean build="docs"/> <delete dir="${build.dir}/manmaker" includeemptydirs="yes" quiet="yes" failonerror="no"/> </target>
<target name="dist.clean"> <delete dir="${dists.dir}" includeemptydirs="yes" quiet="yes" failonerror="no"/> </target>
<target name="all.clean" depends="locker.clean, docs.clean"> <clean build="sbt"/> <clean build="osgi"/> </target>
<!-- Used by the scala-installer script -->
<target name="allallclean" depends="all.clean, dist.clean"/>
<macrodef name="clean">
<attribute name="build"/>
<sequential>
<delete dir="${build-@{build}.dir}" includeemptydirs="yes" quiet="yes" failonerror="no"/>
</sequential>
</macrodef>
<!-- ===========================================================================
LOCAL DEPENDENCIES
============================================================================ -->
<macrodef name="simple-javac" >
<attribute name="project"/> <!-- project: asm/forkjoin -->
<attribute name="args" default=""/>
<attribute name="jar" default="yes"/>
<sequential>
<uptodate property="@{project}.available" targetfile="${build-libs.dir}/@{project}.complete">
<srcfiles dir="${src.dir}/@{project}"/></uptodate>
<if><not><isset property="@{project}.available"/></not><then>
<stopwatch name="@{project}.timer"/>
<mkdir dir="${@{project}-classes}"/>
<javac
debug="true"
srcdir="${src.dir}/@{project}"
destdir="${@{project}-classes}"
classpath="${@{project}-classes}"
includes="**/*.java"
target="1.6" source="1.5"
compiler="javac1.6">
<compilerarg line="${javac.args} @{args}"/>
</javac>
<if><equals arg1="@{jar}" arg2="yes"/><then>
<jar whenmanifestonly="fail" destfile="${build-libs.dir}/@{project}.jar" basedir="${@{project}-classes}"/></then></if>
<stopwatch name="@{project}.timer" action="total"/>
<mkdir dir="${build-libs.dir}"/>
<touch file="${build-libs.dir}/@{project}.complete" verbose="no"/>
</then></if>
</sequential>
</macrodef>
<target name="asm.done" depends="init"> <simple-javac project="asm" jar="no"/> </target>
<target name="forkjoin.done" depends="init"> <simple-javac project="forkjoin" args="-XDignore.symbol.file"/></target>
<!-- ===========================================================================
STAGED COMPILATION MACROS
============================================================================ -->
<macrodef name="staged-javac" >
<attribute name="stage"/> <!-- current stage (locker, quick, strap) -->
<attribute name="project"/> <!-- project: library/reflect/compiler/actors -->
<attribute name="destproject" default="@{project}"/> <!-- overrides the output directory; used when building multiple projects into the same directory-->
<attribute name="args" default=""/>
<attribute name="excludes" default=""/>
<sequential>
<javac
debug="true"
srcdir="${src.dir}/@{project}"
destdir="${build-@{stage}.dir}/classes/@{destproject}"
includes="**/*.java"
excludes="@{excludes}"
target="1.6" source="1.5">
<compilerarg line="${javac.args} @{args}"/>
<classpath refid="@{stage}.@{destproject}.build.path"/>
</javac>
</sequential>
</macrodef>
<!-- Zinc assumes a one-to-one correspondence of output folder to set of source files.
When compiling different sets of source files in multiple compilations to the same output directory,
Zinc thinks source files that appeared in an earlier compilation but are absent in the current one,
were deleted and thus deletes the corresponding output files.
Note that zinc also requires each arg to scalac to be prefixed by -S.
-->
<macrodef name="zinc">
<attribute name="compilerpathref" />
<attribute name="destdir" />
<attribute name="srcdir" />
<attribute name="srcpath" default="NOT SET"/> <!-- needed to compile the library, "NOT SET" is just a convention to denote an optional attribute -->
<attribute name="buildpathref" />
<attribute name="params" default="" />
<attribute name="java-excludes" default=""/>
<sequential>
<local name="sources"/>
<pathconvert pathsep=" " property="sources">
<fileset dir="@{srcdir}">
<include name="**/*.java"/>
<include name="**/*.scala"/>
<exclude name="@{java-excludes}"/>
</fileset>
</pathconvert>
<local name="args"/>
<local name="sargs"/>
<if><not><equals arg1="@{srcpath}" arg2="NOT SET"/></not><then>
<property name="args" value="@{params} -sourcepath @{srcpath}"/>
</then></if>
<property name="args" value="@{params}"/> <!-- default -->
<!-- HACK: prefix scalac args by -S -->
<script language="javascript">
project.setProperty("sargs", project.getProperty("args").trim().replaceAll(" ", " -S"));
</script>
<exec osfamily="unix" executable="tools/zinc" failifexecutionfails="true" failonerror="true">
<arg line="-nailed -compile-order JavaThenScala -scala-path ${ant.refid:@{compilerpathref}} -d @{destdir} -classpath ${toString:@{buildpathref}} ${sargs} ${sources}"/>
</exec>
</sequential>
</macrodef>
<macrodef name="staged-scalac" >
<attribute name="with"/> <!-- will use path `@{with}.compiler.path` to locate scalac -->
<attribute name="stage"/> <!-- current stage (locker, quick, strap) -->
<attribute name="project"/> <!-- project: library/reflect/compiler/actors -->
<attribute name="srcpath" default="NOT SET"/> <!-- needed to compile the library -->
<attribute name="args" default=""/> <!-- additional args -->
<attribute name="destproject" default="@{project}"/> <!-- overrides the output directory; used when building multiple projects into the same directory-->
<attribute name="srcdir" default="@{project}"/>
<attribute name="java-excludes" default=""/>
<sequential>
<!-- TODO: detect zinc anywhere on PATH
use zinc for the quick stage if it's available;
would use it for locker but something is iffy in sbt: get a class cast error on global phase -->
<if><and> <available file="tools/zinc"/>
<equals arg1="@{stage}" arg2="quick"/>
<not><equals arg1="@{project}" arg2="plugins"/></not> <!-- doesn't work in zinc because it requires the quick compiler, which isn't jarred up-->
</and><then>
<zinc taskname="Z.@{stage}.@{project}"
compilerpathref="@{with}.compiler.path"
destdir="${build-@{stage}.dir}/classes/@{destproject}"
srcdir="${src.dir}/@{srcdir}"
srcpath="@{srcpath}"
buildpathref="@{stage}.@{project}.build.path"
params="${scalac.args.@{stage}} @{args}"
java-excludes="@{java-excludes}"/></then>
<else>
<if><equals arg1="@{srcpath}" arg2="NOT SET"/><then>
<scalacfork taskname="@{stage}.@{project}"
jvmargs="${scalacfork.jvmargs}"
compilerpathref="@{with}.compiler.path"
destdir="${build-@{stage}.dir}/classes/@{destproject}"
srcdir="${src.dir}/@{srcdir}"
params="${scalac.args.@{stage}} @{args}">
<include name="**/*.scala"/>
<compilationpath refid="@{stage}.@{project}.build.path"/></scalacfork></then>
<else>
<scalacfork taskname="@{stage}.@{project}"
jvmargs="${scalacfork.jvmargs}"
compilerpathref="@{with}.compiler.path"
destdir="${build-@{stage}.dir}/classes/@{destproject}"
srcdir="${src.dir}/@{srcdir}"
srcpath="@{srcpath}"
params="${scalac.args.@{stage}} @{args}">
<include name="**/*.scala"/>
<compilationpath refid="@{stage}.@{project}.build.path"/></scalacfork></else>
</if>
</else></if>
</sequential>
</macrodef>
<macrodef name="staged-uptodate" >
<attribute name="stage"/>
<attribute name="project"/>
<element name="check"/>
<element name="do"/>
<sequential>
<uptodate property="@{stage}.@{project}.available" targetfile="${build-@{stage}.dir}/@{project}.complete">
<check/>
</uptodate>
<if><not><isset property="@{stage}.@{project}.available"/></not><then>
<do/>
<touch file="${build-@{stage}.dir}/@{project}.complete" verbose="no"/>
</then></if>
</sequential>
</macrodef>
<macrodef name="staged-build" >
<attribute name="with"/> <!-- will use path `@{with}.compiler.path` to locate scalac -->
<attribute name="stage"/> <!-- current stage (locker, quick, strap) -->
<attribute name="project"/> <!-- project: library/reflect/compiler/actors -->
<attribute name="srcpath" default="NOT SET"/> <!-- needed to compile the library -->
<attribute name="args" default=""/> <!-- additional args -->
<attribute name="includes" default="comp.includes"/>
<attribute name="java-excludes" default=""/>
<attribute name="version" default=""/> <!-- non-empty for partest and scaladoc: use @{version}.version.number in property file-->
<sequential>
<staged-uptodate stage="@{stage}" project="@{project}">
<check><srcfiles dir="${src.dir}/@{project}"/></check>
<do>
<stopwatch name="@{stage}.@{project}.timer"/>
<mkdir dir="${build-@{stage}.dir}/classes/@{project}"/>
<staged-javac stage="@{stage}" project="@{project}" excludes="@{java-excludes}"/> <!-- always compile with javac for simplicity and regularity; it's cheap -->
<staged-scalac with="@{with}" stage="@{stage}" project="@{project}" srcpath="@{srcpath}" args="@{args}" java-excludes="@{java-excludes}"/>
<if><equals arg1="@{version}" arg2=""/><then>
<propertyfile file = "${build-@{stage}.dir}/classes/@{project}/@{project}.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>
</then><else>
<propertyfile file = "${build-@{stage}.dir}/classes/@{project}/@{project}.properties">
<entry key = "version.number" value="${@{version}.version.number}"/>
<entry key = "copyright.string" value="${copyright.string}"/>
</propertyfile>
</else></if>
<copy todir="${build-@{stage}.dir}/classes/@{project}">
<fileset dir="${src.dir}/@{project}">
<patternset refid="@{includes}"/>
</fileset>
</copy>
<stopwatch name="@{stage}.@{project}.timer" action="total"/>
</do>
</staged-uptodate>
</sequential>
</macrodef>
<macrodef name="staged-bin">
<attribute name="stage"/>
<attribute name="classpathref" default="NOT SET"/>
<sequential>
<staged-uptodate stage="@{stage}" project="bin">
<check>
<srcfiles dir="${src.dir}">
<include name="compiler/scala/tools/ant/templates/**"/>
</srcfiles>
</check>
<do>
<taskdef name="mk-bin" classname="scala.tools.ant.ScalaTool" classpathref="@{stage}.bin.tool.path"/>
<mkdir dir="${build-@{stage}.dir}/bin"/>
<if><equals arg1="@{classpathref}" arg2="NOT SET"/><then>
<mk-bin file="${build-@{stage}.dir}/bin/scala" class="scala.tools.nsc.MainGenericRunner" javaFlags="${java.flags}"/>
<mk-bin file="${build-@{stage}.dir}/bin/scalac" class="scala.tools.nsc.Main" javaFlags="${java.flags}"/>
<mk-bin file="${build-@{stage}.dir}/bin/scaladoc" class="scala.tools.nsc.ScalaDoc" javaFlags="${java.flags}"/>
<mk-bin file="${build-@{stage}.dir}/bin/fsc" class="scala.tools.nsc.CompileClient" javaFlags="${java.flags}"/>
<mk-bin file="${build-@{stage}.dir}/bin/scalap" class="scala.tools.scalap.Main" javaFlags="${java.flags}"/>
</then><else>
<mk-bin file="${build-@{stage}.dir}/bin/scala" class="scala.tools.nsc.MainGenericRunner" javaFlags="${java.flags}" classpathref="@{classpathref}"/>
<mk-bin file="${build-@{stage}.dir}/bin/scalac" class="scala.tools.nsc.Main" javaFlags="${java.flags}" classpathref="@{classpathref}"/>
<mk-bin file="${build-@{stage}.dir}/bin/scaladoc" class="scala.tools.nsc.ScalaDoc" javaFlags="${java.flags}" classpathref="@{classpathref}"/>
<mk-bin file="${build-@{stage}.dir}/bin/fsc" class="scala.tools.nsc.CompileClient" javaFlags="${java.flags}" classpathref="@{classpathref}"/>
<mk-bin file="${build-@{stage}.dir}/bin/scalap" class="scala.tools.scalap.Main" javaFlags="${java.flags}" classpathref="@{classpathref}"/>
</else></if>
<chmod perm="ugo+rx" file="${build-@{stage}.dir}/bin/scala"/>
<chmod perm="ugo+rx" file="${build-@{stage}.dir}/bin/scalac"/>
<chmod perm="ugo+rx" file="${build-@{stage}.dir}/bin/scaladoc"/>
<chmod perm="ugo+rx" file="${build-@{stage}.dir}/bin/fsc"/>
<chmod perm="ugo+rx" file="${build-@{stage}.dir}/bin/scalap"/>
</do>
</staged-uptodate>
</sequential>
</macrodef>