File tree 5 files changed +23
-11
lines changed
src/dotty/tools/dotc/quoted
5 files changed +23
-11
lines changed Original file line number Diff line number Diff line change @@ -50,14 +50,11 @@ class QuoteDriver extends Driver {
50
50
51
51
override def initCtx : Context = {
52
52
val ictx = super .initCtx.fresh
53
- // TODO add compiler to java.class.path
54
- val classpath = List (
55
- System .getProperty(" java.class.path" ),
56
- " ../compiler/target/scala-2.12/dotty-compiler_2.12-0.6.0-bin-SNAPSHOT-nonbootstrapped.jar" ,
57
- " ../library/target/scala-2.12/dotty-library_2.12-0.6.0-bin-SNAPSHOT-nonbootstrapped.jar" ,
58
- " ../interfaces/target/dotty-interfaces-0.6.0-bin-SNAPSHOT.jar"
59
- ).mkString(" :" )
60
- ictx.settings.classpath.update(classpath)(ictx)
53
+ val compilerClasspath = System .getProperty(" dotty.tools.dotc.classpath" )
54
+ assert(compilerClasspath ne null , " System property `dotty.tools.dotc.classpath` is not set." )
55
+ val classpath = System .getProperty(" java.class.path" )
56
+ val scalaLib = classpath.split(" :" ).filter(_.contains(" scala-library" )).mkString(" :" )
57
+ ictx.settings.classpath.update(compilerClasspath + " :" + scalaLib)(ictx)
61
58
ictx
62
59
}
63
60
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ public class ChildJVMMain {
12
12
static final String MessageEnd = "##THIS IS THE END FOR ME, GOODBYE##" ;
13
13
14
14
private static void runMain (String dir ) throws Exception {
15
+ System .setProperty ("dotty.tools.dotc.classpath" , dir );
15
16
ArrayList <URL > cp = new ArrayList <>();
16
17
for (String path : dir .split (":" ))
17
18
cp .add (new File (path ).toURI ().toURL ());
Original file line number Diff line number Diff line change 30
30
source " $PROG_HOME /bin/common"
31
31
32
32
declare -a residual_args
33
+ declare -a system_properties
33
34
run_repl=false
34
35
with_compiler=false
35
36
CLASS_PATH=" "
76
77
fi
77
78
if [ $with_compiler == true ]; then
78
79
cp_arg+=" $PSEP$DOTTY_COMP$PSEP$DOTTY_INTF$PSEP$SCALA_ASM "
80
+ system_properties+=(" -Ddotty.tools.dotc.classpath=$DOTTY_COMP$PSEP$DOTTY_LIB$PSEP$DOTTY_INTF$PSEP$SCALA_ASM " )
79
81
fi
80
- eval exec " \" $JAVACMD \" " " $DEBUG " " -classpath \" $cp_arg \" " " ${residual_args[@]} "
82
+ eval exec " \" $JAVACMD \" " " $DEBUG " " -classpath \" $cp_arg \" " " ${system_properties[@]} " " ${ residual_args[@]}"
81
83
fi
Original file line number Diff line number Diff line change @@ -578,9 +578,9 @@ object Build {
578
578
.toList.mkString(" :" )
579
579
580
580
val scalaLib = findLib(" scala-library" )
581
+ val dottyLib = packageAll.value(" dotty-library" )
581
582
582
583
def run (args : List [String ]): Unit = {
583
- val dottyLib = packageAll.value(" dotty-library" )
584
584
val fullArgs = insertClasspathInArgs(args, s " .: $dottyLib: $scalaLib" )
585
585
s " $java ${fullArgs.mkString(" " )}" .!
586
586
}
@@ -596,7 +596,9 @@ object Build {
596
596
val asm = findLib(" scala-asm" )
597
597
val dottyCompiler = packageAll.value(" dotty-compiler" )
598
598
val dottyInterfaces = packageAll.value(" dotty-interfaces" )
599
- run(insertClasspathInArgs(args1, s " $dottyCompiler: $dottyInterfaces: $asm" ))
599
+ val deps = s " $dottyCompiler: $dottyInterfaces: $asm"
600
+ val args2 = s " -Ddotty.tools.dotc.classpath= $deps: $dottyLib" :: insertClasspathInArgs(args1, deps)
601
+ run(args2)
600
602
} else run(args)
601
603
},
602
604
run := dotc.evaluated,
Original file line number Diff line number Diff line change 56
56
echo " failed output check"
57
57
exit -1
58
58
fi
59
+
60
+ echo " testing scala.quoted.Expr.run from sbt dotr"
61
+ ./project/scripts/sbt " ;dotc -classpath compiler/target/scala-2.12/classes tests/run-special/quote-run.scala; dotr -with-compiler Test" > sbtdot5.out
62
+ cat sbtdot5.out
63
+ if grep -e " val a: Int = 3" sbtdot5.out; then
64
+ echo " output ok"
65
+ else
66
+ echo " failed output check"
67
+ exit -1
68
+ fi
You can’t perform that action at this time.
0 commit comments