diff --git a/.gitignore b/.gitignore
index 30b785722..f6f7c7ae7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
target/
project/boot/
.release.sbt
+__pycache__
diff --git a/README.md b/README.md
index fd333b778..60c5f5cbd 100644
--- a/README.md
+++ b/README.md
@@ -59,16 +59,13 @@ This is the 0.13.x series of sbt.
## Building Documentation
-Documentation is built using jekyll and sphinx and requires some external programs and libraries to be manually installed first:
+Documentation is built using sphinx and requires some external programs and libraries to be manually installed first:
```text
$ pip install pygments
$ pip install sphinx
$ pip install sphinxcontrib-issuetracker
-$ gem install rdiscount
-$ gem install jekyll
```
To build the full site, run the `make-site` task, which will generate the manual, API, SXR, and other site pages in `target/site/`.
-
-Individual pieces of the site may be generated using `xsbt/sphinx:mappings`, `xsbt/jekyll:mappings`, `xsbt/doc`, or `xsbt/sxr`. The output directories will be under `target/`, such as `target/sphinx`.
\ No newline at end of file
+To only work on the site and not API or SXR, run `sphinx:mappings`.
\ No newline at end of file
diff --git a/project/Docs.scala b/project/Docs.scala
index 72b513aaf..42f4d4303 100644
--- a/project/Docs.scala
+++ b/project/Docs.scala
@@ -1,49 +1,63 @@
import sbt._
import Keys._
import Status.{isSnapshot, publishStatus}
- import com.jsuereth.sbtsite.{SitePlugin, SiteKeys}
- import SitePlugin.site
+ 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 Sxr.sxr
object Docs
{
+ val cnameFile = SettingKey[File]("cname-file", "Location of the CNAME file for the website.")
+
def settings: Seq[Setting[_]] =
site.settings ++
- site.sphinxSupport("manual") ++
- site.jekyllSupport() ++
+ site.sphinxSupport("docs") ++
site.includeScaladoc("api") ++
- siteIncludeSxr ++
- sitePrefixVersion
+ siteIncludeSxr("sxr") ++
+ ghPagesSettings
- def siteIncludeSxr = Seq(
- mappings in sxr <<= sxr.map(dir => Path.allSubpaths(dir).toSeq),
- site.addMappingsToSiteDir(mappings in sxr, "sxr")
+ def ghPagesSettings = ghpages.settings ++ Seq(
+ git.remoteRepo := "git@github.com:sbt/sbt.github.com.git",
+ ghkeys.synchLocal <<= synchLocalImpl,
+ cnameFile <<= (sourceDirectory in SphinxSupport.Sphinx) / "CNAME",
+ GitKeys.gitBranch in ghkeys.updatedRepository := Some("master")
)
- def sitePrefixVersion =
- siteMappings <<= (siteMappings, version) map { (ms, v) =>
- ms.map { case (src, path) => (src, v + "/" + path) }
- }
+ def siteIncludeSxr(prefix: String) = Seq(
+ mappings in sxr <<= sxr.map(dir => Path.allSubpaths(dir).toSeq),
+ site.addMappingsToSiteDir(mappings in sxr, prefix)
+ )
- def siteLinkLatest =
- makeSite <<= (makeSite, version, streams, isSnapshot) map { (dir, v, s, snap) =>
- linkSite(dir, v, if(snap) "snapshot" else "stable", s.log)
- dir
- }
+ def synchLocalImpl = (ghkeys.privateMappings, ghkeys.updatedRepository, version, isSnapshot, streams, cnameFile) map { (mappings, repo, v, snap, s, cname) =>
+ val versioned = repo / v
+ if(snap)
+ IO.delete(versioned)
+ else if(versioned.exists)
+ error("Site for " + v + " already exists: " + versioned.getAbsolutePath)
+ IO.copy(mappings map { case (file, target) => (file, versioned / target) })
+ IO.copyFile(cname, repo / cname.getName)
+ IO.touch(repo / ".nojekyll")
+ linkSite(repo, v, if(snap) "snapshot" else "release", s.log)
+ s.log.info("Copied site to " + versioned)
+ repo
+ }
def linkSite(base: File, to: String, from: String, log: Logger) {
val current = base / to
assert(current.isDirectory, "Versioned site not present at " + current.getAbsolutePath)
- val symlinkFile = base / from
- symlinkFile.delete()
- symlink(to = current, from = symlinkFile, log = log)
+ val symlinkDir = base / from
+ symlinkDir.delete()
+ symlink(path = to, file = symlinkDir, log = log)
}
// TODO: platform independence/use symlink from Java 7
- def symlink(to: File, from: File, log: Logger): Unit =
- "ln" :: "-s" :: to.getAbsolutePath :: from.getAbsolutePath :: Nil ! log match {
+ def symlink(path: String, file: File, log: Logger): Unit =
+ "ln" :: "-s" :: path :: file.getAbsolutePath :: Nil ! log match {
case 0 => ()
- case code => error("Could not create symbolic link from " + from + " to " + " to.")
+ case code => error("Could not create symbolic link '" + file.getAbsolutePath + "' with path " + path)
}
}
\ No newline at end of file
diff --git a/project/Sxr.scala b/project/Sxr.scala
index e7d01eb76..ff98179a4 100644
--- a/project/Sxr.scala
+++ b/project/Sxr.scala
@@ -22,11 +22,17 @@ object Sxr
sxr in taskGlobal <<= sxrTask
)
def taskGlobal = ThisScope.copy(task = Global)
- def sxrTask = (sources, target, scalacOptions, classpathOptions, scalaInstance, fullClasspath in sxr, streams) map { (srcs, out, opts, cpOpts, si, cp, s) =>
- IO.delete(out)
- IO.createDirectory(out)
- val comp = new compiler.RawCompiler(si, cpOpts, s.log)
- comp(srcs, cp.files, out, opts)
- out.getParentFile / (out.getName + ".sxr")
+ def sxrTask = (sources, cacheDirectory, target, scalacOptions, classpathOptions, scalaInstance, fullClasspath in sxr, streams) map { (srcs, cache, out, opts, cpOpts, si, cp, s) =>
+ val outputDir = out.getParentFile / (out.getName + ".sxr")
+ val f = FileFunction.cached(cache / "sxr", FilesInfo.hash) { in =>
+ s.log.info("Generating sxr output in " + outputDir.getAbsolutePath + "...")
+ IO.delete(out)
+ IO.createDirectory(out)
+ val comp = new compiler.RawCompiler(si, cpOpts, s.log)
+ comp(in.toSeq.sorted, cp.files, out, opts)
+ Set(outputDir)
+ }
+ f(srcs.toSet)
+ outputDir
}
}
diff --git a/project/p.sbt b/project/p.sbt
index 12db4e309..d40b6fca8 100644
--- a/project/p.sbt
+++ b/project/p.sbt
@@ -1,3 +1,7 @@
libraryDependencies += "net.databinder" %% "dispatch-http" % "0.8.8"
-addSbtPlugin("com.jsuereth" % "sbt-site-plugin" % "0.5.0")
\ No newline at end of file
+addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "0.6.0")
+
+resolvers += "jgit-repo" at "http://download.eclipse.org/jgit/maven"
+
+addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.5.0")
\ No newline at end of file
diff --git a/src/jekyll/_config.yml b/src/jekyll/_config.yml
deleted file mode 100644
index 1f67046db..000000000
--- a/src/jekyll/_config.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-pygments: true
-name: Simple Build Tool
-description: Homepage for the Simple Build Tool
-url: http://scala-sbt.org
-markdown: rdiscount
\ No newline at end of file
diff --git a/src/jekyll/_includes/footer.txt b/src/jekyll/_includes/footer.txt
deleted file mode 100644
index 9859bd4ce..000000000
--- a/src/jekyll/_includes/footer.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-