diff options
author | Paul Phillips <paulp@improving.org> | 2011-03-18 18:23:14 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-03-18 18:23:14 +0000 |
commit | f3b970b28cf640904fe0d340f9eb7de37514cb67 (patch) | |
tree | b5e77b7b78ec8743c8e4e0131cc7af4eb5611f7c /src/compiler/scala/tools/nsc/settings/FscSettings.scala | |
parent | d5d7953ab4c31b4f58f51b530ca82603f9e59b94 (diff) | |
download | scala-f3b970b28cf640904fe0d340f9eb7de37514cb67.tar.gz scala-f3b970b28cf640904fe0d340f9eb7de37514cb67.tar.bz2 scala-f3b970b28cf640904fe0d340f9eb7de37514cb67.zip |
Accumulated work on fsc.
adds the following new options.
-ipv4 Use IPv4 rather than IPv6 for the server socket absolute-cp Make
-classpath elements absolute paths before sending to server max-idle
-Set idle timeout in minutes for fsc (use 0 for no timeout)
My question marks are what are the right defaults for the first two.
Former behavior is to absolutize the classpath always and never prefer
IPv4 sockets. I changed the default to not absolutize the classpath,
with the option if you need it; I left the system default in place for
the socket creation, but I have a feeling we should default to IPv4. My
only hesitation is that the only way to request an IPv4 socket from java
involves mutating a global system property. (Robustness FTW.) So for
now, you have to give -ipv4.
Closes #3626, #3785, #3788, #3789. Review by community.
Diffstat (limited to 'src/compiler/scala/tools/nsc/settings/FscSettings.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/settings/FscSettings.scala | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/compiler/scala/tools/nsc/settings/FscSettings.scala b/src/compiler/scala/tools/nsc/settings/FscSettings.scala index b7f0c553f6..a219148b16 100644 --- a/src/compiler/scala/tools/nsc/settings/FscSettings.scala +++ b/src/compiler/scala/tools/nsc/settings/FscSettings.scala @@ -14,16 +14,22 @@ class FscSettings(error: String => Unit) extends Settings(error) { def this() = this(Console.println) - val reset = BooleanSetting("-reset", "Reset compile server caches") - val shutdown = BooleanSetting("-shutdown", "Shutdown compile server") - val server = StringSetting ("-server", "hostname:portnumber", "Specify compile server socket", "") + val reset = BooleanSetting("-reset", "Reset compile server caches") + val shutdown = BooleanSetting("-shutdown", "Shutdown compile server") + val server = StringSetting ("-server", "hostname:portnumber", "Specify compile server socket", "") + val preferIPv4 = BooleanSetting("-ipv4", "Use IPv4 rather than IPv6 for the server socket") + val absClasspath = BooleanSetting("-absolute-cp", "Make classpath elements absolute paths before sending to server") . + withPostSetHook (_ => absolutizeClasspath()) + val idleMins = IntSetting ("-max-idle", "Set idle timeout in minutes for fsc (use 0 for no timeout)", + 30, Some(0, Int.MaxValue), (_: String) => None) disable(prompt) disable(resident) - // Make all paths absolute since we may be going from client to server - userSetSettings foreach { - case x: PathSetting => x.value = ClassPath.makeAbsolute(x.value) - case _ => () + // Make the classpath absolute: for going from client to server. + private def absolutizeClasspath() { + userSetSettings collect { + case x: PathSetting => x.value = ClassPath.makeAbsolute(x.value) + } } } |