4
4
5
5
6
6
# Configuration
7
- SCALA_VERSION=2.11.4
7
+ SCALA_VERSION=2.11.5
8
8
SCALA_BINARY_VERSION=2.11
9
9
SCALA_COMPILER_VERSION=2.11.5-20141212-151631-beaa78b033
10
10
DOTTY_VERSION=0.1
11
+ JLINE_VERSION=2.12
11
12
bootcp=true
12
13
default_java_opts=" -Xmx768m -Xms768m"
13
14
programName=$( basename " $0 " )
@@ -21,6 +22,7 @@ unset verbose quiet cygwin toolcp colors saved_stty CDPATH
21
22
22
23
23
24
CompilerMain=dotty.tools.dotc.Main
25
+ ReplMain=test.DottyRepl
24
26
25
27
26
28
# Try to autodetect real location of the script
@@ -32,7 +34,7 @@ DOTTY_ROOT="`dirname \"$DOTTY_ROOT\"`"
32
34
DOTTY_ROOT=" ` ( cd \" $DOTTY_ROOT \" && pwd )` /.." # absolute
33
35
# autodetecting the compiler jar. this is location where sbt 'packages' it
34
36
MAIN_JAR=$DOTTY_ROOT /target/scala-$SCALA_BINARY_VERSION /dotty_$SCALA_BINARY_VERSION -$DOTTY_VERSION -SNAPSHOT.jar
35
-
37
+ TEST_JAR= $DOTTY_ROOT /target/scala- $SCALA_BINARY_VERSION /dotty_ $SCALA_BINARY_VERSION - $DOTTY_VERSION -SNAPSHOT-tests.jar
36
38
function checkjar {
37
39
if [ ! -f " $1 " ]
38
40
then
@@ -51,6 +53,7 @@ function checkjar {
51
53
}
52
54
53
55
checkjar $MAIN_JAR package
56
+ checkjar $TEST_JAR test:package
54
57
55
58
# Autodetecting the scala-library location, in case it wasn't provided by an environment variable
56
59
if [ " $SCALA_LIBRARY_JAR " == " " ]
68
71
SCALA_COMPILER_JAR=$HOME /.ivy2/cache/me.d-d/scala-compiler/jars/scala-compiler-$SCALA_COMPILER_VERSION .jar
69
72
fi
70
73
71
- if [ ! -f " $SCALA_LIBRARY_JAR " -o ! -f " $SCALA_REFLECT_JAR " -o ! -f " $SCALA_COMPILER_JAR " ]
74
+ if [ " $JLINE_JAR " == " " ]
75
+ then
76
+ JLINE_JAR=$HOME /.ivy2//cache/jline/jline/jars/jline-$JLINE_VERSION .jar
77
+ fi
78
+
79
+ if [ ! -f " $SCALA_LIBRARY_JAR " -o ! -f " $SCALA_REFLECT_JAR " -o ! -f " $SCALA_COMPILER_JAR " -o ! -f " $JLINE_JAR " ]
72
80
then
73
81
echo To use this script please set
74
82
echo SCALA_LIBRARY_JAR to point to scala-library-$SCALA_VERSION .jar " (currently $SCALA_LIBRARY_JAR )"
75
83
echo SCALA_REFLECT_JAR to point to scala-reflect-$SCALA_VERSION .jar " (currently $SCALA_REFLECT_JAR )"
76
84
echo SCALA_COMPILER_JAR to point to scala-compiler-$SCALA_VERSION .jar with bcode patches " (currently $SCALA_COMPILER_JAR )"
77
-
85
+ echo JLINE_JAR to point to jline- $JLINE_VERSION .jar " (currently $JLINE_JAR ) "
78
86
fi
79
87
80
88
ifdebug () {
@@ -163,9 +171,9 @@ trap onExit INT
163
171
# to java to suppress "." from materializing.
164
172
classpathArgs () {
165
173
if [[ -n $bootcp ]]; then
166
- echo " -Xbootclasspath/a:$SCALA_LIBRARY_JAR :$SCALA_REFLECT_JAR :$SCALA_COMPILER_JAR :$MAIN_JAR -classpath $MAIN_JAR "
174
+ echo " -Xbootclasspath/a:$SCALA_LIBRARY_JAR :$SCALA_REFLECT_JAR :$SCALA_COMPILER_JAR :$JLINE_JAR : $ MAIN_JAR -classpath $MAIN_JAR : $TEST_JAR "
167
175
else
168
- echo " -classpath $SCALA_LIBRARY_JAR :$SCALA_REFLECT_JAR :$MAIN_JAR "
176
+ echo " -classpath $SCALA_LIBRARY_JAR :$SCALA_REFLECT_JAR :$SCALA_COMPILER_JAR : $JLINE_JAR : $ MAIN_JAR: $TEST_JAR "
169
177
fi
170
178
}
171
179
@@ -181,8 +189,7 @@ require_arg () {
181
189
}
182
190
183
191
184
-
185
-
192
+ main_class=$CompilerMain
186
193
187
194
while [[ $# -gt 0 ]]; do
188
195
case " $1 " in
@@ -230,7 +237,7 @@ execCommand \
230
237
" ${java_args[@]} " \
231
238
" $( classpathArgs) " \
232
239
-Dscala.usejavacp=true \
233
- " ${CompilerMain } " \
240
+ " ${main_class } " \
234
241
" ${scala_args[@]} " \
235
242
" ${residual_args[@]} "
236
243
0 commit comments