summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/CompileClient.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-03-27 23:27:05 +0000
committerPaul Phillips <paulp@improving.org>2011-03-27 23:27:05 +0000
commit4d25cc33ee101708c812889a343535f610becc71 (patch)
tree61b5b34e54e4e1644cff9fc6830a270af9ff1784 /src/compiler/scala/tools/nsc/CompileClient.scala
parentc17e46682a9b42eaf4d33d9f60b50c826ab4009e (diff)
downloadscala-4d25cc33ee101708c812889a343535f610becc71.tar.gz
scala-4d25cc33ee101708c812889a343535f610becc71.tar.bz2
scala-4d25cc33ee101708c812889a343535f610becc71.zip
Trying to get fsc doing the right thing with re...
Trying to get fsc doing the right thing with respect to absolute and relative paths. My knowledge of the problem had heretofore been second hand, and my understanding of it incomplete. The real problem I have determined is that there are a bunch of different things which go wrong if relative paths start being resolved from a different base, each of which needs custom handling. classpath-style options, e.g. fsc -cp ../foo.jar path-style options, e.g. fsc -d ../mydir file arguments, e.g. fsc ../foo.scala So it was more work than I had realized, or I probably wouldn't have even touched it. But now it seems to be working as one would want. I also poured some readability onto the fsc help output. Closes #4395, no review, but community input would be great.
Diffstat (limited to 'src/compiler/scala/tools/nsc/CompileClient.scala')
-rw-r--r--src/compiler/scala/tools/nsc/CompileClient.scala26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/compiler/scala/tools/nsc/CompileClient.scala b/src/compiler/scala/tools/nsc/CompileClient.scala
index 9987eb0204..fd4f777890 100644
--- a/src/compiler/scala/tools/nsc/CompileClient.scala
+++ b/src/compiler/scala/tools/nsc/CompileClient.scala
@@ -16,18 +16,21 @@ import sys.SystemProperties.preferIPv4Stack
class StandardCompileClient extends HasCompileSocket with CompileOutputCommon {
lazy val compileSocket: CompileSocket = CompileSocket
- val versionMsg = "Fast " + Properties.versionMsg
- var verbose = false
+ val versionMsg = "Fast " + Properties.versionMsg
+ var verbose = false
def process(args: Array[String]): Int = {
- val fscArgs = args.toList
- val settings = new FscSettings
- val command = new CompilerCommand(fscArgs, settings)
- verbose = settings.verbose.value
- val shutdown = settings.shutdown.value
- val vmArgs = settings.jvmargs.unparse ++ settings.defines.unparse ++ (
- if (settings.preferIPv4.value) List("-D%s=true".format(preferIPv4Stack.key)) else Nil
- )
+ // Trying to get out in front of the log messages in case we're
+ // going from verbose to not verbose.
+ verbose = (args contains "-verbose")
+
+ val settings = new FscSettings(Console.println)
+ val command = new OfflineCompilerCommand(args.toList, settings)
+ val shutdown = settings.shutdown.value
+ val extraVmArgs = if (settings.preferIPv4.value) List("-D%s=true".format(preferIPv4Stack.key)) else Nil
+
+ val vmArgs = settings.jvmargs.unparse ++ settings.defines.unparse ++ extraVmArgs
+ val fscArgs = args.toList ++ command.extraFscArgs
if (settings.version.value) {
Console println versionMsg
@@ -35,7 +38,8 @@ class StandardCompileClient extends HasCompileSocket with CompileOutputCommon {
}
info(versionMsg)
- info(fscArgs.mkString("[Given arguments: ", " ", "]"))
+ info(args.mkString("[Given arguments: ", " ", "]"))
+ info(fscArgs.mkString("[Transformed arguments: ", " ", "]"))
info(vmArgs.mkString("[VM arguments: ", " ", "]"))
val socket =