scalariform project/Docs.scala

This commit is contained in:
Eugene Yokota 2014-08-07 12:54:00 -04:00
parent 0bada62349
commit bc91e456f7
1 changed files with 15 additions and 16 deletions

View File

@ -1,12 +1,12 @@
import sbt._
import Keys._
import Status.publishStatus
import com.typesafe.sbt.{SbtGhPages,SbtGit,SbtSite,site=>sbtsite}
import SbtSite.{site, SiteKeys}
import SbtGhPages.{ghpages, GhPagesKeys => ghkeys}
import SbtGit.{git, GitKeys}
import com.typesafe.sbt.{ SbtGhPages, SbtGit, SbtSite, site => sbtsite }
import SbtSite.{ site, SiteKeys }
import SbtGhPages.{ ghpages, GhPagesKeys => ghkeys }
import SbtGit.{ git, GitKeys }
import sbtsite.SphinxSupport
import SiteKeys.{makeSite,siteMappings}
import SiteKeys.{ makeSite, siteMappings }
import Sxr.sxr
import SiteMap.Entry
@ -16,9 +16,9 @@ object Docs {
def settings: Seq[Setting[_]] =
site.settings ++
site.includeScaladoc("api") ++
siteIncludeSxr("sxr") ++
ghPagesSettings
site.includeScaladoc("api") ++
siteIncludeSxr("sxr") ++
ghPagesSettings
def ghPagesSettings = ghpages.settings ++ Seq(
git.remoteRepo := "git@github.com:sbt/sbt.github.com.git",
@ -27,11 +27,10 @@ object Docs {
GitKeys.gitBranch in ghkeys.updatedRepository := Some("master")
)
def localRepoDirectory = ghkeys.repository := {
// distinguish between building to update the site or not so that CI jobs
// that don't commit+publish don't leave uncommitted changes in the working directory
val status = if(isSnapshot.value) "snapshot" else "public"
val status = if (isSnapshot.value) "snapshot" else "public"
Path.userHome / ".sbt" / "ghpages" / status / organization.value / name.value
}
@ -42,11 +41,11 @@ object Docs {
def synchLocalImpl = (ghkeys.privateMappings, ghkeys.updatedRepository, version, streams) map {
(mappings, repo, v, s) =>
val versioned = repo / v
IO.delete(versioned / "sxr")
IO.delete(versioned / "api")
val toCopy = for( (file, target) <- mappings if siteInclude(file) ) yield (file, versioned / target)
IO.copy(toCopy)
repo
val versioned = repo / v
IO.delete(versioned / "sxr")
IO.delete(versioned / "api")
val toCopy = for ((file, target) <- mappings if siteInclude(file)) yield (file, versioned / target)
IO.copy(toCopy)
repo
}
}