mirror of https://github.com/sbt/sbt.git
support separate configuration of doc inputs
This commit is contained in:
parent
a3460698bb
commit
71a346bd4c
|
|
@ -171,7 +171,7 @@ object Defaults extends BuildCommon
|
|||
}
|
||||
def compilersSetting = compilers <<= (scalaInstance, appConfiguration, streams, classpathOptions, javaHome) map { (si, app, s, co, jh) => Compiler.compilers(si, co, jh)(app, s.log) }
|
||||
|
||||
lazy val configTasks = Seq(
|
||||
lazy val configTasks = docSetting(doc) ++ Seq(
|
||||
initialCommands in GlobalScope :== "",
|
||||
compile <<= compileTask,
|
||||
compileInputs <<= compileInputsTask,
|
||||
|
|
@ -188,7 +188,6 @@ object Defaults extends BuildCommon
|
|||
runMain <<= runMainTask(fullClasspath, runner in run),
|
||||
scaladocOptions in GlobalScope :== Nil,
|
||||
scaladocOptions <<= scaladocOptions or scalacOptions.identity,
|
||||
doc <<= docTask,
|
||||
copyResources <<= copyResourcesTask
|
||||
)
|
||||
|
||||
|
|
@ -418,7 +417,17 @@ object Defaults extends BuildCommon
|
|||
new Run(si, trap, tmp)
|
||||
}
|
||||
|
||||
def docTask: Initialize[Task[File]] =
|
||||
def docSetting(key: ScopedTask[File]): Seq[Setting[_]] = inTask(key)(Seq(
|
||||
cacheDirectory ~= (_ / key.key.label),
|
||||
target <<= docDirectory, // deprecate docDirectory in favor of 'target in doc'
|
||||
fullClasspath <<= dependencyClasspath,
|
||||
key in TaskGlobal <<= (sources, cacheDirectory, maxErrors, compilers, target, configuration, scaladocOptions, fullClasspath, streams) map { (srcs, cache, maxE, cs, out, config, options, cp, s) =>
|
||||
(new Scaladoc(maxE, cs.scalac)).cached(cache, nameForSrc(config.name), srcs, cp.files, out, options, s.log)
|
||||
out
|
||||
}
|
||||
))
|
||||
|
||||
@deprecated("Use docSetting", "0.11.0") def docTask: Initialize[Task[File]] =
|
||||
(cacheDirectory, compileInputs, streams, docDirectory, configuration, scaladocOptions) map { (cache, in, s, target, config, options) =>
|
||||
val d = new Scaladoc(in.config.maxErrors, in.compilers.scalac)
|
||||
val cp = in.config.classpath.toList - in.config.classesDirectory
|
||||
|
|
|
|||
|
|
@ -95,6 +95,7 @@ object Keys
|
|||
|
||||
// Output paths
|
||||
val classDirectory = SettingKey[File]("class-directory", "Directory for compiled classes and copied resources.")
|
||||
@deprecated("Use 'target', scoped by the doc task. For example, 'target in Compile in doc'", "0.11.0")
|
||||
val docDirectory = SettingKey[File]("doc-directory", "Directory for generated documentation.")
|
||||
val cacheDirectory = SettingKey[File]("cache-directory", "Directory used for caching task data.")
|
||||
val cleanFiles = SettingKey[Seq[File]]("clean-files", "The files to recursively delete during a clean.")
|
||||
|
|
|
|||
Loading…
Reference in New Issue