File tree Expand file tree Collapse file tree 5 files changed +23
-11
lines changed
src/dotty/tools/dotc/quoted Expand file tree Collapse file tree 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 {
5050
5151 override def initCtx : Context = {
5252 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)
6158 ictx
6259 }
6360
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ public class ChildJVMMain {
1212 static final String MessageEnd = "##THIS IS THE END FOR ME, GOODBYE##" ;
1313
1414 private static void runMain (String dir ) throws Exception {
15+ System .setProperty ("dotty.tools.dotc.classpath" , dir );
1516 ArrayList <URL > cp = new ArrayList <>();
1617 for (String path : dir .split (":" ))
1718 cp .add (new File (path ).toURI ().toURL ());
Original file line number Diff line number Diff line change 3030source " $PROG_HOME /bin/common"
3131
3232declare -a residual_args
33+ declare -a system_properties
3334run_repl=false
3435with_compiler=false
3536CLASS_PATH=" "
7677 fi
7778 if [ $with_compiler == true ]; then
7879 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 " )
7981 fi
80- eval exec " \" $JAVACMD \" " " $DEBUG " " -classpath \" $cp_arg \" " " ${residual_args[@]} "
82+ eval exec " \" $JAVACMD \" " " $DEBUG " " -classpath \" $cp_arg \" " " ${system_properties[@]} " " ${ residual_args[@]}"
8183fi
Original file line number Diff line number Diff line change @@ -578,9 +578,9 @@ object Build {
578578 .toList.mkString(" :" )
579579
580580 val scalaLib = findLib(" scala-library" )
581+ val dottyLib = packageAll.value(" dotty-library" )
581582
582583 def run (args : List [String ]): Unit = {
583- val dottyLib = packageAll.value(" dotty-library" )
584584 val fullArgs = insertClasspathInArgs(args, s " .: $dottyLib: $scalaLib" )
585585 s " $java ${fullArgs.mkString(" " )}" .!
586586 }
@@ -596,7 +596,9 @@ object Build {
596596 val asm = findLib(" scala-asm" )
597597 val dottyCompiler = packageAll.value(" dotty-compiler" )
598598 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)
600602 } else run(args)
601603 },
602604 run := dotc.evaluated,
Original file line number Diff line number Diff line change 5656 echo " failed output check"
5757 exit -1
5858fi
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