Skip to content

feat(kotlin-sdk): add maven-publish for the release AAR#4045

Open
bfoss765 wants to merge 1 commit into
dashpay:feat/kotlin-sdk-and-example-appfrom
bfoss765:feat/kotlin-sdk-maven-publish
Open

feat(kotlin-sdk): add maven-publish for the release AAR#4045
bfoss765 wants to merge 1 commit into
dashpay:feat/kotlin-sdk-and-example-appfrom
bfoss765:feat/kotlin-sdk-maven-publish

Conversation

@bfoss765

@bfoss765 bfoss765 commented Jul 8, 2026

Copy link
Copy Markdown

Adds maven-publish to the Kotlin SDK library so consumers can depend on a Maven coordinate instead of a GitHub-release AAR.

  • Coordinates: org.dashfoundation:dash-sdk-android (version via -PsdkVersion=x.y.z, defaults to 0.1.0-SNAPSHOT)
  • Publishes the release AAR + sources jar + POM (Room/DataStore/Biometric api deps carried in the POM)
  • ./gradlew :sdk:publishToMavenLocal verified end-to-end: with ../build_android.sh run first, the published AAR packages libdash_sdk_jni.so for arm64-v8a and x86_64, and the Dash Android wallet consumes it from mavenLocal alongside dashj with no class conflicts (see Remove CoinJoin mixing; begin Kotlin SDK migration (Phases 1, 2, 0 prep + Phase 3 start) dash-wallet#1507)
  • A remote repositories {} block is intentionally left out pending a hosting decision (Maven Central vs GitHub Packages)

Context: Phase 0 of the Android wallet's dashj → Kotlin SDK migration.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Added publishing support for the Kotlin SDK, including versioning and package metadata.
    • Enabled generation of a sources archive and prepared release artifacts for distribution.

Publishes org.dashfoundation:dash-sdk-android with sources jar and POM
(Room/DataStore/Biometric api deps carried). publishToMavenLocal works today;
a remote repository block can be added when a hosting decision is made.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@bfoss765 bfoss765 requested a review from QuantumExplorer as a code owner July 8, 2026 17:27
@thepastaclaw

thepastaclaw commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

✅ Review complete (commit b27971b)

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The Kotlin SDK's build.gradle.kts is updated to enable Maven publishing. It applies the maven-publish plugin, sets group/version from the sdkVersion property, configures Android release-variant publishing with a sources JAR, and defines a Maven publication with POM metadata (name, description, URL, MIT license).

Changes

Maven Publishing Configuration

Layer / File(s) Summary
Publishing plugin, versioning, and Android variant configuration
packages/kotlin-sdk/sdk/build.gradle.kts
Adds the maven-publish plugin, sets group/version from sdkVersion (defaulting to 0.1.0-SNAPSHOT), and configures Android publishing to include the release variant with a sources JAR.
Maven publication and POM metadata
packages/kotlin-sdk/sdk/build.gradle.kts
Adds an afterEvaluate block creating a "release" publication from components["release"], setting groupId/artifactId, and configuring POM name, description, URL, and MIT license.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding Maven publishing for the release AAR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@thepastaclaw

Copy link
Copy Markdown
Collaborator

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
packages/kotlin-sdk/sdk/build.gradle.kts (1)

96-125: 📐 Maintainability & Code Quality | 🔵 Trivial

Add POM scm and developers sections before publishing to a remote repository.

The POM includes name, description, URL, and license — sufficient for publishToMavenLocal. Maven Central and most remote repositories also require scm and developers sections for validation. Since remote publication is intentionally deferred, these can be added when a hosting decision is made.

📋 POM additions for future remote publication
pom {
    name.set("Dash Platform Kotlin SDK")
    description.set(
        "Kotlin SDK for Dash Core (L1 SPV) and Dash Platform " +
            "(identities, DPNS, DashPay, shielded balances)"
    )
    url.set("https://github.com/dashpay/platform")
    licenses {
        license {
            name.set("MIT License")
            url.set("https://github.com/dashpay/platform/blob/master/LICENSE")
        }
    }
+   scm {
+       url.set("https://github.com/dashpay/platform")
+       connection.set("scm:git:git://github.com/dashpay/platform.git")
+       developerConnection.set("scm:git:ssh://git@github.com/dashpay/platform.git")
+   }
+   developers {
+       developer {
+           id.set("dashfoundation")
+           name.set("Dash Foundation")
+           url.set("https://dashfoundation.org")
+       }
+   }
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/kotlin-sdk/sdk/build.gradle.kts` around lines 96 - 125, The release
publication in the `MavenPublication` block under `afterEvaluate { publishing {
publications { create<MavenPublication>("release") { pom { ... } } } } }` is
missing remote-repository metadata; add `scm` and `developers` entries alongside
the existing `name`, `description`, `url`, and `licenses` fields so the POM is
ready for remote publication validation when needed.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/kotlin-sdk/sdk/build.gradle.kts`:
- Around line 96-125: The release publication in the `MavenPublication` block
under `afterEvaluate { publishing { publications {
create<MavenPublication>("release") { pom { ... } } } } }` is missing
remote-repository metadata; add `scm` and `developers` entries alongside the
existing `name`, `description`, `url`, and `licenses` fields so the POM is ready
for remote publication validation when needed.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 92a8426b-9585-4d78-a00d-d2bc13bdb215

📥 Commits

Reviewing files that changed from the base of the PR and between c17f582 and b27971b.

📒 Files selected for processing (1)
  • packages/kotlin-sdk/sdk/build.gradle.kts

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The PR adds Maven publication for the Kotlin SDK release AAR, but the resulting coordinate is not reliably consumable from a clean checkout. The publication can succeed without packaging the required JNI library, and the published compile API omits coroutines even though public SDK types expose Flow/StateFlow.

Source: reviewers: opus/claude general failed (quota), gpt-5.5/codex general completed; verifier: gpt-5.5/codex; specialists: none.

🔴 2 blocking

1 additional finding(s) omitted (not in diff).

🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.

In `packages/kotlin-sdk/sdk/build.gradle.kts`:
- [BLOCKING] packages/kotlin-sdk/sdk/build.gradle.kts:104-105: Publishing can create an AAR without the JNI library
  The release publication is created directly from the Android release component, but there is no Gradle task dependency or validation that builds `sdk/src/main/jniLibs/<abi>/libdash_sdk_jni.so` first. That directory is gitignored and absent in a clean checkout; the repo docs and build script show it is produced only by `packages/kotlin-sdk/build_android.sh`. Because `NativeLoader.ensureLoaded()` calls `System.loadLibrary("dash_sdk_jni")`, publishing from a clean tree can produce a Maven coordinate that installs successfully but fails at runtime with `UnsatisfiedLinkError`. The publish path should either depend on the native build or fail fast when the expected ABI libraries are missing.
- [BLOCKING] packages/kotlin-sdk/sdk/build.gradle.kts:72: Coroutines core is missing from the published compile API
  `kotlinx-coroutines-core` is declared as an `implementation` dependency, so the published component does not expose it on consumers' compile classpaths. The SDK's public API returns coroutines types such as `Flow`, `StateFlow`, and `SharedFlow` from classes including `DataManager`, `ShieldedService`, `WalletManagerStore`, and `PlatformWalletManager`. A consumer depending only on `org.dashfoundation:dash-sdk-android` can therefore fail to compile unless it independently declares coroutines. Since this PR makes the SDK consumable through a Maven coordinate, public API dependencies need to be published as `api` dependencies.

Comment on lines +104 to +105
create<MavenPublication>("release") {
from(components["release"])

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Blocking: Publishing can create an AAR without the JNI library

The release publication is created directly from the Android release component, but there is no Gradle task dependency or validation that builds sdk/src/main/jniLibs/<abi>/libdash_sdk_jni.so first. That directory is gitignored and absent in a clean checkout; the repo docs and build script show it is produced only by packages/kotlin-sdk/build_android.sh. Because NativeLoader.ensureLoaded() calls System.loadLibrary("dash_sdk_jni"), publishing from a clean tree can produce a Maven coordinate that installs successfully but fails at runtime with UnsatisfiedLinkError. The publish path should either depend on the native build or fail fast when the expected ABI libraries are missing.

source: ['codex']

@HashEngineering HashEngineering Jul 8, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed, we will need to integrate building of the JNI libs into the gradle build system. It can be done by running the build_android.sh script from the grade script or using CMake. There could be other better ways.

@HashEngineering HashEngineering left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comments left regarding future changes to support publishing to Maven Central.

`maven-publish`
}

group = "org.dashfoundation"

@HashEngineering HashEngineering Jul 8, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one issue with this name is that http://dashfoundation.org is owned by someone else. To get our artifacts published on Maven Central, we need to own the domain that goes with this group id.

We currently own dashj.org and are publishing there all of our legacy platform and core related SDK libraries. This may not be ideal for this new SDK.

@HashEngineering HashEngineering Jul 8, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good for now, but still requires a local build process to put the Kotlin SDK libraries into the local Maven Repository. It does not allow for publishing to Maven Central, where everyone who wants to build an app that consumes the Kotlin SDK can access it without cloning this repo and building the Kotlin SDK.

Recently, on Android, we have had two outside contributors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants