harrah/xsbt — Issue #391: Allow to override scalaInstance used for doc task
Author: huynhjl
Created: 2012-03-06 16:16:34+00:00
State: open

As [requested](http://groups.google.com/group/simple-build-tool/browse_thread/thread/4f5c1fdeef9ad015?tvc=2) by Mark, I'm opening an issue to allow overriding the scalaInstance used by the doc task (due to "intermediate setting problem").

Snippet included of what I was hoping to do:

```scala
lazy val sdscala = Project(
id = "sdscala",
base = file("."),
settings = buildSettings ++ Seq(
libraryDependencies ++= dependencies,
scalaInstance in (Compile, doc) <<= (scalaInstance, packagedArtifact in Compile in doclet in packageBin) map { case (si, (a, f)) =>
new ScalaInstance(si.version, si.loader, si.libraryJar, si.compilerJar, si.extraJars ++ Seq(f), si.explicitActual)
},
scalacOptions in (Compile, doc) <++= (name, version) map { Opts.doc.title(_) ++ Opts.doc.version(_) },
scalacOptions in (Compile, doc) ++= Opts.doc.generator("sdscala.doclet.LuceneDocLet")
)
) dependsOn(doclet % "compile->runtime")

lazy val doclet = Project(
id = "doclet",
base = file("doclet"),
settings = buildSettings ++ Seq(
libraryDependencies ++= dependencies,
libraryDependencies <+= scalaVersion("org.scala-lang" % "scala-compiler" % _ )
)
)
```

That actually does not pick up the scala instance.