diff options
author | Paul Phillips <paulp@improving.org> | 2011-08-06 13:08:36 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-08-06 13:08:36 +0000 |
commit | 6d45fddd4c6537fb343e901d58491b81475e3786 (patch) | |
tree | bf6fd74702f2c47c4a31f9917d43d955506be9b3 /src/compiler/scala/tools/nsc/settings/ScalaSettings.scala | |
parent | 8709b52eef9a0c0b2600664e38e01af3423e93f6 (diff) | |
download | scala-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.scala | 14 |
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") . |