Merge pull request #1257 from akka/wip-3158-release-should-build-and-copy-javadoc-ban
Release should build and copy javadoc automatically. #3158
This commit is contained in:
commit
83541e8abf
5 changed files with 14 additions and 10 deletions
|
|
@ -25,7 +25,7 @@ import java.io.{PrintWriter, InputStreamReader, FileInputStream, File}
|
||||||
import java.nio.charset.Charset
|
import java.nio.charset.Charset
|
||||||
import java.util.Properties
|
import java.util.Properties
|
||||||
import annotation.tailrec
|
import annotation.tailrec
|
||||||
import Unidoc.{ JavaDoc, javadocSettings, junidocSources, unidoc, unidocExclude }
|
import Unidoc.{ JavaDoc, javadocSettings, junidocSources, sunidoc, unidocExclude }
|
||||||
|
|
||||||
object AkkaBuild extends Build {
|
object AkkaBuild extends Build {
|
||||||
System.setProperty("akka.mode", "test") // Is there better place for this?
|
System.setProperty("akka.mode", "test") // Is there better place for this?
|
||||||
|
|
@ -52,7 +52,6 @@ object AkkaBuild extends Build {
|
||||||
parallelExecution in GlobalScope := System.getProperty("akka.parallelExecution", "false").toBoolean,
|
parallelExecution in GlobalScope := System.getProperty("akka.parallelExecution", "false").toBoolean,
|
||||||
Publish.defaultPublishTo in ThisBuild <<= crossTarget / "repository",
|
Publish.defaultPublishTo in ThisBuild <<= crossTarget / "repository",
|
||||||
unidocExclude := Seq(samples.id, channelsTests.id, remoteTests.id),
|
unidocExclude := Seq(samples.id, channelsTests.id, remoteTests.id),
|
||||||
unidoc <<= (unidoc, doc in JavaDoc) map ((u, d) => u),
|
|
||||||
sources in JavaDoc <<= junidocSources,
|
sources in JavaDoc <<= junidocSources,
|
||||||
javacOptions in JavaDoc := Seq(),
|
javacOptions in JavaDoc := Seq(),
|
||||||
artifactName in packageDoc in JavaDoc := ((sv, mod, art) => "" + mod.name + "_" + sv.binary + "-" + mod.revision + "-javadoc.jar"),
|
artifactName in packageDoc in JavaDoc := ((sv, mod, art) => "" + mod.name + "_" + sv.binary + "-" + mod.revision + "-javadoc.jar"),
|
||||||
|
|
@ -719,7 +718,7 @@ object AkkaBuild extends Build {
|
||||||
lazy val unidocScaladocSettings: Seq[sbt.Setting[_]]= {
|
lazy val unidocScaladocSettings: Seq[sbt.Setting[_]]= {
|
||||||
Seq(scalacOptions in doc ++= scaladocOptions) ++
|
Seq(scalacOptions in doc ++= scaladocOptions) ++
|
||||||
(if (scaladocDiagramsEnabled)
|
(if (scaladocDiagramsEnabled)
|
||||||
Seq(unidoc ~= scaladocVerifier)
|
Seq(sunidoc ~= scaladocVerifier)
|
||||||
else Seq.empty)
|
else Seq.empty)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ object Dist {
|
||||||
distLibJars <<= (thisProjectRef, buildStructure, distExclude) flatMap aggregated(packageBin.task in Compile),
|
distLibJars <<= (thisProjectRef, buildStructure, distExclude) flatMap aggregated(packageBin.task in Compile),
|
||||||
distSrcJars <<= (thisProjectRef, buildStructure, distExclude) flatMap aggregated(packageSrc.task in Compile),
|
distSrcJars <<= (thisProjectRef, buildStructure, distExclude) flatMap aggregated(packageSrc.task in Compile),
|
||||||
distDocJars <<= (thisProjectRef, buildStructure, distExclude) flatMap aggregated(packageDoc.task in Compile),
|
distDocJars <<= (thisProjectRef, buildStructure, distExclude) flatMap aggregated(packageDoc.task in Compile),
|
||||||
distSources <<= (distDependencies, distLibJars, distSrcJars, distDocJars, Unidoc.unidoc, generate in Sphinx in docsProject) map DistSources,
|
distSources <<= (distDependencies, distLibJars, distSrcJars, distDocJars, Unidoc.sunidoc, generate in Sphinx in docsProject) map DistSources,
|
||||||
distDirectory <<= crossTarget / "dist",
|
distDirectory <<= crossTarget / "dist",
|
||||||
distUnzipped <<= distDirectory / "unzipped",
|
distUnzipped <<= distDirectory / "unzipped",
|
||||||
distFile <<= (distDirectory, version) { (dir, v) => dir / ("akka-" + v + ".zip") },
|
distFile <<= (distDirectory, version) { (dir, v) => dir / ("akka-" + v + ".zip") },
|
||||||
|
|
|
||||||
|
|
@ -23,13 +23,14 @@ object Release {
|
||||||
val projectRef = extracted.get(thisProjectRef)
|
val projectRef = extracted.get(thisProjectRef)
|
||||||
val repo = extracted.get(Publish.defaultPublishTo)
|
val repo = extracted.get(Publish.defaultPublishTo)
|
||||||
val state1 = extracted.runAggregated(publish in projectRef, state)
|
val state1 = extracted.runAggregated(publish in projectRef, state)
|
||||||
val (state2, api) = extracted.runTask(Unidoc.unidoc, state1)
|
val (state2, (api, japi)) = extracted.runTask(Unidoc.unidoc, state1)
|
||||||
val (state3, docs) = extracted.runTask(generate in Sphinx, state2)
|
val (state3, docs) = extracted.runTask(generate in Sphinx, state2)
|
||||||
val (state4, dist) = extracted.runTask(Dist.dist, state3)
|
val (state4, dist) = extracted.runTask(Dist.dist, state3)
|
||||||
IO.delete(release)
|
IO.delete(release)
|
||||||
IO.createDirectory(release)
|
IO.createDirectory(release)
|
||||||
IO.copyDirectory(repo, release / "releases")
|
IO.copyDirectory(repo, release / "releases")
|
||||||
IO.copyDirectory(api, release / "api" / "akka" / releaseVersion)
|
IO.copyDirectory(api, release / "api" / "akka" / releaseVersion)
|
||||||
|
IO.copyDirectory(japi, release / "japi" / "akka" / releaseVersion)
|
||||||
IO.copyDirectory(docs, release / "docs" / "akka" / releaseVersion)
|
IO.copyDirectory(docs, release / "docs" / "akka" / releaseVersion)
|
||||||
IO.copyFile(dist, release / "downloads" / dist.name)
|
IO.copyFile(dist, release / "downloads" / dist.name)
|
||||||
state4
|
state4
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,9 @@ object Unidoc {
|
||||||
val unidocSources = TaskKey[Seq[File]]("unidoc-sources")
|
val unidocSources = TaskKey[Seq[File]]("unidoc-sources")
|
||||||
val unidocAllClasspaths = TaskKey[Seq[Classpath]]("unidoc-all-classpaths")
|
val unidocAllClasspaths = TaskKey[Seq[Classpath]]("unidoc-all-classpaths")
|
||||||
val unidocClasspath = TaskKey[Seq[File]]("unidoc-classpath")
|
val unidocClasspath = TaskKey[Seq[File]]("unidoc-classpath")
|
||||||
val unidoc = TaskKey[File]("unidoc", "Create unified scaladoc for all aggregates")
|
val unidoc = TaskKey[(File, File)]("unidoc", "Create unified scaladoc and javadoc for all aggregates")
|
||||||
|
val sunidoc = TaskKey[File]("sunidoc", "Create unified scaladoc for all aggregates")
|
||||||
|
val junidoc = TaskKey[File]("junidoc", "Create unified javadoc for all aggregates")
|
||||||
val junidocAllSources = TaskKey[Seq[Seq[File]]]("junidoc-all-sources")
|
val junidocAllSources = TaskKey[Seq[Seq[File]]]("junidoc-all-sources")
|
||||||
val junidocSources = TaskKey[Seq[File]]("junidoc-sources")
|
val junidocSources = TaskKey[Seq[File]]("junidoc-sources")
|
||||||
|
|
||||||
|
|
@ -43,7 +45,9 @@ object Unidoc {
|
||||||
unidocClasspath <<= unidocAllClasspaths map { _.flatten.map(_.data).distinct },
|
unidocClasspath <<= unidocAllClasspaths map { _.flatten.map(_.data).distinct },
|
||||||
junidocAllSources <<= (thisProjectRef, buildStructure, unidocExclude) flatMap allSources(JavaDoc),
|
junidocAllSources <<= (thisProjectRef, buildStructure, unidocExclude) flatMap allSources(JavaDoc),
|
||||||
junidocSources <<= junidocAllSources map { _.flatten },
|
junidocSources <<= junidocAllSources map { _.flatten },
|
||||||
unidoc <<= unidocTask
|
sunidoc <<= sunidocTask,
|
||||||
|
junidoc <<= (doc in JavaDoc),
|
||||||
|
unidoc <<= (sunidoc, junidoc) map ((s, t) ⇒ (s, t))
|
||||||
)
|
)
|
||||||
|
|
||||||
def allSources(conf: Configuration)(projectRef: ProjectRef, structure: Load.BuildStructure, exclude: Seq[String]): Task[Seq[Seq[File]]] = {
|
def allSources(conf: Configuration)(projectRef: ProjectRef, structure: Load.BuildStructure, exclude: Seq[String]): Task[Seq[Seq[File]]] = {
|
||||||
|
|
@ -64,7 +68,7 @@ object Unidoc {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def unidocTask: Initialize[Task[File]] = {
|
def sunidocTask: Initialize[Task[File]] = {
|
||||||
(compilers, cacheDirectory, unidocSources, unidocClasspath, unidocDirectory, scalacOptions in doc, streams) map {
|
(compilers, cacheDirectory, unidocSources, unidocClasspath, unidocDirectory, scalacOptions in doc, streams) map {
|
||||||
(compilers, cache, sources, classpath, target, options, s) => {
|
(compilers, cache, sources, classpath, target, options, s) => {
|
||||||
val scaladoc = new Scaladoc(100, compilers.scalac)
|
val scaladoc = new Scaladoc(100, compilers.scalac)
|
||||||
|
|
|
||||||
|
|
@ -290,9 +290,9 @@ fi
|
||||||
# build the release
|
# build the release
|
||||||
echolog "Building the release..."
|
echolog "Building the release..."
|
||||||
if [ ! $dry_run ]; then
|
if [ ! $dry_run ]; then
|
||||||
RELEASE_OPT="-Dpublish.maven.central=true"
|
RELEASE_OPT="-Dakka.genjavadoc.enabled=true -Dpublish.maven.central=true"
|
||||||
else
|
else
|
||||||
RELEASE_OPT=""
|
RELEASE_OPT="-Dakka.genjavadoc.enabled=true"
|
||||||
fi
|
fi
|
||||||
try sbt $RELEASE_OPT build-release
|
try sbt $RELEASE_OPT build-release
|
||||||
echolog "Creating gzipped tar download..."
|
echolog "Creating gzipped tar download..."
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue