summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/util/PathResolver.scala
diff options
context:
space:
mode:
authorVlad Ureche <vlad.ureche@gmail.com>2012-06-08 01:14:17 +0200
committerEugene Burmako <xeno.by@gmail.com>2012-06-08 15:34:45 +0200
commit94db9d983cdd28c053e568b6185fe2494bd7ffec (patch)
treecfe978c998772eaba085fbe7925b8b0bd10ee8fe /src/compiler/scala/tools/util/PathResolver.scala
parent0c153ee15e714e0ca8752151012b8f1fa9642983 (diff)
downloadscala-94db9d983cdd28c053e568b6185fe2494bd7ffec.tar.gz
scala-94db9d983cdd28c053e568b6185fe2494bd7ffec.tar.bz2
scala-94db9d983cdd28c053e568b6185fe2494bd7ffec.zip
Reverting 22c8dec5 and preventing bootstapping in scaladoc
Review by @dragos, @jsuereth. Required bootstrapping because the starr was ant tasks were invoking locker with -Ysourcepath instead of -sourcepath.
Diffstat (limited to 'src/compiler/scala/tools/util/PathResolver.scala')
-rw-r--r--src/compiler/scala/tools/util/PathResolver.scala12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/util/PathResolver.scala b/src/compiler/scala/tools/util/PathResolver.scala
index 3b2bba5f8e..5f4e6d58c3 100644
--- a/src/compiler/scala/tools/util/PathResolver.scala
+++ b/src/compiler/scala/tools/util/PathResolver.scala
@@ -179,7 +179,7 @@ class PathResolver(settings: Settings, context: JavaContext) {
case "bootclasspath" => settings.bootclasspath.value
case "extdirs" => settings.extdirs.value
case "classpath" | "cp" => settings.classpath.value
- case "Ysourcepath" => settings.Ysourcepath.value
+ case "sourcepath" => settings.sourcepath.value
}
/** Calculated values based on any given command line options, falling back on
@@ -193,7 +193,15 @@ class PathResolver(settings: Settings, context: JavaContext) {
def javaUserClassPath = if (useJavaClassPath) Defaults.javaUserClassPath else ""
def scalaBootClassPath = cmdLineOrElse("bootclasspath", Defaults.scalaBootClassPath)
def scalaExtDirs = cmdLineOrElse("extdirs", Defaults.scalaExtDirs)
- def sourcePath = cmdLineOrElse("Ysourcepath", Defaults.scalaSourcePath)
+ /** Scaladoc doesn't need any bootstrapping, otherwise will create errors such as:
+ * [scaladoc] ../scala-trunk/src/reflect/scala/reflect/makro/Reifiers.scala:89: error: object api is not a member of package reflect
+ * [scaladoc] case class ReificationError(val pos: reflect.api.PositionApi, val msg: String) extends Throwable(msg)
+ * [scaladoc] ^
+ * because the bootstrapping will look at the sourcepath and create package "reflect" in "<root>"
+ * and then when typing relative names, instead of picking <root>.scala.relect, typedIdentifier will pick up the
+ * <root>.reflect package created by the bootstrapping. Thus, no bootstrapping for scaladoc!
+ * TODO: we should refactor this as a separate -bootstrap option to have a clean implementation, no? */
+ def sourcePath = if (!settings.isScaladoc) cmdLineOrElse("sourcepath", Defaults.scalaSourcePath) else ""
/** Against my better judgment, giving in to martin here and allowing
* CLASSPATH to be used automatically. So for the user-specified part