diff options
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/Interpreter.scala | 2 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/Settings.scala | 10 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala | 6 |
3 files changed, 9 insertions, 9 deletions
diff --git a/src/compiler/scala/tools/nsc/Interpreter.scala b/src/compiler/scala/tools/nsc/Interpreter.scala index 2973444be6..b357e0569d 100644 --- a/src/compiler/scala/tools/nsc/Interpreter.scala +++ b/src/compiler/scala/tools/nsc/Interpreter.scala @@ -116,8 +116,8 @@ class Interpreter(val settings: Settings, out: PrintWriter) /** Instantiate a compiler. Subclasses can override this to * change the compiler class used by this interpreter. */ protected def newCompiler(settings: Settings, reporter: Reporter) = { + settings.outputDirs.setSingleOutput(virtualDirectory) val comp = new nsc.Global(settings, reporter) - comp.genJVM.outputDir = virtualDirectory comp } diff --git a/src/compiler/scala/tools/nsc/Settings.scala b/src/compiler/scala/tools/nsc/Settings.scala index f0b3be3ff0..727a7cfb7f 100644 --- a/src/compiler/scala/tools/nsc/Settings.scala +++ b/src/compiler/scala/tools/nsc/Settings.scala @@ -265,9 +265,14 @@ object Settings */ def setSingleOutput(outDir: String) { val dst = AbstractFile.getDirectory(outDir) - checkDir(dst, outDir) + setSingleOutput(checkDir(dst, outDir)) + } - singleOutDir = Some(dst) + /** Set the single output directory. From now on, all files will + * be dumped in there, regardless of previous calls to 'add'. + */ + def setSingleOutput(dir: AbstractFile) { + singleOutDir = Some(dir) } def add(src: AbstractFile, dst: AbstractFile) { @@ -502,6 +507,7 @@ object Settings outputDirs: OutputDirs, default: String) extends StringSetting("-d", "directory", "Specify where to place generated class files", default) { + value = default override def value_=(str: String) { super.value_=(str) outputDirs.setSingleOutput(str) diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala index f12e5abe45..23b51ab97c 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala @@ -32,12 +32,6 @@ abstract class GenJVM extends SubComponent { val phaseName = "jvm" - /** - * Directory where output will be written. By default it - * is the directory specified by Settings.outdir. - */ - var outputDir: AbstractFile = AbstractFile.getDirectory(settings.outdir.value) - /** Create a new phase */ override def newPhase(p: Phase) = new JvmPhase(p) |