Skip to content

Commit

Permalink
docs: add dokka setup for Kotlin API docs
Browse files Browse the repository at this point in the history
  • Loading branch information
thunderbiscuit committed Jan 23, 2025
1 parent 971f2f1 commit 04279c0
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 2 deletions.
3 changes: 2 additions & 1 deletion bdk-android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ plugins {
id("org.gradle.maven-publish")
id("org.gradle.signing")
id("io.github.gradle-nexus.publish-plugin").version("1.1.0").apply(true)
id("org.jetbrains.dokka").version("1.9.0").apply(false)
id("org.jetbrains.dokka").version("2.0.0").apply(false)
id("org.jetbrains.dokka-javadoc").version("2.0.0").apply(false)
}

// library version is defined in gradle.properties
Expand Down
1 change: 1 addition & 0 deletions bdk-android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ android.useAndroidX=true
android.enableJetifier=true
kotlin.code.style=official
libraryVersion=1.0.0-beta.7-SNAPSHOT
org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
3 changes: 3 additions & 0 deletions bdk-android/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ test:

test-specific TEST:
./gradlew test --tests {{TEST}}

build-docs:
./gradlew :lib:dokkaGeneratePublicationHtml
11 changes: 11 additions & 0 deletions bdk-android/lib/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Module bdk-android

The [bitcoindevkit](https://bitcoindevkit.org/) language bindings library for Kotlin on the JVM.

# Package org.bitcoindevkit

The types coming from BDK directly. The functionality exposed in this package is in fact a combination of the [bdk_wallet](https://crates.io/crates/bdk_wallet), [bdk_core](https://crates.io/crates/bdk_core), [bdk_electrum](https://crates.io/crates/bdk_electrum), and [bdk_esplora](https://crates.io/crates/bdk_esplora) crates.

# Package org.rustbitcoin.bitcoin

The types exposed from the [rust-bitcoin](https://crates.io/crates/bitcoin) library.
19 changes: 19 additions & 0 deletions bdk-android/lib/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ plugins {
id("org.gradle.maven-publish")
id("org.gradle.signing")
id("org.jetbrains.dokka")
id("org.jetbrains.dokka-javadoc")
}

android {
Expand Down Expand Up @@ -116,3 +117,21 @@ signing {
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
sign(publishing.publications)
}

dokka {
moduleName.set("bdk-android")
moduleVersion.set(libraryVersion)
dokkaSourceSets.main {
includes.from("README.md")
sourceLink {
localDirectory.set(file("src/main/kotlin"))
remoteUrl("https://bitcoindevkit.org/")
remoteLineSuffix.set("#L")
}
}
pluginsConfiguration.html {
// customStyleSheets.from("styles.css")
// customAssets.from("logo.svg")
footerMessage.set("(c) Bitcoin Dev Kit Developers")
}
}
3 changes: 2 additions & 1 deletion bdk-jvm/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ plugins {
id("org.gradle.maven-publish")
id("org.gradle.signing")
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
id("org.jetbrains.dokka").version("1.9.0").apply(false)
id("org.jetbrains.dokka").version("2.0.0").apply(false)
id("org.jetbrains.dokka-javadoc").version("2.0.0").apply(false)
}

// library version is defined in gradle.properties
Expand Down
1 change: 1 addition & 0 deletions bdk-jvm/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ org.gradle.jvmargs=-Xmx1536m
android.enableJetifier=true
kotlin.code.style=official
libraryVersion=1.0.0-beta.7-SNAPSHOT
org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
3 changes: 3 additions & 0 deletions bdk-jvm/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@ test-offline:

test-specific TEST:
./gradlew test --tests {{TEST}}

build-docs:
./gradlew :lib:dokkaGeneratePublicationHtml
11 changes: 11 additions & 0 deletions bdk-jvm/lib/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Module bdk-jvm

The [bitcoindevkit](https://bitcoindevkit.org/) language bindings library for Kotlin on the JVM.

# Package org.bitcoindevkit

The types coming from BDK directly. The functionality exposed in this package is in fact a combination of the [bdk_wallet](https://crates.io/crates/bdk_wallet), [bdk_core](https://crates.io/crates/bdk_core), [bdk_electrum](https://crates.io/crates/bdk_electrum), and [bdk_esplora](https://crates.io/crates/bdk_esplora) crates.

# Package org.rustbitcoin.bitcoin

The types exposed from the [rust-bitcoin](https://crates.io/crates/bitcoin) library.
19 changes: 19 additions & 0 deletions bdk-jvm/lib/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ plugins {
id("org.gradle.maven-publish")
id("org.gradle.signing")
id("org.jetbrains.dokka")
id("org.jetbrains.dokka-javadoc")
}

java {
Expand Down Expand Up @@ -124,3 +125,21 @@ signing {
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
sign(publishing.publications)
}

dokka {
moduleName.set("bdk-jvm")
moduleVersion.set(libraryVersion)
dokkaSourceSets.main {
includes.from("README.md")
sourceLink {
localDirectory.set(file("src/main/kotlin"))
remoteUrl("https://bitcoindevkit.org/")
remoteLineSuffix.set("#L")
}
}
pluginsConfiguration.html {
// customStyleSheets.from("styles.css")
// customAssets.from("logo.svg")
footerMessage.set("(c) Bitcoin Dev Kit Developers")
}
}

0 comments on commit 04279c0

Please sign in to comment.