diff --git a/build.sbt b/build.sbt index 7b1335d1b..7bcace179 100644 --- a/build.sbt +++ b/build.sbt @@ -67,13 +67,30 @@ def testedBaseSettings: Seq[Setting[_]] = baseSettings ++ testDependencies lazy val sbtRoot: Project = (project in file(".")) - .enablePlugins(ScriptedPlugin) + .enablePlugins(ScriptedPlugin, SiteScaladocPlugin) .configs(Sxr.sxrConf) .aggregate(nonRoots: _*) .settings( buildLevelSettings, minimalSettings, - rootSettings, + Util.baseScalacOptions, + Docs.settings, + Sxr.settings, + scalacOptions += "-Ymacro-expand:none", // for both sxr and doc + sources in sxr := { + val allSources = (sources ?? Nil).all(docProjects).value + allSources.flatten.distinct + }, //sxr + sources in (Compile, doc) := (sources in sxr).value, // doc + Sxr.sourceDirectories := { + val allSourceDirectories = (sourceDirectories ?? Nil).all(docProjects).value + allSourceDirectories.flatten + }, + fullClasspath in sxr := (externalDependencyClasspath in Compile in sbtProj).value, + dependencyClasspath in (Compile, doc) := (fullClasspath in sxr).value, + Util.publishPomSettings, + otherRootSettings, + Transform.conscriptSettings(bundledLauncherProj), publish := {}, publishLocal := {} ) @@ -329,10 +346,6 @@ def allProjects = lazy val nonRoots = allProjects.map(p => LocalProject(p.id)) -def rootSettings = - fullDocSettings ++ - Util.publishPomSettings ++ otherRootSettings ++ - Transform.conscriptSettings(bundledLauncherProj) def otherRootSettings = Seq( scripted := scriptedTask.evaluated, @@ -380,21 +393,6 @@ lazy val docProjects: ScopeFilter = ScopeFilter( inAnyProject -- inProjects(sbtRoot, sbtProj, scriptedSbtProj, scriptedPluginProj), inConfigurations(Compile) ) -def fullDocSettings = Util.baseScalacOptions ++ Docs.settings ++ Sxr.settings ++ Seq( - scalacOptions += "-Ymacro-expand:none", // for both sxr and doc - sources in sxr := { - val allSources = (sources ?? Nil).all(docProjects).value - allSources.flatten.distinct - }, //sxr - sources in (Compile, doc) := (sources in sxr).value, // doc - Sxr.sourceDirectories := { - val allSourceDirectories = (sourceDirectories ?? Nil).all(docProjects).value - allSourceDirectories.flatten - }, - fullClasspath in sxr := (externalDependencyClasspath in Compile in sbtProj).value, - dependencyClasspath in (Compile, doc) := (fullClasspath in sxr).value -) - lazy val safeUnitTests = taskKey[Unit]("Known working tests (for both 2.10 and 2.11)") lazy val safeProjects: ScopeFilter = ScopeFilter( inProjects(mainSettingsProj, mainProj, actionsProj, runProj, stdTaskProj), diff --git a/project/Docs.scala b/project/Docs.scala index 0721eb920..2db6636fd 100644 --- a/project/Docs.scala +++ b/project/Docs.scala @@ -1,24 +1,23 @@ import sbt._ import Keys._ import StatusPlugin.autoImport._ -import com.typesafe.sbt.{ SbtGhPages, SbtGit, SbtSite, site => sbtsite } -import SbtSite.{ site, SiteKeys } +import com.typesafe.sbt.site.SitePlugin.autoImport._ +import com.typesafe.sbt.site.SiteScaladocPlugin.autoImport._ +import com.typesafe.sbt.{ SbtGhPages, SbtGit } import SbtGhPages.{ ghpages, GhPagesKeys => ghkeys } import SbtGit.{ git, GitKeys } -import sbtsite.SphinxSupport -import SiteKeys.{ makeSite, siteMappings } -import Sxr.sxr +import Sxr.{ sxr, sxrConf } import SiteMap.Entry object Docs { val siteExcludes = Set(".buildinfo", "objects.inv") def siteInclude(f: File) = !siteExcludes.contains(f.getName) - def settings: Seq[Setting[_]] = - site.settings ++ - site.includeScaladoc("api") ++ - siteIncludeSxr("sxr") ++ - ghPagesSettings + def settings: Seq[Setting[_]] = Def settings ( + siteSubdirName in SiteScaladoc := "api", + siteIncludeSxr("sxr"), + ghPagesSettings + ) def ghPagesSettings = ghpages.settings ++ Seq( git.remoteRepo := "git@github.com:sbt/sbt.github.com.git", @@ -34,10 +33,11 @@ object Docs { Path.userHome / ".sbt" / "ghpages" / status / organization.value / name.value } - def siteIncludeSxr(prefix: String) = - Seq( - mappings in sxr := Path.allSubpaths(sxr.value).toSeq - ) ++ site.addMappingsToSiteDir(mappings in sxr, prefix) + def siteIncludeSxr(prefix: String) = Def settings ( + mappings in sxr := Path.allSubpaths(sxr.value).toSeq, + siteSubdirName in sxrConf := prefix, + addMappingsToSiteDir(mappings in sxr, siteSubdirName in sxrConf) + ) def synchLocalImpl = Def task { val repo = ghkeys.updatedRepository.value diff --git a/project/plugins.sbt b/project/plugins.sbt index fcc71cf05..be879644a 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -7,6 +7,6 @@ addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.5.4") addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "0.9.2") addSbtPlugin("com.typesafe.sbt" % "sbt-javaversioncheck" % "0.1.0") addSbtPlugin("com.geirsson" % "sbt-scalafmt" % "0.6.8") -addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "0.8.2") +addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.2.0") addSbtPlugin("me.lessis" % "bintray-sbt" % "0.3.0") addSbtPlugin("org.scala-sbt" % "sbt-contraband" % "0.3.0-M4")