mirror of https://github.com/sbt/sbt.git
-Ymacro-no-expand for API docs
This commit is contained in:
parent
4b61747dfc
commit
67c459b6a2
|
|
@ -23,7 +23,7 @@ object Docs
|
|||
def settings: Seq[Setting[_]] =
|
||||
site.settings ++
|
||||
site.sphinxSupport(DocsPath) ++
|
||||
// site.includeScaladoc("api") ++
|
||||
site.includeScaladoc("api") ++
|
||||
// siteIncludeSxr("sxr") ++
|
||||
ghPagesSettings ++
|
||||
Seq(
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ object Sbt extends Build
|
|||
lazy val scriptedSource = SettingKey[File]("scripted-source")
|
||||
lazy val publishAll = TaskKey[Unit]("publish-all")
|
||||
|
||||
def deepTasks[T](scoped: ScopedTask[Seq[T]]): Initialize[Task[Seq[T]]] = deep(scoped.task) { _.join.map(_.flatten) }
|
||||
def deepTasks[T](scoped: ScopedTask[Seq[T]]): Initialize[Task[Seq[T]]] = deep(scoped.task) { _.join.map(_.flatten.distinct) }
|
||||
def deep[T](scoped: ScopedSetting[T]): Initialize[Seq[T]] =
|
||||
Util.inAllProjects(projects filterNot Set(root, sbtSub, scriptedBaseSub, scriptedSbtSub, scriptedPluginSub) map { p => LocalProject(p.id) }, scoped)
|
||||
|
||||
|
|
@ -210,10 +210,12 @@ object Sbt extends Build
|
|||
sources in sxr <<= deepTasks(sources in Compile),
|
||||
Sxr.sourceDirectories <<= deep(sourceDirectories in Compile).map(_.flatten),
|
||||
fullClasspath in sxr <<= (externalDependencyClasspath in Compile in sbtSub),
|
||||
compileInputs in (Compile,sxr) <<= (sources in sxr, compileInputs in sbtSub in Compile, fullClasspath in sxr) map { (srcs, in, cp) =>
|
||||
compileInputs in (Compile,sxr) <<= (sources in sxr, compileInputs in sbtSub in Compile, fullClasspath in sxr, scalacOptions) map { (srcs, in, cp, opts) =>
|
||||
in.copy(config = in.config.copy(sources = srcs, classpath = cp.files))
|
||||
},
|
||||
compileInputs in (Compile,doc) <<= (compileInputs in (Compile,sxr)).identity,
|
||||
compileInputs in (Compile,doc) <<= (compileInputs in (Compile,sxr), scalacOptions in doc) map { (ci, opts) =>
|
||||
ci.copy(config = ci.config.copy(options = opts))
|
||||
},
|
||||
publishAll <<= inAll(nonRoots, publishLocal.task),
|
||||
TaskKey[Unit]("build-all") <<= (publishAll, proguard in Proguard, sxr, doc) map { (_,_,_,_) => () }
|
||||
)
|
||||
|
|
|
|||
|
|
@ -17,12 +17,13 @@ object Sxr
|
|||
managedClasspath <<= update map { _.matching( configurationFilter(sxrConf.name) ).classpath },
|
||||
scalacOptions <+= sourceDirectories map { "-P:sxr:base-directory:" + _.absString },
|
||||
scalacOptions <+= managedClasspath map { "-Xplugin:" + _.files.absString },
|
||||
scalacOptions in doc += "-Ymacro-no-expand",
|
||||
scaladocOptions <<= scalacOptions,
|
||||
target <<= target in taskGlobal apply { _ / "browse" },
|
||||
sxr in taskGlobal <<= sxrTask
|
||||
)
|
||||
def taskGlobal = ThisScope.copy(task = Global)
|
||||
def sxrTask = (sources, cacheDirectory, target, scalacOptions, classpathOptions, scalaInstance, fullClasspath in sxr, streams) map { (srcs, cache, out, opts, cpOpts, si, cp, s) =>
|
||||
def sxrTask = (sources, cacheDirectory, target, scalacOptions in sxr, classpathOptions, scalaInstance, fullClasspath in sxr, streams) map { (srcs, cache, out, opts, cpOpts, si, cp, s) =>
|
||||
val outputDir = out.getParentFile / (out.getName + ".sxr")
|
||||
val f = FileFunction.cached(cache / "sxr", FilesInfo.hash) { in =>
|
||||
s.log.info("Generating sxr output in " + outputDir.getAbsolutePath + "...")
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ object Util
|
|||
scalacOptions ++= Seq("-Xelide-below", "0"),
|
||||
scalacOptions <++= scalaVersion map CrossVersion.partialVersion map {
|
||||
case Some((2, 9)) => Nil // support 2.9 for some subprojects for the Scala Eclipse IDE
|
||||
case _ => Seq("-feature", "-language:implicitConversions", "-language:postfixOps", "-language:higherKinds", "-language:existentials")
|
||||
case _ => Seq("-feature", "-language:implicitConversions", "-language:postfixOps", "-language:higherKinds", "-language:existentials")
|
||||
}
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue