Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 43 additions & 11 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Dependencies._
import Dependencies.AkkaServerless

lazy val `akkaserverless-java-sdk` = project
.in(file("."))
Expand Down Expand Up @@ -96,7 +96,13 @@ lazy val sdkScala = project
Test / javacOptions += "-parameters", // for Jackson
Test / akkaGrpcGeneratedSources := Seq(AkkaGrpc.Client),
Test / PB.protoSources ++= (Compile / PB.protoSources).value,
Test / PB.targets += PB.gens.java -> crossTarget.value / "akka-grpc" / "test")
Test / PB.targets += PB.gens.java -> crossTarget.value / "akka-grpc" / "test",
inTask(doc)(
Seq(
Compile / scalacOptions ++= scaladocOptions(
"Akka Serverless Scala SDK",
version.value,
(ThisBuild / baseDirectory).value))))
.settings(Dependencies.sdkScala)

lazy val sdkScalaTestKit = project
Expand All @@ -112,9 +118,35 @@ lazy val sdkScalaTestKit = project
"protocolMinorVersion" -> AkkaServerless.ProtocolVersionMinor,
"scalaVersion" -> scalaVersion.value),
buildInfoPackage := "com.akkaserverless.scalasdk.testkit",
Compile / scalacOptions ++= Seq("-release", "8"))
Compile / scalacOptions ++= Seq("-release", "8"),
inTask(doc)(
Seq(
Compile / scalacOptions ++= scaladocOptions(
"Akka Serverless Scala SDK TestKit",
version.value,
(ThisBuild / baseDirectory).value))))
.settings(Dependencies.sdkScalaTestKit)

def scaladocOptions(title: String, ver: String, base: File): List[String] = {
val urlString = githubUrl(ver) + "/€{FILE_PATH_EXT}#L€{FILE_LINE}"
List(
"-implicits",
"-groups",
"-doc-source-url",
urlString,
"-sourcepath",
base.getAbsolutePath,
"-doc-title",
title,
"-doc-version",
ver)
}

def githubUrl(v: String): String = {
val branch = if (v.endsWith("SNAPSHOT")) "main" else "v" + v
"https://github.com/lightbend/akkaserverless-java-sdk/tree/" + branch
}

lazy val sdkJavaTestKit = project
.in(file("testkit-java"))
.dependsOn(sdkJava)
Expand Down Expand Up @@ -199,10 +231,10 @@ lazy val javaValueentityCustomerRegistry = project
.settings(
name := "java-valueentity-customer-registry",
libraryDependencies ++= Seq(
"ch.qos.logback" % "logback-classic" % LogbackVersion,
"ch.qos.logback.contrib" % "logback-json-classic" % LogbackContribVersion,
"ch.qos.logback.contrib" % "logback-jackson" % LogbackContribVersion,
"org.junit.jupiter" % "junit-jupiter" % JUnitJupiterVersion % IntegrationTest,
"ch.qos.logback" % "logback-classic" % Dependencies.LogbackVersion,
"ch.qos.logback.contrib" % "logback-json-classic" % Dependencies.LogbackContribVersion,
"ch.qos.logback.contrib" % "logback-jackson" % Dependencies.LogbackContribVersion,
"org.junit.jupiter" % "junit-jupiter" % Dependencies.JUnitJupiterVersion % IntegrationTest,
"net.aichler" % "jupiter-interface" % JupiterKeys.jupiterVersion.value % IntegrationTest),
Compile / akkaGrpcGeneratedLanguages := Seq(AkkaGrpc.Java),
Compile / javacOptions ++= Seq("-encoding", "UTF-8", "-source", "11", "-target", "11"),
Expand All @@ -218,10 +250,10 @@ lazy val javaEventsourcedCustomerRegistry = project
.settings(
name := "java-eventsourced-customer-registry",
libraryDependencies ++= Seq(
"ch.qos.logback" % "logback-classic" % LogbackVersion,
"ch.qos.logback.contrib" % "logback-json-classic" % LogbackContribVersion,
"ch.qos.logback.contrib" % "logback-jackson" % LogbackContribVersion,
"org.junit.jupiter" % "junit-jupiter" % JUnitJupiterVersion % IntegrationTest,
"ch.qos.logback" % "logback-classic" % Dependencies.LogbackVersion,
"ch.qos.logback.contrib" % "logback-json-classic" % Dependencies.LogbackContribVersion,
"ch.qos.logback.contrib" % "logback-jackson" % Dependencies.LogbackContribVersion,
"org.junit.jupiter" % "junit-jupiter" % Dependencies.JUnitJupiterVersion % IntegrationTest,
"net.aichler" % "jupiter-interface" % JupiterKeys.jupiterVersion.value % IntegrationTest),
Compile / akkaGrpcGeneratedLanguages := Seq(AkkaGrpc.Java),
Compile / javacOptions ++= Seq("-encoding", "UTF-8", "-source", "11", "-target", "11"),
Expand Down
6 changes: 5 additions & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,15 @@ attributes:
>> "${managed_partials}/attributes.adoc"

apidocs:
mkdir -p "${managed_attachments}"
cd .. && sbt sdkJava/doc
cd .. && sbt sdkJavaTestKit/doc
mkdir -p "${managed_attachments}"
rsync -a ../sdk/java-sdk/target/api/ "${managed_attachments}/api/"
rsync -a ../testkit-java/target/api/ "${managed_attachments}/testkit/"
cd .. && sbt sdkScala/doc
cd .. && sbt sdkScalaTestKit/doc
rsync -a ../sdk/scala-sdk/target/scala-2.13/api/ "${managed_attachments}/scala-api/"
rsync -a ../sdk/scala-sdk-testkit/target/scala-2.13/api/ "${managed_attachments}/scala-testkit-api/"

examples:
mkdir -p "${managed_examples}"
Expand Down
8 changes: 7 additions & 1 deletion docs/src/modules/java/pages/api.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,10 @@

include::ROOT:partial$include.adoc[]

The Java API docs can be found link:{attachmentsdir}/api/index.html[here {tab-icon}, window="new"].
API documentation:

* link:{attachmentsdir}/api/index.html[Java SDK {tab-icon}, window="new"]
* link:{attachmentsdir}/testkit/index.html[Java SDK TestKit {tab-icon}, window="new"]
* link:{attachmentsdir}/scala-api/index.html[Scala SDK {tab-icon}, window="new"]
* link:{attachmentsdir}/scala-testkit-api/index.html[Scala SDK TestKit {tab-icon}, window="new"]