From f587ec7c8f616d80f1a115fdb21a5b7f7da8ebf7 Mon Sep 17 00:00:00 2001 From: Lex Spoon Date: Tue, 12 Jun 2007 15:28:59 +0000 Subject: Replaced -Xscript by -script, so that script files can be compiled into a user-specified object wrapper --- src/compiler/scala/tools/nsc/Global.scala | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/compiler/scala/tools/nsc/Global.scala') diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala index afedea0b1a..0c7e18c2e9 100644 --- a/src/compiler/scala/tools/nsc/Global.scala +++ b/src/compiler/scala/tools/nsc/Global.scala @@ -593,11 +593,12 @@ class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable def compile(filenames: List[String]) { try { - if (settings.Xscript.value && filenames.length != 1) + val scriptMain = settings.script.value + if (scriptMain != "" && filenames.length != 1) error("can only compile one script at a time") val sources = filenames map ( - if (settings.Xscript.value) - (x => ScriptRunner.wrappedScript(x, getSourceFile _)) + if (scriptMain != "") + (x => ScriptRunner.wrappedScript(scriptMain, x, getSourceFile _)) else getSourceFile) compileSources(sources) -- cgit v1.2.3