Stab
This commit is contained in:
parent
425acb0452
commit
6123b7548d
2 changed files with 24 additions and 5 deletions
|
|
@ -18,7 +18,7 @@ object Release extends ParadoxKeys {
|
|||
releaseDirectory := crossTarget.value / "release")
|
||||
|
||||
lazy val commandSettings = Seq(
|
||||
commands += buildReleaseCommand)
|
||||
commands ++= Seq(buildReleaseCommand, buildDocsCommand))
|
||||
|
||||
def buildReleaseCommand = Command.command("buildRelease") { state ⇒
|
||||
val extracted = Project.extract(state)
|
||||
|
|
@ -27,14 +27,32 @@ object Release extends ParadoxKeys {
|
|||
val projectRef = extracted.get(thisProjectRef)
|
||||
val repo = extracted.get(Publish.defaultPublishTo)
|
||||
val state1 = extracted.runAggregated(publishSigned in projectRef, state)
|
||||
// Make sure you set "-Dakka.genjavadoc.enabled=true" otherwise no
|
||||
// japi will be generated and this following match will fail:
|
||||
val (state2, Seq(japi, api)) = extracted.runTask(unidoc in Compile, state1)
|
||||
val (state3, docs) = extracted.runTask(paradox in ProjectRef(projectRef.build, "akka-docs") in Compile, state2)
|
||||
|
||||
IO.delete(release)
|
||||
IO.createDirectory(release)
|
||||
IO.copyDirectory(repo, release / "releases")
|
||||
state1
|
||||
}
|
||||
|
||||
def buildDocsCommand = Command.command("buildDocs") { state =>
|
||||
if (!sys.props.contains("akka.genjavadoc.enabled"))
|
||||
throw new RuntimeException("Make sure you start sbt with \"-J-Dakka.genjavadoc.enabled=true\" otherwise no japi will be generated")
|
||||
val extracted = Project.extract(state)
|
||||
// we want to build the api-docs and docs with 2.12.x
|
||||
val scalaV = extracted.get(scalaVersion)
|
||||
if (!scalaV.startsWith("2.12"))
|
||||
throw new RuntimeException(s"The docs should be built with Scala 2.12 (was $scalaV)")
|
||||
val release = extracted.get(releaseDirectory)
|
||||
val releaseVersion = extracted.get(version)
|
||||
val projectRef = extracted.get(thisProjectRef)
|
||||
|
||||
val (state2, Seq(japi, api)) = extracted.runTask(unidoc in Compile, state)
|
||||
val (state3, docs) = extracted.runTask(paradox in ProjectRef(projectRef.build, "akka-docs") in Compile, state2)
|
||||
|
||||
IO.delete(release / "api")
|
||||
IO.delete(release / "japi")
|
||||
IO.delete(release / "docsapi")
|
||||
IO.createDirectory(release)
|
||||
IO.copyDirectory(api, release / "api" / "akka" / releaseVersion)
|
||||
IO.copyDirectory(japi, release / "japi" / "akka" / releaseVersion)
|
||||
IO.copyDirectory(docs, release / "docs" / "akka" / releaseVersion)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue