From 67c459b6a2906f311c8e3bccdfd53cf58f0611ec Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Wed, 13 Feb 2013 08:13:50 -0500 Subject: [PATCH] -Ymacro-no-expand for API docs --- project/Docs.scala | 2 +- project/Sbt.scala | 8 +++++--- project/Sxr.scala | 3 ++- project/Util.scala | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/project/Docs.scala b/project/Docs.scala index c1a375eed..459af3d13 100644 --- a/project/Docs.scala +++ b/project/Docs.scala @@ -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( diff --git a/project/Sbt.scala b/project/Sbt.scala index 81235302b..b6cfd5be3 100644 --- a/project/Sbt.scala +++ b/project/Sbt.scala @@ -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 { (_,_,_,_) => () } ) diff --git a/project/Sxr.scala b/project/Sxr.scala index ff98179a4..975c25c62 100644 --- a/project/Sxr.scala +++ b/project/Sxr.scala @@ -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 + "...") diff --git a/project/Util.scala b/project/Util.scala index ea8845988..7a0c4dcdf 100644 --- a/project/Util.scala +++ b/project/Util.scala @@ -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") } )