From 5ecc16df240ee80d84309f8eb6698c0cdca678a5 Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Sun, 22 Sep 2013 13:46:34 -0400 Subject: [PATCH] Docs: use different local directory for ghpages repository for snapshots and stable updates. --- project/Docs.scala | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/project/Docs.scala b/project/Docs.scala index e7ae55423..9450b67fb 100644 --- a/project/Docs.scala +++ b/project/Docs.scala @@ -39,6 +39,7 @@ object Docs def ghPagesSettings = ghpages.settings ++ Seq( git.remoteRepo := "git@github.com:sbt/sbt.github.com.git", + localRepoDirectory, ghkeys.synchLocal <<= synchLocalImpl, cnameFile <<= (sourceDirectory in SphinxSupport.Sphinx) / "CNAME", latestRelease in ThisBuild := false, @@ -46,6 +47,13 @@ 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" + Path.userHome / ".sbt" / "ghpages" / status / organization.value / name.value + } + def siteIncludeSxr(prefix: String) = Seq( mappings in sxr <<= sxr.map(dir => Path.allSubpaths(dir).toSeq), site.addMappingsToSiteDir(mappings in sxr, prefix)