summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-08-06 13:08:36 +0000
committerPaul Phillips <paulp@improving.org>2011-08-06 13:08:36 +0000
commit6d45fddd4c6537fb343e901d58491b81475e3786 (patch)
treebf6fd74702f2c47c4a31f9917d43d955506be9b3 /src/compiler/scala/tools/nsc/settings/ScalaSettings.scala
parent8709b52eef9a0c0b2600664e38e01af3423e93f6 (diff)
downloadscala-6d45fddd4c6537fb343e901d58491b81475e3786.tar.gz
scala-6d45fddd4c6537fb343e901d58491b81475e3786.tar.bz2
scala-6d45fddd4c6537fb343e901d58491b81475e3786.zip
Attacked classpaths to get "." off of it when i...
Attacked classpaths to get "." off of it when it's not actually specified. The commit makes me nervous, but there's no invisible way to fix something like this. ** Attention, this commit changes classpath handling ** We desperately need some way of testing that the classpath has certain qualities and does not have others; partest is not that way. Closes SI-4857, no review.
Diffstat (limited to 'src/compiler/scala/tools/nsc/settings/ScalaSettings.scala')
-rw-r--r--src/compiler/scala/tools/nsc/settings/ScalaSettings.scala14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala b/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala
index 2e7cb9595a..e0366f1e3d 100644
--- a/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala
+++ b/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala
@@ -17,11 +17,19 @@ trait ScalaSettings extends AbsScalaSettings
with Warnings {
self: MutableSettings =>
- import Defaults.scalaUserClassPath
-
/** Set of settings */
protected lazy val allSettings = mutable.HashSet[Setting]()
+ /** Against my better judgment, giving in to martin here and allowing
+ * CLASSPATH to be used automatically. So for the user-specified part
+ * of the classpath:
+ *
+ * - If -classpath or -cp is given, it is that
+ * - Otherwise, if CLASSPATH is set, it is that
+ * - If neither of those, then "." is used.
+ */
+ protected def defaultClasspath = Option(sys.props("CLASSPATH")) getOrElse "."
+
/** Disable a setting */
def disable(s: Setting) = allSettings -= s
@@ -35,7 +43,7 @@ trait ScalaSettings extends AbsScalaSettings
*/
// argfiles is only for the help message
val argfiles = BooleanSetting ("@<file>", "A text file containing compiler arguments (options and source files)")
- val classpath = PathSetting ("-classpath", "Specify where to find user class files.", scalaUserClassPath) .
+ val classpath = PathSetting ("-classpath", "Specify where to find user class files.", defaultClasspath) .
withAbbreviation ("-cp")
val d = OutputSetting (outputDirs, ".")
val optimise = BooleanSetting ("-optimise", "Generates faster bytecode by applying optimisations to the program") .