diff options
-rw-r--r-- | build.sbt | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -71,6 +71,7 @@ lazy val commonSettings = Seq[Setting[_]]( scalaSource in Compile := (sourceDirectory in Compile).value, javaSource in Compile := (sourceDirectory in Compile).value, target := (baseDirectory in ThisBuild).value / "target" / name.value, + target in Compile in doc := buildDirectory.value / "scaladoc" / name.value, classDirectory in Compile := buildDirectory.value / "quick/classes" / name.value, // given that classDirectory is overriden to be _outside_ of target directory, we have // to make sure its being cleaned properly @@ -96,7 +97,18 @@ lazy val scalaSubprojectSettings = commonSettings ++ Seq[Setting[_]]( lazy val library = configureAsSubproject(project). settings( - scalacOptions ++= Seq[String]("-sourcepath", (scalaSource in Compile).value.toString) + scalacOptions in Compile ++= Seq[String]("-sourcepath", (scalaSource in Compile).value.toString), + // Workaround for a bug in `scaladoc` that it seems to not respect the `-sourcepath` option + // as a result of this bug, the compiler cannot even initialize Definitions without + // binaries of the library on the classpath. Specifically, we get this error: + // (library/compile:doc) scala.reflect.internal.FatalError: package class scala does not have a member Int + // Ant build does the same thing always: it puts binaries for documented classes on the classpath + // sbt never does this by default (which seems like a good default) + dependencyClasspath in Compile in doc += (classDirectory in Compile).value, + scalacOptions in Compile in doc ++= { + val libraryAuxDir = (baseDirectory in ThisBuild).value / "src/library-aux" + Seq("-doc-no-compile", libraryAuxDir.toString) + } ) dependsOn (forkjoin) lazy val reflect = configureAsSubproject(project). |