-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
961 lines (827 loc) · 42.7 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
<project name="ScalaTest" default="dist" basedir="."
xmlns:artifact="antlib:org.apache.maven.artifact.ant">
<path id="maven-ant-tasks.classpath" path="ant-lib/maven-ant-tasks-2.1.1.jar" />
<typedef resource="org/apache/maven/artifact/ant/antlib.xml"
uri="antlib:org.apache.maven.artifact.ant"
classpathref="maven-ant-tasks.classpath" />
<!-- set global properties for this build -->
<property name="release" value="2.0-SNAPSHOT" />
<property name="scala.version" value="2.9.0" />
<property name="scalasrc" value="src/main/scala" />
<property name="javasrc" value="src/main/java" />
<property name="scalasrc.test" value="src/test/scala" />
<property name="javasrc.test" value="src/test/java" />
<property name="scalasrc.examples" value="src/examples/scala" />
<property name="javasrc.examples" value="src/examples/java" />
<property name="resources" value="src/main/resources" />
<property name="html" value="src/main/html" />
<property name="images" value="${resources}/images" />
<property name="build" value="target" />
<property name="jar.contents" value="${build}/jar_contents" />
<!-- classes go in jar.contents. redundant, but makes the rest of build.xml easier to read -->
<property name="classes" value="${jar.contents}" />
<property name="generators" value="src/generators/scala" />
<property name="build.generated.src" value="${build}/generated/src/main/scala" />
<property name="build.generated.tests" value="${build}/generated/src/test/scala" />
<property name="build.tests" value="${build}/tests" />
<property name="build.tests.jar" value="${build}/tests.jar" />
<property name="build.examples" value="${build}/examples" />
<property name="build.generators" value="${build}/generators" />
<property name="build.coverage" value="${build}/coverage" />
<property name="dist" value="${build}/dist" />
<property name="instrumented" value="${build}/instrumented" />
<property name="doc" value="${build}/doc" />
<property name="jdoc" value="${build}/jdoc" />
<property name="zipper" value="zipper" />
<property name="project.name" value="ScalaTest" />
<property name="demo" value="${build}/demo" />
<property name="demodoc" value="${demo}/example/javadoc" />
<property name="example" value="${demo}/example" />
<property name="jvmargs" value="-Xmx3000M -Xss10M"/>
<!--
<property name="build.compiler" value="jikes"/>
-->
<target name="init">
<!-- Create the time stamp -->
<tstamp />
<!-- Create the build directory structure used by compile -->
<mkdir dir="${jar.contents}" />
<mkdir dir="${build.tests}" />
<mkdir dir="${build.examples}" />
<mkdir dir="${build.generators}" />
<mkdir dir="${build.generated.src}" />
<mkdir dir="${build.generated.tests}" />
<mkdir dir="${dist}" />
<mkdir dir="${demodoc}" />
<mkdir dir="${doc}" />
<mkdir dir="${jdoc}" />
<mkdir dir="${jdoc}" />
<copy file="pom_template.xml" tofile="${build}/pom.xml" overwrite="true">
<filterset>
<filter token="RELEASE" value="${release}" />
<filter token="SCALA_VERSION" value="${scala.version}" />
</filterset>
</copy>
<artifact:dependencies pathId="lib.path" useScope="test">
<pom file="${build}/pom.xml"/>
</artifact:dependencies>
<path id="build.class.path">
<pathelement location="${classes}" />
<pathelement location="lib/txtmark.jar" />
<path refid="lib.path"></path>
</path>
<!-- this is the class path used to run ScalaTest to test itself, in the "test" target -->
<path id="test.class.path">
<pathelement location="${classes}" />
<pathelement location="${build.examples}" />
<path refid="lib.path"></path>
</path>
<path id="coverage.class.path">
<pathelement location="${instrumented}" />
<pathelement location="${classes}" />
<path refid="lib.path"></path>
</path>
<path id="build.test.class.path">
<pathelement location="${classes}" />
<pathelement location="${build.tests}" />
<path refid="lib.path"></path>
</path>
<path id="build.generators.class.path">
<pathelement location="${org.antlr:stringtemplate:jar}" />
<pathelement location="${org.scala-lang:scala-library:jar}" />
</path>
<path id="run.generators.class.path">
<pathelement location="${build.generators}" />
<pathelement location="${org.scala-lang:scala-library:jar}" />
<pathelement location="${org.antlr:stringtemplate:jar}" />
<pathelement location="${antlr:antlr:jar}" />
</path>
<taskdef resource="scala/tools/ant/antlib.xml">
<classpath>
<pathelement location="${org.scala-lang:scala-library:jar}" />
<pathelement location="${org.scala-lang:scala-compiler:jar}" />
</classpath>
</taskdef>
<path id="scaladoc.source.path">
<pathelement location="${scalasrc}" />
<pathelement location="${build.generated.src}" />
</path>
<path id="cobertura.class.path">
<pathelement location="${net.sourceforge.cobertura:cobertura:jar}" />
<pathelement location="${asm:asm:jar}" />
<pathelement location="${asm:asm-tree:jar}" />
<pathelement location="${oro:oro:jar}" />
<pathelement location="${log4j:log4j:jar}" />
</path>
<uptodate property="gentables.uptodate"
srcfile="src/generators/scala/GenTable.scala">
<mapper type="merge" to=
"target/generated/src/main/scala/org/scalatest/prop/TableFor1.scala">
</mapper>
</uptodate>
<uptodate property="gengen.uptodate"
srcfile="src/generators/scala/GenGen.scala">
<mapper type="merge" to=
"target/generated/src/main/scala/org/scalatest/prop/GeneratorDrivenPropertyChecks.scala">
</mapper>
</uptodate>
</target>
<target name="taskdefscalatest">
<taskdef name="scalatest" classname="org.scalatest.tools.ScalaTestAntTask">
<classpath refid="build.class.path" />
</taskdef>
</target>
<target name="clean">
<delete dir="${build}" />
<delete dir="test-output" quiet="true" />
</target>
<target name="compile-codegenerators" depends="init">
<scalac srcdir="${generators}" destdir="${build.generators}" target="jvm-1.5" deprecation="yes" classpathref="build.generators.class.path" />
</target>
<target name="gentables" depends="init, compile-codegenerators"
unless="gentables.uptodate">
<java classname="GenTable" classpathref="run.generators.class.path"
fork="false" />
</target>
<target name="gengen" depends="init, compile-codegenerators"
unless="gengen.uptodate">
<java classname="GenGen" classpathref="run.generators.class.path" fork="false" />
</target>
<target name="gendeprecatedshouldtests" depends="init, compile-codegenerators">
<!-- Then, run it. -->
<java classname="GenDeprecatedShouldMatchersTests" classpathref="run.generators.class.path" fork="false" />
</target>
<target name="gencode" depends="init, compile-codegenerators">
<java classname="GenMustMatchers" classpathref="run.generators.class.path" fork="false" />
<java classname="GenMustMatchersTests" classpathref="run.generators.class.path" fork="false" />
</target>
<target name="compile" depends="compile-main, compile-tests, compile-examples"/>
<!--<target name="compile-main" depends="init">-->
<target name="compile-main" depends="get-jvm, init, gentables, gengen">
<fail message="Wrong JVM [${ant.java.version}]. Include 'java6' target to use java 6."
unless="jvm.ok"/>
<!-- If ever want to see the typer output, add -Xprint:typer to the addparams like this: -->
<!--<scalac srcdir="${scalasrc}:${build.generated.src}:${javasrc}" destdir="${classes}" target="jvm-1.5" classpathref="build.class.path" addparams="-no-specialization -Xprint:typer" fork="true" jvmargs="${jvmargs}" />-->
<!-- Compile the Scala code from ${scalasrc} into ${classes}. Scalac will parse the referenced .java files. -->
<!-- Compile the Scala code from ${build.generated.src} into ${classes}. Scalac will parse any referenced .java files. -->
<scalac srcdir="${scalasrc}:${build.generated.src}:${javasrc}" destdir="${classes}" target="jvm-1.5" deprecation="no" classpathref="build.class.path" addparams="-no-specialization" fork="true" jvmargs="${jvmargs}" />
<!-- Compile the Java code from ${javasrc} into ${classes} -->
<javac srcdir="${javasrc}" destdir="${classes}" compiler="javac1.5" memoryMaximumSize="1500M" fork="true" classpathref="build.class.path" debug="yes">
<include name="org/scalatest/Ignore.java" />
<include name="org/scalatest/DoNotDiscover.java" />
<include name="org/scalatest/tools/ScalaTestTask.java" />
<include name="org/scalatest/WrapWith.java" />
</javac>
<!-- copy these here not in dist because sometimes I like to do -cp target/jar_contents things, such as REPL sessions -->
<antcall target="copy-resources"/>
<!-- TODO: Delete this if the antcall works
<copy file="${resources}/org/scalatest/ScalaTestBundle.properties" todir="${jar.contents}/org/scalatest" />
<copy todir="${jar.contents}/images">
<fileset dir="${images}" />
</copy>
-->
</target>
<target name="copy-resources">
<copy file="${resources}/org/scalatest/ScalaTestBundle.properties" todir="${jar.contents}/org/scalatest" />
<copy todir="${jar.contents}/images">
<fileset dir="${images}" />
</copy>
</target>
<target name="compile-tests" depends="compile-main">
<!-- Compile the Scala code from ${scalasrc.test} into ${build.tests} -->
<scalac srcdir="${scalasrc.test}:${javasrc.test}" destdir="${build.tests}" target="jvm-1.5" classpathref="build.test.class.path" deprecation="yes" addparams="-no-specialization" fork="true" jvmargs="${jvmargs} -XX:+UseConcMarkSweepGC"/>
<!-- Compile the Scala code from ${build.generated.tests} into ${classes}. Scalac will parse any referenced .java files. -->
<scalac srcdir="${build.generated.tests}" destdir="${build.tests}" target="jvm-1.5" classpathref="build.test.class.path" deprecation="yes" addparams="-no-specialization" fork="true" jvmargs="${jvmargs}" />
<!-- Compile the Java code from ${javasrc.test} into ${build.tests} -->
<javac srcdir="${javasrc.test}" destdir="${build.tests}" compiler="javac1.5" memoryMaximumSize="2000M" fork="true" classpath="${classes}:${org.scala-lang:scala-library:jar}:${junit:junit:jar}" debug="yes" />
</target>
<target name="compile-examples" depends="compile-main">
<!-- Compile the Scala code from ${scalasrc.examples} into ${build.examples} -->
<scalac srcdir="${scalasrc.examples}:${javasrc.examples}" destdir="${build.examples}" target="jvm-1.5" classpathref="build.test.class.path" addparams="-no-specialization" deprecation="yes" fork="true" jvmargs="${jvmargs} -XX:+UseConcMarkSweepGC"/>
<!-- Compile the Java code from ${examples} into ${build.examples} -->
<javac srcdir="${javasrc.examples}" destdir="${build.examples}" compiler="javac1.5" classpath="${classes}:${org.easymock:easymock:jar}:${org.scala-lang:scala-library:jar}" debug="yes" />
</target>
<!-- Compile demo into its own directory. I.e., the class files will sit alongside the java files
so that people can more easily look at them. All of these source files are used as demonstrations
of something, usually described in articles on Artima.com. -->
<target name="demo" depends="dist">
<javac srcdir="${example}" destdir="${example}" compiler="javac1.5" classpath="${classes}:${junit:junit:jar}" debug="yes" />
</target>
<target name="jartests" depends="compile">
<jar jarfile="${build.tests.jar}" basedir="${build.tests}" includes="org/scalatest/**/*.class" />
</target>
<target name="doc" depends="compile-main">
<javadoc sourcepath="${javasrc}" destdir="${jdoc}" packagenames="org.scalatest,org.scalatest.tools" classpathref="build.class.path" windowtitle="ScalaTest ${release}" doctitle="ScalaTest ${release}" bottom="Copyright (C) 2001-2010 Artima, Inc. All rights reserved." />
<scaladoc addparams="-no-specialization" srcref="scaladoc.source.path" destdir="${doc}" classpathref="build.class.path" doctitle="ScalaTest ${release}">
<include name="**/*.scala" />
</scaladoc>
<concat destfile="${doc}/lib/template.css" force="yes">
<filelist dir="${html}" files="template.css, addl.css"/>
</concat>
<!--
<javadoc sourcepath="${example}"
destdir="${demodoc}"
packagenames="com.artima.examples.*"
classpath="${classes}:${junit:junit:jar}"
windowtitle="ScalaTest Examples ${release}"
doctitle="ScalaTest Examples ${release}"
bottom="Copyright (C) 2001-2009 Artima, Inc. All rights reserved."/>
-->
</target>
<!-- Put everything in ${jar.contents} into the scalatest.jar file -->
<target name="dist" depends="compile">
<!-- Create the distribution directory -->
<mkdir dir="${dist}/lib" />
<delete file="${dist}/lib/scalatest.jar" />
<taskdef resource="aQute/bnd/ant/taskdef.properties"
classpath="ant-lib/biz.aQute.bnd.jar"/>
<!-- Create jar, including OSGi metadata -->
<bnd classpath="${jar.contents}" sourcepath="${jar.contents}"
eclipse="false" failok="false" exceptions="true" files="osgi.bnd"
output="${dist}/lib/scalatest.jar" />
<jar jarfile="${dist}/lib/scalatest-wbt.jar" basedir="${build.tests}" includes="org/scalatest/*.class" />
<echo message="All finished building ${project.name}!" />
</target>
<target name="zipper" depends="allfiles">
<delete dir="${zipper}" />
<mkdir dir="${zipper}" />
<copy file="${dist}/lib/scalatest.jar" tofile="${zipper}/scalatest-${release}/scalatest-${release}.jar" />
<copy file="${dist}/lib/scalatest-wbt.jar" tofile="${zipper}/scalatest-${release}/scalatest-${release}-tests.jar" />
<copy file="README.txt" tofile="${zipper}/scalatest-${release}/README.txt" />
<copy file="LICENSE" tofile="${zipper}/scalatest-${release}/LICENSE" />
<copy file="NOTICE" tofile="${zipper}/scalatest-${release}/NOTICE" />
<copy todir="${zipper}/scalatest-${release}/doc">
<fileset dir="${doc}/" />
</copy>
<copy todir="${zipper}/scalatest-${release}/src">
<fileset dir="src/" />
</copy>
<!--
<zip zipfile="${zipper}/scalatest-${release}/scalatest-${release}-src.zip" basedir="${src}"/>
<zip zipfile="${zipper}/scalatest-${release}/scalatest-${release}-tests-src.zip" basedir="${tests}"/>
-->
<zip zipfile="scalatest-${release}.zip" basedir="${zipper}" />
</target>
<target name="copyprops">
<copy file="${resources}/org/scalatest/ScalaTestBundle.properties" todir="${jar.contents}/org/scalatest" overwrite="true">
<filterset>
<filter token="RELEASE" value="${release}" />
<filter token="SCALAVERSION" value="${scala.version}" />
</filterset>
</copy>
<copy todir="${jar.contents}/images">
<fileset dir="${images}" />
</copy>
</target>
<!--
- Called from 'test' and 'testfromjar' targets.
-->
<target name="runtest" depends="compile,copyprops,taskdefscalatest">
<mkdir dir="target/dash" />
<scalatest fork="true" runpath="${test.runpath}" parallel="true" haltonfailure="true">
<jvmarg value="-XX:MaxPermSize=512m"/>
<reporter type="graphic"/>
<reporter type="dashboard" directory="target/dash" numfiles="3" />
<reporter type="junitxml" directory="target"/>
<reporter type="stdout" config="D"/>
<membersonly package="org.scalatest" />
<membersonly package="org.scalatest.fixture" />
<membersonly package="org.scalatest.concurrent" />
<membersonly package="org.scalatest.testng" />
<membersonly package="org.scalatest.junit" />
<membersonly package="org.scalatest.events" />
<membersonly package="org.scalatest.prop" />
<membersonly package="org.scalatest.tools" />
<membersonly package="org.scalatest.matchers" />
<membersonly package="org.scalatest.suiteprop" />
<membersonly package="org.scalatest.mock" />
<membersonly package="org.scalatest.path" />
<config name="dbname" value="testdb" />
</scalatest>
</target>
<target name="testfromjar" depends="jartests"
description="test from test.jar after jarring test class files">
<property name="test.runpath" value="${build.tests.jar}"/>
<antcall target="runtest"/>
</target>
<target name="test"
description="test using test class files stored in directory tree">
<property name="test.runpath" value="${build.tests}"/>
<antcall target="runtest"/>
</target>
<target name="shouldmatcherstest" depends="compile,copyprops,jartests,taskdefscalatest">
<scalatest runpath="${build.tests.jar}" concurrent="false" haltonfailure="true">
<reporter type="stdout" config="D"/>
<suite classname="org.scalatest.matchers.ShouldBeASymbolSpec"/>
<suite classname="org.scalatest.matchers.ShouldBeAnSymbolSpec"/>
<suite classname="org.scalatest.matchers.ShouldBeMatcherSpec"/>
<suite classname="org.scalatest.matchers.ShouldBeNullSpec"/>
<suite classname="org.scalatest.matchers.ShouldBePropertyMatcherSpec"/>
<suite classname="org.scalatest.matchers.ShouldBeSymbolSpec"/>
<suite classname="org.scalatest.matchers.ShouldBehaveLikeSpec"/>
<suite classname="org.scalatest.matchers.ShouldContainElementSpec"/>
<suite classname="org.scalatest.matchers.ShouldContainKeySpec"/>
<suite classname="org.scalatest.matchers.ShouldContainValueSpec"/>
<suite classname="org.scalatest.matchers.ShouldEndWithRegexSpec"/>
<suite classname="org.scalatest.matchers.ShouldEndWithSubstringSpec"/>
<suite classname="org.scalatest.matchers.ShouldEqualSpec"/>
<suite classname="org.scalatest.matchers.ShouldFullyMatchSpec"/>
<suite classname="org.scalatest.matchers.ShouldHavePropertiesSpec"/>
<suite classname="org.scalatest.matchers.ShouldIncludeRegexSpec"/>
<suite classname="org.scalatest.matchers.ShouldIncludeSubstringSpec"/>
<suite classname="org.scalatest.matchers.ShouldLengthSpec"/>
<suite classname="org.scalatest.matchers.ShouldLogicalMatcherExprSpec"/>
<suite classname="org.scalatest.matchers.ShouldMatcherSpec"/>
<suite classname="org.scalatest.matchers.ShouldOrderedSpec"/>
<suite classname="org.scalatest.matchers.ShouldPlusOrMinusSpec"/>
<suite classname="org.scalatest.matchers.ShouldSameInstanceAsSpec"/>
<suite classname="org.scalatest.matchers.ShouldSizeSpec"/>
<suite classname="org.scalatest.matchers.ShouldStartWithRegexSpec"/>
<suite classname="org.scalatest.matchers.ShouldStartWithSubstringSpec"/>
</scalatest>
</target>
<target name="mustmatcherstest" depends="compile,copyprops,jartests,taskdefscalatest">
<scalatest runpath="${build.tests.jar}" concurrent="false" haltonfailure="true">
<reporter type="stdout" config="D"/>
<suite classname="org.scalatest.matchers.MustBeASymbolSpec"/>
<suite classname="org.scalatest.matchers.MustBeAnSymbolSpec"/>
<suite classname="org.scalatest.matchers.MustBeMatcherSpec"/>
<suite classname="org.scalatest.matchers.MustBeNullSpec"/>
<suite classname="org.scalatest.matchers.MustBePropertyMatcherSpec"/>
<suite classname="org.scalatest.matchers.MustBeSymbolSpec"/>
<suite classname="org.scalatest.matchers.MustBehaveLikeSpec"/>
<suite classname="org.scalatest.matchers.MustContainElementSpec"/>
<suite classname="org.scalatest.matchers.MustContainKeySpec"/>
<suite classname="org.scalatest.matchers.MustContainValueSpec"/>
<suite classname="org.scalatest.matchers.MustEndWithRegexSpec"/>
<suite classname="org.scalatest.matchers.MustEndWithSubstringSpec"/>
<suite classname="org.scalatest.matchers.MustEqualSpec"/>
<suite classname="org.scalatest.matchers.MustFullyMatchSpec"/>
<suite classname="org.scalatest.matchers.MustHavePropertiesSpec"/>
<suite classname="org.scalatest.matchers.MustIncludeRegexSpec"/>
<suite classname="org.scalatest.matchers.MustIncludeSubstringSpec"/>
<suite classname="org.scalatest.matchers.MustLengthSpec"/>
<suite classname="org.scalatest.matchers.MustLogicalMatcherExprSpec"/>
<suite classname="org.scalatest.matchers.MustMatcherSpec"/>
<suite classname="org.scalatest.matchers.MustOrderedSpec"/>
<suite classname="org.scalatest.matchers.MustPlusOrMinusSpec"/>
<suite classname="org.scalatest.matchers.MustSameInstanceAsSpec"/>
<suite classname="org.scalatest.matchers.MustSizeSpec"/>
<suite classname="org.scalatest.matchers.MustStartWithRegexSpec"/>
<suite classname="org.scalatest.matchers.MustStartWithSubstringSpec"/>
</scalatest>
</target>
<target name="examples" depends="compile-main,compile-examples,copyprops,taskdefscalatest">
<scalatest runpath="${build.examples}" concurrent="false" haltonfailure="true">
<reporter type="graphic"/>
<reporter type="stdout"/>
<!--
<suite classname="org.scalatestexamples.ParallelTestExecutionExampleSpec" />
-->
<membersonly package="org.scalatestexamples" />
<membersonly package="org.scalatestexamples.concurrent" />
<membersonly package="org.scalatestexamples.fixture" />
<membersonly package="org.scalatestexamples.matchers" />
</scalatest>
</target>
<target name="coverage" depends="compile,copyprops,instrument,jartests">
<java classname="org.scalatest.tools.Runner" classpathref="coverage.class.path" fork="true">
<arg value="-p" />
<arg value="${build.tests.jar} ${classes}" />
<arg value="-o" />
<arg value="-m" />
<arg value="org.scalatest" />
<arg value="-m" />
<arg value="org.scalatest.fixture" />
<arg value="-m" />
<arg value="org.scalatest.concurrent" />
<arg value="-m" />
<arg value="org.scalatest.matchers" />
<arg value="-m" />
<arg value="org.scalatest.testng" />
<arg value="-m" />
<arg value="org.scalatest.junit" />
<arg value="-m" />
<arg value="org.scalatest.events" />
<arg value="-m" />
<arg value="org.scalatest.prop" />
<arg value="-m" />
<arg value="org.scalatest.tools" />
<arg value="-m" />
<arg value="org.scalatest.mock" />
<!--
<arg value="-s" />
<arg value="org.scalatest.concurrent.ConductorSuite" />
-->
</java>
<echo message="starting cobertura-report..." />
<cobertura-report srcdir="${scalasrc}" destdir="${build.coverage}"/>
<echo message="... finished cobertura-report" />
</target>
<target name="bvtest" depends="compile-main,compile-tests,copyprops,taskdefscalatest">
<scalatest runpath="${build.tests};${classes}" haltonfailure="true">
<reporter type="graphic"/>
<reporter type="stdout" config="NF"/>
<suite classname="org.scalatest.SuiteSuite7" />
<!--
<suite classname="org.scalatest.FunSuiteSuite" />
<suite classname="org.scalatest.SuiteSpec" />
<suite classname="org.scalatest.FunSuiteSpec" />
<suite classname="org.scalatest.SpecSpec" />
<suite classname="org.scalatest.FlatSpecSpec" />
<suite classname="org.scalatest.WordSpecSpec" />
<suite classname="org.scalatest.FeatureSpecSpec" />
<suite classname="org.scalatest.fixture.FixtureSuiteSpec" />
<suite classname="org.scalatest.fixture.FixtureFunSuiteSpec" />
<suite classname="org.scalatest.fixture.FixtureSpecSpec" />
<suite classname="org.scalatest.fixture.FixtureFlatSpecSpec" />
<suite classname="org.scalatest.fixture.FixtureWordSpecSpec" />
<suite classname="org.scalatest.fixture.FixtureFeatureSpecSpec" />
<membersonly package="org.scalatest.concurrent" />
<suite classname="org.scalatest.concurrent.ConductorSuite" />
<suite classname="org.scalatest.fixture.FixtureFlatSpecSuite" />
<suite classname="org.scalatest.FlatSpecSpec" />
<suite classname="org.scalatest.verb.CanVerbSuite" />
<suite classname="org.scalatest.fixture.FixtureFeatureSpecSuite" />
<suite classname="org.scalatest.fixture.FixtureSpecSuite" />
<suite classname="org.scalatest.fixture.FixtureWordSpecSuite" />
<suite classname="org.scalatest.fixture.FixtureFunSuiteSpec" />
<suite classname="org.scalatest.fixture.FixtureSuiteSpec" />
<suite classname="org.scalatest.fixture.GoodiesSuiteSpec" />
<suite classname="org.scalatest.StackFlatSpec" />
<suite classname="org.scalatest.StackWordSpec" />
<suite classname="org.scalatest.WordSpecSpec" />
<suite classname="org.scalatestexamples.TVFeatureSpec" />
<suite classname="org.scalatest.AmpersandWordSpec" />
<suite classname="org.scalatest.LoginUiWordSpec" />
<suite classname="org.scalatest.StackFlatSpec" />
<suite classname="org.scalatest.SpecSpec" />
<suite classname="org.scalatest.FlatSpecSpec" />
<suite classname="org.scalatest.fixture.GoodiesSuiteSpec" />
<suite classname="org.scalatest.fixture.FixtureSuiteSpec" />
<suite classname="org.scalatest.SpecSpec" />
<suite classname="org.scalatest.FunSuiteSpec" />
<suite classname="org.scalatest.SuiteSpec" />
-->
</scalatest>
<!--
<scalatest runpath="${build.tests};${classes}" haltonfailure="true">
<reporter type="stdout" />
<suite classname="org.scalatest.CatchReporterSuite" />
</scalatest>
-->
</target>
<target name="runsuite" depends="compile,copyprops,taskdefscalatest"
description="run a specified suite (use -Dclass=classname)">
<fail message="class not defined (use -Dclass=classname)"
unless="class" />
<scalatest runpath="${build.tests};${classes}" haltonfailure="true">
<reporter type="graphic"/>
<!--<reporter type="file" filename="test.out" config="ND"/>-->
<reporter type="stdout" config="N"/>
<suite classname="${class}"/>
</scalatest>
</target>
<target name="runexample" depends="compile,copyprops,taskdefscalatest"
description="run a specified suite (use -Dclass=classname)">
<fail message="class not defined (use -Dclass=classname)"
unless="class" />
<scalatest runpath="${build.examples};${classes}" haltonfailure="true">
<!--
<property name="tempFileName" value="TempFile.txt"/>
-->
<excludes>SlowTest</excludes>
<reporter type="graphic"/>
<reporter type="stdout"/>
<suite classname="${class}"/>
</scalatest>
</target>
<path id="example.class.path">
<pathelement location="${dist}/lib/scalatest.jar" />
<pathelement location="${classes}" />
<pathelement location="${build.tests}" />
<path refid="lib.path"></path>
</path>
<target name="testng-example" depends="dist">
<run-example package="org.scalatest.testng.example" />
</target>
<target name="junit-example" depends="dist">
<run-example package="org.scalatest.junit.example" />
</target>
<macrodef name="run-example">
<attribute name="package" />
<sequential>
<java classname="org.scalatest.tools.Runner" classpathref="example.class.path" fork="true">
<arg value="-p" />
<arg value="${build.tests} ${classes}" />
<arg value="-g" />
<arg value="-o" />
<arg value="-m" />
<arg value="@{package}" />
</java>
</sequential>
</macrodef>
<target name="allfiles" depends="dist, doc, demo" />
<target name="instrument" depends="compile">
<taskdef classpathref="cobertura.class.path" resource="tasks.properties"/>
<!--
Remove the coverage data file and any old instrumentation.
-->
<delete file="cobertura.ser"/>
<delete dir="${instrumented}" />
<!--
Instrument the application classes, writing the
instrumented classes into ${build.instrumented.dir}.
-->
<cobertura-instrument todir="${instrumented}">
<!--
The following line causes instrument to ignore any
source line containing a reference to log4j, for the
purposes of coverage reporting.
-->
<ignore regex="org.apache.log4j.*" />
<fileset dir="${jar.contents}">
<include name="**/*.class" />
</fileset>
</cobertura-instrument>
</target>
<target name="ant-task-test" depends="compile,taskdefscalatest">
<scalatest runpath="${build.tests};${classes}" haltonfailure="true">
<runpath>
<pathelement location="dist" />
</runpath>
<runpathurl url="http://foo.com/bar.jar" />
<suite classname="org.scalatest.SuiteSuite" />
<reporter type="stdout" />
<reporter type="graphic" />
</scalatest>
</target>
<target name="jar" depends="dist"></target>
<target name="jarsrc">
<jar jarfile="${build}/scalatest-sources.jar">
<fileset dir="src/main/scala"/>
<fileset dir="src/main/java"/>
<fileset dir="src/main/resources" includes="org/**"/>
<fileset dir="src/examples/scala"/>
<fileset dir="src/examples/java"/>
<fileset dir="target/generated/src/main/scala"/>
</jar>
</target>
<target name="jartestsrc">
<jar jarfile="${build}/scalatest-test-sources.jar">
<fileset dir="src/test/scala"/>
<fileset dir="src/test/java"/>
<fileset dir="target/generated/src/test/scala"/>
</jar>
</target>
<!--
- Deploy to remote repository.
-
- Requires username and password for repository to be defined in your
- ~/.m2/settings.xml file, e.g.:
-
- <servers>
- <server>
- <id>scala-tools.org</id>
- <username>username</username>
- <password>password</password>
- </server>
- </servers>
-
-->
<target name="deploy" depends="jar,jartests,jarsrc,jartestsrc,doc">
<jar jarfile="${build}/scalatest-scaladoc.jar" basedir="${doc}"/>
<jar jarfile="${build}/scalatest-javadoc.jar" basedir="${jdoc}"/>
<property name="deploy.main"
value="${dist}/lib/scalatest.jar"/>
<property name="deploy.tests"
value="${build.tests.jar}"/>
<property name="deploy.sources"
value="${build}/scalatest-sources.jar"/>
<property name="deploy.test-sources"
value="${build}/scalatest-test-sources.jar"/>
<property name="deploy.scaladoc"
value="${build}/scalatest-scaladoc.jar"/>
<property name="deploy.javadoc"
value="${build}/scalatest-javadoc.jar"/>
<property name="deploy.release"
value="${release}"/>
<antcall target="deploy-jars"/>
</target>
<!--
- Redeploys an already-deployed release, naming it with a different
- scala version. E.g., if you have a release based on artifact:
-
- scalatest_2.9.0
-
- then this target could be used to redeploy it to an artifact named,
- e.g.:
-
- scalatest_2.9.0-1
-
- Requires three properties, old.scala.version, new.scala.version,
- and scalatest.version to be defined on the command line, e.g.:
-
- ant redeploy -Dold.scala.version='2.9.0'
- -Dnew.scala.version='2.9.0-1'
- -Dscalatest.version=1.6.1
-
- Retrieves the specified jars from the maven repo, in this case
- for artifact scalatest_2.9.0, version 1.6.1, and redeploys them
- using the new artifact name, in this case scalatest_2.9.0-1.
-->
<target name="redeploy"
description="redeploy a release using a different scala version tag">
<fail message="Missing old.scala.version definition."
unless="old.scala.version" />
<fail message="Missing new.scala.version definition."
unless="new.scala.version" />
<fail message="Missing scalatest.version definition."
unless="scalatest.version" />
<artifact:dependencies filesetId="old.scala.fileset"
versionsId="dependency.versions">
<dependency groupId="org.scalatest"
artifactId="scalatest_${old.scala.version}"
version="${scalatest.version}" />
<dependency groupId="org.scalatest"
artifactId="scalatest_${old.scala.version}"
version="${scalatest.version}"
classifier="tests"/>
<dependency groupId="org.scalatest"
artifactId="scalatest_${old.scala.version}"
version="${scalatest.version}"
classifier="sources"/>
<dependency groupId="org.scalatest"
artifactId="scalatest_${old.scala.version}"
version="${scalatest.version}"
classifier="test-sources"/>
<dependency groupId="org.scalatest"
artifactId="scalatest_${old.scala.version}"
version="${scalatest.version}"
classifier="scaladoc"/>
<dependency groupId="org.scalatest"
artifactId="scalatest_${old.scala.version}"
version="${scalatest.version}"
classifier="javadoc"/>
</artifact:dependencies>
<copy file="pom_template.xml" tofile="${build}/pom.xml" overwrite="true">
<filterset>
<filter token="RELEASE" value="${scalatest.version}" />
<filter token="SCALA_VERSION" value="${new.scala.version}" />
</filterset>
</copy>
<delete dir="target/redeploy" />
<mkdir dir="target/redeploy" />
<copy todir="target/redeploy" verbose="true">
<fileset refid="old.scala.fileset" />
<mapper classpathref="maven-ant-tasks.classpath"
classname="org.apache.maven.artifact.ant.VersionMapper"
from="${scalatest.version}" to="flatten" />
</copy>
<move todir="target/redeploy" verbose="true">
<fileset dir="target/redeploy" includes="scalatest_*.jar"/>
<globmapper from="scalatest_${old.scala.version}*" to="scalatest*"/>
</move>
<property name="deploy.main"
value="target/redeploy/scalatest.jar"/>
<property name="deploy.tests"
value="target/redeploy/scalatest-tests.jar"/>
<property name="deploy.sources"
value="target/redeploy/scalatest-sources.jar"/>
<property name="deploy.test-sources"
value="target/redeploy/scalatest-test-sources.jar"/>
<property name="deploy.scaladoc"
value="target/redeploy/scalatest-scaladoc.jar"/>
<property name="deploy.javadoc"
value="target/redeploy/scalatest-javadoc.jar"/>
<property name="deploy.release"
value="${scalatest.version}"/>
<antcall target="deploy-jars"/>
</target>
<!--
- For internal use by targets 'deploy' and 'redeploy'. Deploys jars
- specified by following properties:
-
- deploy.main
- deploy.tests
- deploy.sources
- deploy.test-sources
- deploy.scaladoc
- deploy.javadoc
-
-->
<target name="deploy-jars">
<artifact:pom id="pom" file="${build}/pom.xml" />
<property name="snapshot.repository"
value="${pom.distributionManagement.snapshotRepository.url}" />
<property name="release.repository"
value="${pom.distributionManagement.repository.url}" />
<property name="snapshot.repository.id"
value="${pom.distributionManagement.snapshotRepository.id}" />
<property name="release.repository.id"
value="${pom.distributionManagement.repository.id}" />
<property name="mvn.deploy.plugin"
value="org.apache.maven.plugins:maven-gpg-plugin:1.1:sign-and-deploy-file" />
<condition property="maven.repository.url" value="${snapshot.repository}"
else="${release.repository}">
<contains string="${deploy.release}" substring="-SNAPSHOT"/>
</condition>
<condition property="repository.id" value="${snapshot.repository.id}"
else="${release.repository.id}">
<contains string="${deploy.release}" substring="-SNAPSHOT"/>
</condition>
<artifact:mvn>
<arg value="${mvn.deploy.plugin}" />
<arg value="-Dfile=${deploy.main}" />
<arg value="-Durl=${maven.repository.url}" />
<arg value="-DpomFile=${build}/pom.xml" />
<arg value="-DrepositoryId=${repository.id}" />
<arg value="-DuniqueVersion=false" />
<arg value="-Pgpg" />
</artifact:mvn>
<artifact:mvn>
<arg value="${mvn.deploy.plugin}" />
<arg value="-Dfile=${deploy.tests}" />
<arg value="-Dclassifier=tests" />
<arg value="-Durl=${maven.repository.url}" />
<arg value="-DpomFile=${build}/pom.xml" />
<arg value="-DrepositoryId=${repository.id}" />
<arg value="-DuniqueVersion=false" />
<arg value="-Pgpg" />
</artifact:mvn>
<artifact:mvn>
<arg value="${mvn.deploy.plugin}" />
<arg value="-Dfile=${deploy.sources}" />
<arg value="-Dclassifier=sources" />
<arg value="-Durl=${maven.repository.url}" />
<arg value="-DpomFile=${build}/pom.xml" />
<arg value="-DrepositoryId=${repository.id}" />
<arg value="-DuniqueVersion=false" />
<arg value="-Pgpg" />
</artifact:mvn>
<artifact:mvn>
<arg value="${mvn.deploy.plugin}" />
<arg value="-Dfile=${deploy.test-sources}" />
<arg value="-Dclassifier=test-sources" />
<arg value="-Durl=${maven.repository.url}" />
<arg value="-DpomFile=${build}/pom.xml" />
<arg value="-DrepositoryId=${repository.id}" />
<arg value="-DuniqueVersion=false" />
<arg value="-Pgpg" />
</artifact:mvn>
<artifact:mvn>
<arg value="${mvn.deploy.plugin}" />
<arg value="-Dfile=${deploy.scaladoc}" />
<arg value="-Dclassifier=scaladoc" />
<arg value="-Durl=${maven.repository.url}" />
<arg value="-DpomFile=${build}/pom.xml" />
<arg value="-DrepositoryId=${repository.id}" />
<arg value="-DuniqueVersion=false" />
<arg value="-Pgpg" />
</artifact:mvn>
<artifact:mvn>
<arg value="${mvn.deploy.plugin}" />
<arg value="-Dfile=${deploy.javadoc}" />
<arg value="-Dclassifier=javadoc" />
<arg value="-Durl=${maven.repository.url}" />
<arg value="-DpomFile=${build}/pom.xml" />
<arg value="-DrepositoryId=${repository.id}" />
<arg value="-DuniqueVersion=false" />
<arg value="-Pgpg" />
</artifact:mvn>
</target>
<target name="test-junit">
<junit>
<batchtest fork="yes" todir="target/argh">
<fileset dir="${build.examples}">
<include name="org/scalatestexamples/junit/*Suite.class"/>
</fileset>
<formatter type="xml"/>
<formatter type="plain"/>
</batchtest>
<!--
<test name="org.scalatestexamples.junit.JUnitTestCaseSuite">
<formatter type="xml"/>
</test>
-->
<classpath refid="test.class.path" />
</junit>
</target>
<!--
- Allows build to succeed when using a JVM other than 1.5.
-->
<target name="java6">
<property name="java6" value="true" />
</target>
<!--
- Sets property jvm.ok if JVM version 1.5 is being used.
-->
<target name="get-jvm">
<condition property="jvm.ok">
<or>
<equals arg1="${java6}" arg2="true"/>
<equals arg1="${ant.java.version}" arg2="1.5"/>
</or>
</condition>
</target>
</project>