mirror of https://github.com/sbt/sbt.git
Docs: pass build values to sphinx/conf.py via environment variables to reduce duplication.
This commit is contained in:
parent
c6cee694ab
commit
f725dd6c65
|
|
@ -27,6 +27,7 @@ object Docs
|
|||
// siteIncludeSxr("sxr") ++
|
||||
ghPagesSettings ++
|
||||
Seq(
|
||||
SphinxSupport.sphinxEnv in SphinxSupport.Sphinx <<= sphinxEnvironmentVariables,
|
||||
SphinxSupport.sphinxIncremental in SphinxSupport.Sphinx := true,
|
||||
// TODO: set to true with newer sphinx plugin release
|
||||
SphinxSupport.enableOutput in SphinxSupport.generatePdf := false
|
||||
|
|
@ -44,6 +45,23 @@ object Docs
|
|||
site.addMappingsToSiteDir(mappings in sxr, prefix)
|
||||
)
|
||||
|
||||
def sphinxEnvironmentVariables = (scalaVersion, version) map { (scalaV, sbtV) =>
|
||||
// major.minor
|
||||
def release(v: String): String = CrossVersion.partialVersion(v) match {
|
||||
case Some((major,minor)) => major + "." + minor
|
||||
case None => v
|
||||
}
|
||||
Map[String,String](
|
||||
"sbt.full.version" -> sbtV,
|
||||
"sbt.partial.version" -> release(sbtV),
|
||||
"sbt.site.version" -> sbtV.takeWhile(_ != '-'),
|
||||
"sbt.binary.version" -> CrossVersion.binarySbtVersion(sbtV),
|
||||
"scala.full.version" -> scalaV,
|
||||
"scala.partial.version" -> release(scalaV),
|
||||
"scala.binary.version" -> CrossVersion.binaryScalaVersion(scalaV)
|
||||
)
|
||||
}
|
||||
|
||||
def synchLocalImpl = (ghkeys.privateMappings, ghkeys.updatedRepository, version, isSnapshot, streams, cnameFile) map { (mappings, repo, v, snap, s, cname) =>
|
||||
val versioned = repo / v
|
||||
if(snap)
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ libraryDependencies ++= Seq(
|
|||
"org.jsoup" % "jsoup" % "1.7.1"
|
||||
)
|
||||
|
||||
addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "0.7.0")
|
||||
addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "0.7.1")
|
||||
|
||||
resolvers += "jgit-repo" at "http://download.eclipse.org/jgit/maven"
|
||||
|
||||
|
|
|
|||
|
|
@ -8,11 +8,11 @@ extensions = ['sphinxcontrib.issuetracker', 'sphinx.ext.extlinks', 'howto', 'cod
|
|||
# Project variables
|
||||
|
||||
project = 'sbt'
|
||||
version = '0.13'
|
||||
site_version = '0.13.0'
|
||||
release = "0.13.0-SNAPSHOT"
|
||||
scalaVersion = "2.10"
|
||||
scalaRelease = "2.10.2"
|
||||
version = os.environ['sbt.partial.version']
|
||||
site_version = os.environ['sbt.site.version']
|
||||
release = os.environ['sbt.full.version']
|
||||
scalaVersion = os.environ['scala.binary.version']
|
||||
scalaRelease = os.environ['scala.full.version']
|
||||
|
||||
# General settings
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue