Skip to content

Commit 16184eb

Browse files
committed
Fix classpath when running dotc -with-compiler from sbt
1 parent e94662a commit 16184eb

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

project/Build.scala

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -636,16 +636,21 @@ object Build {
636636
else if (debugFromTasty) "dotty.tools.dotc.fromtasty.Debug"
637637
else "dotty.tools.dotc.Main"
638638

639-
var extraClasspath = s"$scalaLib${File.pathSeparator}$dottyLib"
640-
if ((decompile || printTasty) && !args.contains("-classpath")) extraClasspath += s"${File.pathSeparator}."
639+
var extraClasspath = Seq(scalaLib, dottyLib)
640+
641+
if ((decompile || printTasty) && !args.contains("-classpath"))
642+
extraClasspath ++= Seq(".")
643+
641644
if (args0.contains("-with-compiler")) {
642645
if (scalaVersion.value == referenceVersion) {
643646
log.error("-with-compiler should only be used with a bootstrapped compiler")
644647
}
645-
extraClasspath += s"${File.pathSeparator}$dottyCompiler"
648+
val dottyInterfaces = jars("dotty-interfaces")
649+
val asm = findLib(attList, "scala-asm")
650+
extraClasspath ++= Seq(dottyCompiler, dottyInterfaces, asm)
646651
}
647652

648-
val fullArgs = main :: insertClasspathInArgs(args, extraClasspath)
653+
val fullArgs = main :: insertClasspathInArgs(args, extraClasspath.mkString(File.pathSeparator))
649654

650655
(runMain in Compile).toTask(fullArgs.mkString(" ", " ", ""))
651656
}

0 commit comments

Comments
 (0)