Files
sbt/project/Docs.scala
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

56 lines
1.8 KiB
Scala
Raw Normal View History

import sbt.*
2017-05-03 15:52:36 +01:00
/*
import StatusPlugin.autoImport._
2017-05-08 14:34:41 +01:00
import com.typesafe.sbt.site.SitePlugin.autoImport._
import com.typesafe.sbt.site.SiteScaladocPlugin.autoImport._
2017-05-08 14:46:29 +01:00
import com.typesafe.sbt.sbtghpages.GhpagesPlugin.autoImport._
import com.typesafe.sbt.SbtGit, SbtGit.{ git, GitKeys }
2017-07-19 22:00:42 -04:00
import Sxr.{ sxr, SxrConf }
2017-05-24 11:17:45 +02:00
*/
2014-05-01 12:50:07 -04:00
object Docs:
def settings: Seq[Setting[?]] = Nil
2017-05-03 15:52:36 +01:00
/*
2013-09-06 21:17:28 -04:00
val siteExcludes = Set(".buildinfo", "objects.inv")
def siteInclude(f: File) = !siteExcludes.contains(f.getName)
2014-05-01 12:50:07 -04:00
2017-05-08 14:34:41 +01:00
def settings: Seq[Setting[_]] = Def settings (
siteSubdirName in SiteScaladoc := "api",
siteIncludeSxr("sxr"),
ghPagesSettings
)
2014-05-01 12:50:07 -04:00
2017-05-08 14:46:29 +01:00
def ghPagesSettings = Def settings (
git.remoteRepo := "[email protected]:sbt/sbt.github.com.git",
localRepoDirectory,
2017-05-08 14:46:29 +01:00
ghpagesSynchLocal := synchLocalImpl.value,
ghpagesBranch := "master"
)
2014-05-01 12:50:07 -04:00
2017-05-08 14:46:29 +01:00
def localRepoDirectory = ghpagesRepository := {
// 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
2014-08-07 12:54:00 -04:00
val status = if (isSnapshot.value) "snapshot" else "public"
Path.userHome / ".sbt" / "ghpages" / status / organization.value / name.value
}
2014-05-01 12:50:07 -04:00
2017-05-08 14:34:41 +01:00
def siteIncludeSxr(prefix: String) = Def settings (
mappings in sxr := Path.allSubpaths(sxr.value).toSeq,
2017-07-19 22:00:42 -04:00
siteSubdirName in SxrConf := prefix,
addMappingsToSiteDir(mappings in sxr, siteSubdirName in SxrConf)
2017-05-08 14:34:41 +01:00
)
2014-05-01 12:50:07 -04:00
2017-03-29 14:43:38 +01:00
def synchLocalImpl = Def task {
2017-05-08 14:46:29 +01:00
val repo = ghpagesUpdatedRepository.value
2017-03-29 14:43:38 +01:00
val versioned = repo / version.value
2014-08-07 12:54:00 -04:00
IO.delete(versioned / "sxr")
IO.delete(versioned / "api")
2017-05-08 14:46:29 +01:00
val mappings = ghpagesPrivateMappings.value
2014-08-07 12:54:00 -04:00
val toCopy = for ((file, target) <- mappings if siteInclude(file))
yield (file, versioned / target)
IO.copy(toCopy)
repo
}
2022-01-30 15:07:23 -05:00
*/