diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index fc0d7ff8..563004f2 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.45.0"
+ ".": "0.46.0"
}
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a76c58d1..6d536f76 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,18 @@
# Changelog
+## 0.46.0 (2025-03-07)
+
+Full Changelog: [v0.45.0...v0.46.0](https://github.com/orbcorp/orb-java/compare/v0.45.0...v0.46.0)
+
+### Features
+
+* generate and publish docs ([#320](https://github.com/orbcorp/orb-java/issues/320)) ([44c1bcd](https://github.com/orbcorp/orb-java/commit/44c1bcdd24a8a5500c32b4a21376a2a3a110555c))
+
+
+### Bug Fixes
+
+* compilation error ([a4cfad1](https://github.com/orbcorp/orb-java/commit/a4cfad1e038849dcf0c81888d1acd9401cc28073))
+
## 0.45.0 (2025-03-07)
Full Changelog: [v0.44.0...v0.45.0](https://github.com/orbcorp/orb-java/compare/v0.44.0...v0.45.0)
diff --git a/README.md b/README.md
index 625b2010..77d4d1f5 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,8 @@
-[](https://central.sonatype.com/artifact/com.withorb.api/orb-java/0.45.0)
+[](https://central.sonatype.com/artifact/com.withorb.api/orb-java/0.46.0)
+[](https://javadoc.io/doc/com.withorb.api/orb-java/0.46.0)
@@ -10,7 +11,7 @@ The Orb Java SDK provides convenient access to the Orb REST API from application
The Orb Java SDK is similar to the Orb Kotlin SDK but with minor differences that make it more ergonomic for use in Java, such as `Optional` instead of nullable values, `Stream` instead of `Sequence`, and `CompletableFuture` instead of suspend functions.
-The REST API documentation can be found on [docs.withorb.com](https://docs.withorb.com/reference/api-reference).
+The REST API documentation can be found on [docs.withorb.com](https://docs.withorb.com/reference/api-reference). Javadocs are also available on [javadoc.io](https://javadoc.io/doc/com.withorb.api/orb-java/0.45.0).
## Installation
@@ -19,7 +20,7 @@ The REST API documentation can be found on [docs.withorb.com](https://docs.witho
### Gradle
```kotlin
-implementation("com.withorb.api:orb-java:0.45.0")
+implementation("com.withorb.api:orb-java:0.46.0")
```
### Maven
@@ -28,7 +29,7 @@ implementation("com.withorb.api:orb-java:0.45.0")
com.withorb.api
orb-java
- 0.45.0
+ 0.46.0
```
diff --git a/build.gradle.kts b/build.gradle.kts
index 1629af51..61ab6577 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,4 +1,23 @@
+plugins {
+ id("org.jetbrains.dokka") version "2.0.0"
+}
+
+repositories {
+ mavenCentral()
+}
+
allprojects {
group = "com.withorb.api"
- version = "0.45.0" // x-release-please-version
+ version = "0.46.0" // x-release-please-version
+}
+
+subprojects {
+ apply(plugin = "org.jetbrains.dokka")
+}
+
+// Avoid race conditions between `dokkaJavadocCollector` and `dokkaJavadocJar` tasks
+tasks.named("dokkaJavadocCollector").configure {
+ subprojects.flatMap { it.tasks }
+ .filter { it.project.name != "orb-java" && it.name == "dokkaJavadocJar" }
+ .forEach { mustRunAfter(it) }
}
diff --git a/buildSrc/src/main/kotlin/orb.publish.gradle.kts b/buildSrc/src/main/kotlin/orb.publish.gradle.kts
index 134e81fe..2f9d4b55 100644
--- a/buildSrc/src/main/kotlin/orb.publish.gradle.kts
+++ b/buildSrc/src/main/kotlin/orb.publish.gradle.kts
@@ -1,3 +1,5 @@
+import com.vanniktech.maven.publish.JavadocJar
+import com.vanniktech.maven.publish.KotlinJvm
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import com.vanniktech.maven.publish.SonatypeHost
@@ -19,6 +21,12 @@ configure {
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
coordinates(project.group.toString(), project.name, project.version.toString())
+ configure(
+ KotlinJvm(
+ javadocJar = JavadocJar.Dokka("dokkaJavadoc"),
+ sourcesJar = true,
+ )
+ )
pom {
name.set("API Reference")
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/WebhookServiceImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/WebhookServiceImpl.kt
index 8693aa72..aeed4f06 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/WebhookServiceImpl.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/WebhookServiceImpl.kt
@@ -16,6 +16,7 @@ import java.time.ZoneOffset
import java.util.*
import javax.crypto.Mac
import javax.crypto.spec.SecretKeySpec
+import kotlin.jvm.optionals.getOrNull
private const val SIGNATURE_HEADER = "X-Orb-Signature"
private const val TIMESTAMP_HEADER = "X-Orb-Timestamp"
@@ -40,7 +41,7 @@ class WebhookServiceImpl constructor(private val clientOptions: ClientOptions) :
override fun verifySignature(payload: String, headers: Headers, secret: String?) {
val webhookSecret =
secret
- ?: clientOptions.webhookSecret
+ ?: clientOptions.webhookSecret().getOrNull()
?: throw OrbException(
"The webhook secret must either be set using the env var, ORB_WEBHOOK_SECRET, on the client class, or passed to this method"
)
diff --git a/orb-java/build.gradle.kts b/orb-java/build.gradle.kts
index 330a2be0..4393c00c 100644
--- a/orb-java/build.gradle.kts
+++ b/orb-java/build.gradle.kts
@@ -6,3 +6,24 @@ plugins {
dependencies {
api(project(":orb-java-client-okhttp"))
}
+
+// Redefine `dokkaJavadoc` to:
+// - Depend on the root project's task for merging the docs of all the projects
+// - Forward that task's output to this task's output
+tasks.named("dokkaJavadoc").configure {
+ actions.clear()
+
+ val dokkaJavadocCollector = rootProject.tasks["dokkaJavadocCollector"]
+ dependsOn(dokkaJavadocCollector)
+
+ val outputDirectory = project.layout.buildDirectory.dir("dokka/javadoc")
+ doLast {
+ copy {
+ from(dokkaJavadocCollector.outputs.files)
+ into(outputDirectory)
+ duplicatesStrategy = DuplicatesStrategy.INCLUDE
+ }
+ }
+
+ outputs.dir(outputDirectory)
+}