From fbcd94f68b0ae9417faf7a6578572e368f326907 Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Wed, 20 Nov 2019 10:38:49 +0100 Subject: [PATCH] Allow deployRsync for publishing snapshot docs (#2821) --- build.sbt | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/build.sbt b/build.sbt index f6f859d943f..0c1461fd6ea 100644 --- a/build.sbt +++ b/build.sbt @@ -58,11 +58,13 @@ lazy val root = Project( // We currently expect the java documentation at akka-http/target/javaunidoc, so // the following heuristic is hopefully good enough to determine which one is the Java and // which one the Scala version. + + // This will fail with a MatchError when -Dakka.genjavadoc.enabled is not set val (Seq(java), Seq(scala)) = unidocArtifacts.partition(_.getName contains "java") Seq( - scala -> s"www/api/akka-http/${version.value}", - java -> s"www/japi/akka-http/${version.value}") + scala -> gustavDir("api").value, + java -> gustavDir("japi").value) } ) .aggregate( @@ -173,6 +175,13 @@ lazy val http = project("akka-http") .settings(scalaMacroSupport) .enablePlugins(BootstrapGenjavadoc, BoilerplatePlugin) +def gustavDir(kind: String) = Def.task { + val ver = + if (isSnapshot.value) "snapshot" + else version.value + s"www/$kind/akka-http/$ver" +} + lazy val http2Support = project("akka-http2-support") .settings(commonSettings) .settings(AutomaticModuleName.settings("akka.http.http2")) @@ -366,7 +375,7 @@ lazy val docs = project("docs") apidocRootPackage := "akka", Formatting.docFormatSettings, additionalTasks in ValidatePR += paradox in Compile, - deployRsyncArtifact := List((paradox in Compile).value -> s"www/docs/akka-http/${version.value}"), + deployRsyncArtifact := List((paradox in Compile).value -> gustavDir("docs").value), add212CrossDirs(Test) ) .settings(ParadoxSupport.paradoxWithCustomDirectives)