summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/doc/Settings.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/scala/tools/nsc/doc/Settings.scala')
-rw-r--r--src/compiler/scala/tools/nsc/doc/Settings.scala32
1 files changed, 21 insertions, 11 deletions
diff --git a/src/compiler/scala/tools/nsc/doc/Settings.scala b/src/compiler/scala/tools/nsc/doc/Settings.scala
index 64a376b96e..94ebbf2c12 100644
--- a/src/compiler/scala/tools/nsc/doc/Settings.scala
+++ b/src/compiler/scala/tools/nsc/doc/Settings.scala
@@ -7,6 +7,7 @@ package scala.tools.nsc
package doc
import java.io.File
+import java.net.URI
import java.lang.System
import scala.language.postfixOps
@@ -71,6 +72,12 @@ class Settings(error: String => Unit, val printMsg: String => Unit = println(_))
""
)
+ val docExternalUris = MultiStringSetting (
+ "-doc-external-uris",
+ "external-doc",
+ "comma-separated list of file://classpath_entry_path#doc_URL URIs for external dependencies"
+ )
+
val useStupidTypes = BooleanSetting (
"-Yuse-stupid-types",
"Print the types of inherited members as seen from their original definition context. Hint: you don't want to do that!"
@@ -197,7 +204,7 @@ class Settings(error: String => Unit, val printMsg: String => Unit = println(_))
val docExternalUrls = MultiStringSetting (
"-external-urls",
"externalUrl(s)",
- "comma-separated list of package_names=doc_URL for external dependencies, where package names are ':'-separated"
+ "(deprecated) comma-separated list of package_names=doc_URL for external dependencies, where package names are ':'-separated"
)
val docGroups = BooleanSetting (
@@ -244,22 +251,25 @@ class Settings(error: String => Unit, val printMsg: String => Unit = println(_))
}
}
- // TODO: Enable scaladoc to scoop up the package list from another scaladoc site, just as javadoc does
- // -external-urls 'http://www.scala-lang.org/archives/downloads/distrib/files/nightly/docs/library'
- // should trigger scaldoc to fetch the package-list file. The steps necessary:
- // 1 - list all packages generated in scaladoc in the package-list file, exactly as javadoc:
- // see http://docs.oracle.com/javase/6/docs/api/package-list for http://docs.oracle.com/javase/6/docs/api
- // 2 - download the file and add the packages to the list
- lazy val extUrlMapping: Map[String, String] = (Map.empty[String, String] /: docExternalUrls.value) {
+ def appendIndex(url: String): String = {
+ val index = "/index.html"
+ if (url.endsWith(index)) url else url + index
+ }
+
+ // Deprecated together with 'docExternalUrls' option.
+ lazy val extUrlPackageMapping: Map[String, String] = (Map.empty[String, String] /: docExternalUrls.value) {
case (map, binding) =>
val idx = binding indexOf "="
val pkgs = binding substring (0, idx) split ":"
- var url = binding substring (idx + 1)
- val index = "/index.html"
- url = if (url.endsWith(index)) url else url + index
+ val url = appendIndex(binding substring (idx + 1))
map ++ (pkgs map (_ -> url))
}
+ lazy val extUrlMapping: Map[String, String] = docExternalUris.value map { s =>
+ val uri = new URI(s)
+ uri.getSchemeSpecificPart -> appendIndex(uri.getFragment)
+ } toMap
+
/**
* This is the hardcoded area of Scaladoc. This is where "undesirable" stuff gets eliminated. I know it's not pretty,
* but ultimately scaladoc has to be useful. :)