summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/GenericRunnerSettings.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2009-03-12 18:15:25 +0000
committerPaul Phillips <paulp@improving.org>2009-03-12 18:15:25 +0000
commit8bafc41b19deca3b95877633dd07ffa38c42feec (patch)
tree6783e1f00230b672c11f64318ab03b85da954a8a /src/compiler/scala/tools/nsc/GenericRunnerSettings.scala
parent8e28858bd1f1c4e8a4df03b87f51c362bc8e449e (diff)
downloadscala-8bafc41b19deca3b95877633dd07ffa38c42feec.tar.gz
scala-8bafc41b19deca3b95877633dd07ffa38c42feec.tar.bz2
scala-8bafc41b19deca3b95877633dd07ffa38c42feec.zip
A big cleanup of Settings code.
manage existing settings and add new ones. It's paving the way for low-fuss scalac preferences so we can exert fine grained config file based control over compiler behavior.
Diffstat (limited to 'src/compiler/scala/tools/nsc/GenericRunnerSettings.scala')
-rw-r--r--src/compiler/scala/tools/nsc/GenericRunnerSettings.scala50
1 files changed, 1 insertions, 49 deletions
diff --git a/src/compiler/scala/tools/nsc/GenericRunnerSettings.scala b/src/compiler/scala/tools/nsc/GenericRunnerSettings.scala
index fc69df6203..0e23681ed6 100644
--- a/src/compiler/scala/tools/nsc/GenericRunnerSettings.scala
+++ b/src/compiler/scala/tools/nsc/GenericRunnerSettings.scala
@@ -7,9 +7,6 @@
package scala.tools.nsc
-import java.lang.System.getProperties
-import scala.collection.mutable.Queue
-
class GenericRunnerSettings(error: String => Unit)
extends Settings(error) {
val howtorun =
@@ -42,50 +39,5 @@ extends Settings(error) {
"-nocompdaemon",
"do not use the fsc compilation daemon")
-
- /** For some reason, "object defines extends Setting(...)"
- * does not work here. The object is present but the setting
- * is not added to allsettings. Thus,
- */
- class DefinesSetting extends Setting("set a Java property") {
-
- def name = "-D<prop>"
-
- private val props = new Queue[(String, String)]
-
- def value = props.toList
-
- def tryToSet(args: List[String]): List[String] = {
- args match {
- case arg0::rest
- if arg0.startsWith("-D") =>
- val stripD = arg0.substring(2)
- val eqidx = stripD.indexOf('=')
- val addition =
- if (eqidx < 0)
- (stripD, "")
- else
- (stripD.substring(0, eqidx), stripD.substring(eqidx+1))
- props += addition
- rest
-
- case _ => args
- }
- }
-
- /** Apply the specified properties to the current JVM */
- def applyToCurrentJVM = {
- val systemProps = getProperties
- for ((key, value) <- props.toList)
- systemProps.setProperty(key, value)
- }
-
- def unparse: List[String] =
- (props.toList.foldLeft[List[String]]
- (Nil)
- ((args, prop) =>
- ("-D" + prop._1 + "=" + prop._2) :: args))
- }
-
- val defines = new DefinesSetting
+ val defines = DefinesSetting
}