summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-02-16 21:22:10 +0000
committerPaul Phillips <paulp@improving.org>2010-02-16 21:22:10 +0000
commit80b0d241349f6463e814a8c1eca34f827ce24518 (patch)
tree28832eb3bc91c5f79e0b3a58947078eeaa1ba437 /src/compiler
parenta6b2e34c55d1ee77d87bedb7d6ddac3b61f24947 (diff)
downloadscala-80b0d241349f6463e814a8c1eca34f827ce24518.tar.gz
scala-80b0d241349f6463e814a8c1eca34f827ce24518.tar.bz2
scala-80b0d241349f6463e814a8c1eca34f827ce24518.zip
Unix scripts pass -D options to the underlying ...
Unix scripts pass -D options to the underlying JVM invocation. Closes #1222. Review by community.
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/tools/ant/templates/tool-unix.tmpl15
-rw-r--r--src/compiler/scala/tools/nsc/Settings.scala7
2 files changed, 19 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/ant/templates/tool-unix.tmpl b/src/compiler/scala/tools/ant/templates/tool-unix.tmpl
index ac50e3de54..b87463f0b9 100644
--- a/src/compiler/scala/tools/ant/templates/tool-unix.tmpl
+++ b/src/compiler/scala/tools/ant/templates/tool-unix.tmpl
@@ -1,5 +1,5 @@
#!/bin/sh
-
+#
##############################################################################
# Copyright 2002-2010, LAMP/EPFL
#
@@ -63,6 +63,19 @@ fi
# Reminder: substitution ${JAVA_OPTS:=-Xmx256M -Xms16M} DO NOT work on Solaris
[ -n "$JAVA_OPTS" ] || JAVA_OPTS="@javaflags@"
+# break out -D options and add them to JAVA_OPTS as well so they reach the
+# underlying JVM in time to do some good.
+for i
+do
+ case "$i" in
+ -D*)
+ JAVA_OPTS="$JAVA_OPTS $i" ;;
+ *)
+ ;;
+ esac
+done
+
+
if [ -z "$JAVACMD" -a -n "$JAVA_HOME" -a -x "$JAVA_HOME/bin/java" ]; then
JAVACMD="$JAVA_HOME/bin/java"
fi
diff --git a/src/compiler/scala/tools/nsc/Settings.scala b/src/compiler/scala/tools/nsc/Settings.scala
index 48292953c7..3d8e5d7258 100644
--- a/src/compiler/scala/tools/nsc/Settings.scala
+++ b/src/compiler/scala/tools/nsc/Settings.scala
@@ -746,6 +746,9 @@ object Settings {
}
}
+ private[Settings] override def tryToSetProperty(args: List[String]): Option[List[String]] =
+ tryToSet(args)
+
def tryToSet(args: List[String]) =
if (args.isEmpty) None
else parseArg(args.head) match {
@@ -757,8 +760,8 @@ object Settings {
value map { case (k,v) => "-D" + k + (if (v == "") "" else "=" + v) }
override def equals(that: Any) = that match {
- case x: DefinesSetting => this isEq x
- case _ => false
+ case x: DefinesSetting => this isEq x
+ case _ => false
}
/** Apply the specified properties to the current JVM and returns them. */