From 5f8b831765ead443cf1f80078b7417c76e47e39b Mon Sep 17 00:00:00 2001 From: Christopher Vogt Date: Wed, 28 Sep 2016 08:46:41 -0400 Subject: add dotty repl --- stage2/plugins/Dotty.scala | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/stage2/plugins/Dotty.scala b/stage2/plugins/Dotty.scala index 0a5d91d..53cff6e 100644 --- a/stage2/plugins/Dotty.scala +++ b/stage2/plugins/Dotty.scala @@ -22,6 +22,8 @@ trait Dotty extends BaseBuild{ ) } + def repl = dottyLib.repl(context.args, classpath) + override def dependencies = Resolver(mavenCentral).bind( ScalaDependency( "org.scala-lang.modules", "scala-java8-compat", "0.8.0-RC7" ) ) @@ -42,6 +44,20 @@ class DottyLib( MavenDependency("ch.epfl.lamp","dotty_2.11",dottyVersion) ) + def repl(args: Seq[String], classpath: ClassPath) = { + consoleOrFail("Use `cbt direct repl` instead") + lib.runMain( + "dotty.tools.dotc.repl.Main", + Seq( + "-bootclasspath", + dottyDependency.classpath.string, + "-classpath", + classpath.string + ) ++ args, + dottyDependency.classLoader(classLoaderCache) + ) + } + def compile( needsRecompile: Boolean, files: Seq[File], -- cgit v1.2.3