summaryrefslogtreecommitdiff
path: root/test-nsc.xml
blob: 5ef3ddf05e4313de851445dc319e7da3b20da6b4 (plain) (blame)
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
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE project [
  <!ENTITY userExcludes "">
]>
<project name="scala.nsc" default="test">

  <!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

                                    nsc 

                               new scala compiler

       %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

       %%%
       %%%  Preliminaries
       %%%

	   1) working nsc compiler (see build-nsc.xml)

   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->

  <property file="build-nsc.properties.${platform}" prefix="nsc." />

  <property file="developer/${user.name}/custom.properties" />

  <target name="init.args" if="nscArgs">
     <property name="moreNscArgs" value="${nscArgs}" />
  </target>

  <target name="init.noargs">
    <property name="moreNscArgs" value="" />
  </target>

   <target name="init" depends="init.args, init.noargs">
     <echo> Hi, I am your helpful test script. Passing options to nsc?</echo>
     <echo> Either, add a line to developer/${user.name}/custom.properties</echo>
     <echo>   nscArgs = -check:term;-debug </echo>
     <echo> or set a property nscArgs on the cmd line</echo>
     <echo>   sh ant-test-nsc.sh -DnscArgs="-check:term;-debug" </echo>
     <echo/>
     <echo> Note the hyphens, the quotes on the cmd line, no spaces between options, the ';' separator</echo>
   </target>

  <target name="check.env">
    <fail>
      <condition><not><available file="${nsc.fjbg_jar}" /></not></condition>
      Missing library file ${nsc.fjbg_jar}.
      Check your property file build-nsc.properties.${platform}.
    </fail>
    <fail>
      <condition><not><available file="${nsc.scala_jar}" /></not></condition>
      Missing library file ${nsc.scala_jar}.
      Check your property file build-nsc.properties.${platform}.
    </fail>
    <fail>
      <condition><not><available file="${nsc.tools_jar}" /></not></condition>
      Missing library file ${nsc.tools_jar}.
      Check your property file build-nsc.properties.${platform}.
    </fail>
    <fail>
      <condition><not><available file="${nsc.nsc_jar}" /></not></condition>
      Missing library file ${nsc.nsc_jar}.
      Check your property file build-nsc.properties.${platform}.
    </fail>
    <fail>
      <condition><not><available file="${nsc.nsc4ant_jar}" /></not></condition>
      Missing library file ${nsc.nsc4ant_jar}.
      Check your property file build-nsc.properties.${platform}.
    </fail>
  </target>

  <target name="test" depends="init,check.env">
    <mkdir dir="${nsc.nsc_output_dir}" />

    <taskdef name="nsc" classname="scala.tools.scala4ant.NscTask$class" />

    <echo>==== running nsc on predef and runtime</echo>
    <nsc srcdir="sources" destdir="${nsc.nsc_output_dir}" 
         classpath="sources:newsources:${nsc.nsrt_jar}"
		 nscArgs="-nopredefs;${moreNscArgs}">

      <include name="scala/Predef.scala"/>
      <include name="scala/runtime/ScalaRunTime.scala"/>
    </nsc>

    <echo>===== running nsc on the rest</echo>
    <nsc srcdir="sources" destdir="${nsc.nsc_output_dir}" 
         classpath="sources:newsources:${nsc.nsrt_jar}:${nsc.nsc_output_dir}"
         nscArgs="${moreNscArgs}" force="true"> 

      <include name="scala/**/*.scala"/>
      <include name="../newsources/**.scala"/>

      <exclude name="scala/Predef.scala"/>
      <exclude name="scala/runtime/ScalaRunTime.scala"/>

      <exclude name="scala/tools/**"/>
	  &userExcludes;
    </nsc>

    <jar destfile="${nsc.nsrt_jar}">
      <fileset dir="${nsc.tools_util_runtime_dir}" />
      <fileset dir="${nsc.nsc_output_dir}" />
    </jar>

  </target>

  <target name="nscOnNsc" depends="init,check.env">
    <taskdef name="nsc" classname="scala.tools.scala4ant.NscTask$class" />

    <echo>===== running nsc on itself</echo>
    <nsc srcdir="sources" destdir="${nsc.nsc_output_dir}" 
         classpath="sources:newsources:${nsc.nsrt_jar}:${nsc.fjbg_jar}:${nsc.nsc_output_dir}"
         nscArgs="${moreNscArgs}" force="true"> 

      <include name="scala/tools/nsc/**/*.scala"/>
	  &userExcludes;
    </nsc>
  </target>

  <target name="clean">
    <delete dir="${nsc.nsc_output_dir}" />
  </target>

</project>