@@ -24,6 +24,7 @@ SCALA_COMPILER_VERSION=$(getLastStringOnLineWith "scala-compiler")
24
24
DOTTY_VERSION=$( getLastStringOnLineWith " version in" )
25
25
JLINE_VERSION=$( getLastStringOnLineWith " jline" )
26
26
bootcp=true
27
+ bootstrapped=false
27
28
default_java_opts=" -Xmx768m -Xms768m"
28
29
programName=$( basename " $0 " )
29
30
# uncomment next line to enable debug output
@@ -44,12 +45,14 @@ ReplMain=test.DottyRepl
44
45
# autodetecting the compiler jar. this is location where sbt 'packages' it
45
46
MAIN_JAR=$DOTTY_ROOT /target/scala-$SCALA_BINARY_VERSION /dotty_$SCALA_BINARY_VERSION -$DOTTY_VERSION .jar
46
47
TEST_JAR=$DOTTY_ROOT /target/scala-$SCALA_BINARY_VERSION /dotty_$SCALA_BINARY_VERSION -$DOTTY_VERSION -tests.jar
48
+ DOTTY_JAR=$DOTTY_ROOT /dotty.jar
49
+
47
50
function checkjar {
48
51
if [ ! -f " $1 " ]
49
52
then
50
53
echo " The script is going to build the required jar file $1 by running \" sbt $2 \" "
51
54
cd $DOTTY_ROOT
52
- sbt $2
55
+ sbt " $2 "
53
56
cd -
54
57
if [ ! -f " $1 " ]
55
58
then
@@ -64,7 +67,7 @@ function checkjar {
64
67
then
65
68
echo " new files detected. rebuilding"
66
69
cd $DOTTY_ROOT
67
- sbt $2
70
+ sbt " $2 "
68
71
touch " $1 "
69
72
cd -
70
73
fi
@@ -189,7 +192,13 @@ trap onExit INT
189
192
# If using the boot classpath, also pass an empty classpath
190
193
# to java to suppress "." from materializing.
191
194
classpathArgs () {
192
- toolchain=" $SCALA_LIBRARY_JAR :$SCALA_REFLECT_JAR :$SCALA_COMPILER_JAR :$JLINE_JAR "
195
+ if [[ -n $bootstrapped ]]; then
196
+ checkjar $DOTTY_JAR " test:runMain dotc.build" src
197
+ toolchain=" $DOTTY_JAR :$SCALA_LIBRARY_JAR :$SCALA_REFLECT_JAR :$SCALA_COMPILER_JAR :$JLINE_JAR "
198
+ else
199
+ toolchain=" $SCALA_LIBRARY_JAR :$SCALA_REFLECT_JAR :$SCALA_COMPILER_JAR :$JLINE_JAR "
200
+ fi
201
+
193
202
if [[ -n " $cygwin " ]]; then
194
203
if [[ " $OS " = " Windows_NT" ]] && cygpath -m .> /dev/null 2> /dev/null ; then
195
204
format=mixed
@@ -233,6 +242,7 @@ while [[ $# -gt 0 ]]; do
233
242
case " $1 " in
234
243
--) shift ; for arg; do addResidual " $arg " ; done ; set -- ;;
235
244
-h|-help) usage; exit 1 ;;
245
+ -bootstrapped) bootstrapped=true && shift ;;
236
246
-v|-verbose) verbose=true && shift ;;
237
247
-d|-debug) debug=true && shift ;;
238
248
-q|-quiet) quiet=true && shift ;;
0 commit comments