Skip to content

Commit

Permalink
Generates the scaladoc and adds the api to the microsite (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fede Fernández authored May 1, 2017
1 parent 6adb34e commit 32f3290
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
7 changes: 6 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,14 @@ lazy val combinators = (project in file("combinators"))
.settings(testSettings)
.settings(commonDeps)

lazy val docs = (project in file("docs"))
lazy val docs: Project = (project in file("docs"))
.settings(moduleName := "scalacheck-toolbox-docs")
.settings(name := "scalacheck-toolbox")
.settings(micrositeSettings: _*)
.enablePlugins(MicrositesPlugin)
.enablePlugins(ScalaUnidocPlugin)
.settings(
unidocProjectFilter in(ScalaUnidoc, unidoc) := inProjects(datetime, magic, combinators, docs))
.dependsOn(datetime)
.dependsOn(magic)
.dependsOn(combinators)
5 changes: 4 additions & 1 deletion docs/src/main/resources/microsite/data/menu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@ options:
url: docs/magic/index.html

- title: Combinators
url: docs/combinators/index.html
url: docs/combinators/index.html

- title: ScalaDoc
url: api/com/fortysevendeg/scalacheck
14 changes: 11 additions & 3 deletions project/ProjectPlugin.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import com.typesafe.sbt.site.jekyll.JekyllPlugin.autoImport._
import com.typesafe.sbt.site.SitePlugin.autoImport._
import microsites.MicrositesPlugin.autoImport._
import sbt.Keys._
import sbt._
Expand All @@ -7,10 +8,11 @@ import scoverage.ScoverageKeys._
import sbtorgpolicies.OrgPoliciesKeys.orgBadgeListSetting
import sbtorgpolicies.OrgPoliciesPlugin
import sbtorgpolicies.OrgPoliciesPlugin.autoImport._
import sbtorgpolicies.model.{Dev, scalac}
import sbtorgpolicies.model.scalac
import sbtorgpolicies.templates.badges._
import sbtorgpolicies.runnable.syntax._
import sbtorgpolicies.runnable._
import sbtunidoc.ScalaUnidocPlugin.autoImport._
import tut.Plugin._

object ProjectPlugin extends AutoPlugin {
Expand All @@ -21,14 +23,19 @@ object ProjectPlugin extends AutoPlugin {

object autoImport {

lazy val docsMappingsAPIDir: SettingKey[String] = settingKey[String](
"Name of subdirectory in site target directory for api docs")

lazy val micrositeSettings = Seq(
micrositeName := "scalacheck-toolbox",
micrositeDescription := "A helping hand for generating sensible data with ScalaCheck",
micrositeDocumentationUrl := "/scalacheck-toolbox/docs/",
micrositeBaseUrl := "/scalacheck-toolbox",
micrositeGithubRepo := "scalacheck-toolbox",
micrositeGithubOwner := "47deg",
includeFilter in Jekyll := "*.html" | "*.css" | "*.png" | "*.jpg" | "*.gif" | "*.js" | "*.swf" | "*.md"
includeFilter in Jekyll := "*.html" | "*.css" | "*.png" | "*.jpg" | "*.gif" | "*.js" | "*.swf" | "*.md",
docsMappingsAPIDir in ScalaUnidoc := "api",
addMappingsToSiteDir(mappings in(ScalaUnidoc, packageDoc), docsMappingsAPIDir in ScalaUnidoc)
)

lazy val testSettings = Seq(
Expand Down Expand Up @@ -62,7 +69,8 @@ object ProjectPlugin extends AutoPlugin {
(compile in Compile).asRunnableItemFull,
"test-only * -- -minSuccessfulTests 100000".asRunnableItemFull,
(ScoverageKeys.coverageReport in Test).asRunnableItemFull,
(tut in ProjectRef(file("."), "docs")).asRunnableItem
(tut in ProjectRef(file("."), "docs")).asRunnableItem,
"docs/unidoc".asRunnableItemFull
)
)
}

0 comments on commit 32f3290

Please sign in to comment.