aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/backend/jvm/GenBCode.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-02-13 22:29:32 +0100
committerMartin Odersky <odersky@gmail.com>2016-02-17 18:38:51 +0100
commitd1877e1ff89b318d16ad0637bcd923e540080140 (patch)
tree32b790a675a70faf668b8dc4f22b70d7a6d8db62 /src/dotty/tools/backend/jvm/GenBCode.scala
parent5e8023335e641c9c05c6517a82764571e7ef6386 (diff)
downloaddotty-d1877e1ff89b318d16ad0637bcd923e540080140.tar.gz
dotty-d1877e1ff89b318d16ad0637bcd923e540080140.tar.bz2
dotty-d1877e1ff89b318d16ad0637bcd923e540080140.zip
Make output directory overridable
The interpreter needs to install a virtual directory as output directory. This is not supported with the -d option in ScalaSettings. The solution is to make the output directory overridable in the GenBCode phase.
Diffstat (limited to 'src/dotty/tools/backend/jvm/GenBCode.scala')
-rw-r--r--src/dotty/tools/backend/jvm/GenBCode.scala5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/dotty/tools/backend/jvm/GenBCode.scala b/src/dotty/tools/backend/jvm/GenBCode.scala
index e8d196ce7..2d444d3be 100644
--- a/src/dotty/tools/backend/jvm/GenBCode.scala
+++ b/src/dotty/tools/backend/jvm/GenBCode.scala
@@ -29,6 +29,7 @@ import scala.tools.asm.tree._
import dotty.tools.dotc.util.{Positions, DotClass}
import tpd._
import StdNames._
+import scala.reflect.io.{Directory, PlainDirectory, AbstractFile}
import scala.tools.nsc.backend.jvm.opt.LocalOpt
@@ -37,9 +38,11 @@ class GenBCode extends Phase {
private val entryPoints = new mutable.HashSet[Symbol]()
def registerEntryPoint(sym: Symbol) = entryPoints += sym
+ def outputDir(implicit ctx: Context): AbstractFile =
+ new PlainDirectory(new Directory(new JFile(ctx.settings.d.value)))
def run(implicit ctx: Context): Unit = {
- new GenBCodePipeline(entryPoints.toList, new DottyBackendInterface()(ctx))(ctx).run(ctx.compilationUnit.tpdTree)
+ new GenBCodePipeline(entryPoints.toList, new DottyBackendInterface(outputDir)(ctx))(ctx).run(ctx.compilationUnit.tpdTree)
entryPoints.clear()
}
}