diff --git a/.github/workflows/bound-ci-kt.yml b/.github/workflows/bound-ci-kt.yml
deleted file mode 100644
index 800169fa..00000000
--- a/.github/workflows/bound-ci-kt.yml
+++ /dev/null
@@ -1,75 +0,0 @@
-name: Kotlin CI
-
-on:
- push:
- branches:
- - main
- pull_request:
-
-jobs:
- aarch64-apple-darwin:
- runs-on: macos-latest
- name: Load shared library on aarch64-apple-darwin target
- steps:
- - uses: actions/checkout@v2
- - name: Set up JDK 11
- uses: actions/setup-java@v3
- with:
- distribution: 'adopt'
- java-version: '11'
- - name: Run tests
- run: |
- cd bound/kt
- mvn '-Dtest=SystemTargetTest#can load shared library' test
-
- x86_64-apple-darwin:
- runs-on: macos-12
- name: Load shared library on x86_64-apple-darwin target
- steps:
- - uses: actions/checkout@v2
- - name: Set up JDK 11
- uses: actions/setup-java@v3
- with:
- distribution: 'adopt'
- java-version: '11'
- - name: Run tests
- run: |
- cd bound/kt
- mvn '-Dtest=SystemTargetTest#can load shared library' test
-
- x86_64-unknown-linux-gnu:
- runs-on: ubuntu-latest
- name: Load shared library on x86_64-unknown-linux-gnu target
- steps:
- - uses: actions/checkout@v2
- - name: Set up JDK 11
- uses: actions/setup-java@v3
- with:
- distribution: 'adopt'
- java-version: '11'
- - name: Run tests
- run: |
- cd bound/kt
- mvn '-Dtest=SystemTargetTest#can load shared library' test
-
- x86_64-unknown-linux-musl:
- runs-on: ubuntu-latest
- container:
- image: alpine:latest
- name: Load shared library on x86_64-unknown-linux-musl target
- steps:
- - uses: actions/checkout@v2
- - name: Install dependencies
- run: |
- apk update
- apk add openjdk11
- apk add maven
- apk add bash
- - name: Set JAVA_HOME
- run: |
- export JAVA_HOME=/usr/lib/jvm/java-11-openjdk
- export PATH=$JAVA_HOME/bin:$PATH
- - name: Change directory to bound/kt and run tests
- run: |
- cd bound/kt
- mvn '-Dtest=SystemTargetTest#can load shared library' test
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index e504e1bf..a752ff74 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,6 +1,18 @@
name: CI
on:
+ workflow_dispatch:
+ inputs:
+ version:
+ description: 'Version of Kotlin binary to publish to TBD Artifactory. For example "1.0.0" will result in "1.0.0-SNAPSHOT". If not supplied, will default to "commit-$shortSHA-SNAPSHOT" where $shortSHA is the shortform commit SHA.'
+ required: false
+ default: "0.0.0-SNAPSHOT"
+ workflow_call:
+ inputs:
+ version:
+ description: 'Version of Kotlin binary to publish to TBD Artifactory. For example "1.0.0" will result in "1.0.0-SNAPSHOT". If not supplied, will default to "commit-$shortSHA-SNAPSHOT" where $shortSHA is the shortform commit SHA.'
+ required: true
+ type: string
push:
branches:
- main
@@ -10,9 +22,10 @@ env:
CARGO_TERM_COLOR: always
# Make sure CI fails on all warnings, including Clippy lints
RUSTFLAGS: "-Dwarnings"
+ WEB5_SDK_LOG_LEVEL: debug
jobs:
- build:
+ lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@@ -20,39 +33,182 @@ jobs:
uses: cashapp/activate-hermit@v1
with:
cache: true
- - name: Setup
- run: just setup
- - name: Build
- run: just build
+ - name: Lint
+ run: just lint
+
test:
strategy:
matrix:
- os: [ ubuntu-latest, macos-latest ] # TODO add back windows-latest https://github.com/TBD54566975/web5-rs/issues/189
- rust: [ stable, nightly ]
+ os: [ubuntu-latest, macos-latest] # TODO add back windows-latest https://github.com/TBD54566975/web5-rs/issues/189
+ rust: [stable, nightly]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
- submodules: true
+ submodules: true
- name: Init Hermit
uses: cashapp/activate-hermit@v1
with:
cache: true
- - name: Setup
- run: just setup
- name: Test
run: just test
- lint:
+
+ build_aarch64_apple_darwin:
+ runs-on: macos-latest
+ name: Build aarch64-apple-darwin target
+ steps:
+ - uses: actions/checkout@v2
+ - name: Install Rust
+ run: rustup toolchain install stable
+ - name: Run Build Script
+ run: |
+ cd bindings/web5_uniffi/libtargets/aarch64_apple_darwin
+ ./build
+ - name: Upload .dylib
+ uses: actions/upload-artifact@v4.0.0
+ with:
+ name: aarch64-apple-darwin-dylib
+ path: bound/kt/src/main/resources/libweb5_uniffi_aarch64_apple_darwin.dylib
+
+ build_x86_64_apple_darwin:
+ runs-on: macos-12
+ name: Build x86_64-apple-darwin target
+ steps:
+ - uses: actions/checkout@v2
+ - name: Install Rust
+ run: rustup toolchain install stable
+ - name: Run Build Script
+ run: |
+ cd bindings/web5_uniffi/libtargets/x86_64_apple_darwin
+ ./build
+ - name: Upload .dylib
+ uses: actions/upload-artifact@v4.0.0
+ with:
+ name: x86_64-apple-darwin-dylib
+ path: bound/kt/src/main/resources/libweb5_uniffi_x86_64_apple_darwin.dylib
+
+ build_x86_64_unknown_linux_gnu:
+ runs-on: ubuntu-latest
+ name: Build x86_64-unknown-linux-gnu target
+ steps:
+ - uses: actions/checkout@v2
+ - name: Run Build Script
+ run: |
+ cd bindings/web5_uniffi/libtargets/x86_64_unknown_linux_gnu
+ ./build
+ - name: Upload .so
+ uses: actions/upload-artifact@v4.0.0
+ with:
+ name: x86_64-unknown-linux-gnu-so
+ path: bound/kt/src/main/resources/libweb5_uniffi_x86_64_unknown_linux_gnu.so
+
+ build_x86_64_unknown_linux_musl:
+ runs-on: ubuntu-latest
+ name: Build x86_64-unknown-linux-musl target
+ steps:
+ - uses: actions/checkout@v2
+ - name: Run Build Script
+ run: |
+ cd bindings/web5_uniffi/libtargets/x86_64_unknown_linux_musl
+ ./build
+ - name: Upload .so
+ uses: actions/upload-artifact@v4.0.0
+ with:
+ name: x86_64-unknown-linux-musl-so
+ path: bound/kt/src/main/resources/libweb5_uniffi_x86_64_unknown_linux_musl.so
+
+ kotlin-build-test-deploy-snapshot:
+ needs:
+ - build_aarch64_apple_darwin
+ - build_x86_64_apple_darwin
+ - build_x86_64_unknown_linux_gnu
+ - build_x86_64_unknown_linux_musl
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- - name: Init Hermit
- uses: cashapp/activate-hermit@v1
with:
- cache: true
- - name: Setup
- run: just setup
- - name: Formatting
- run: cargo fmt --check
- - name: Lint
- run: just lint
+ submodules: true
+ - name: Set up JDK 11
+ uses: actions/setup-java@v3
+ with:
+ distribution: "adopt"
+ java-version: "11"
+
+ # Cache Maven repo
+ - uses: actions/cache@v3
+ with:
+ path: ~/.m2/repository
+ key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+ restore-keys: |
+ ${{ runner.os }}-maven-
+
+ - name: Resolve Snapshot Version
+ id: resolve_version
+ run: |
+ # Version resolution: use provided
+ if [ -n "${{ github.event.inputs.version }}" ]; then
+ if [[ "${{ github.event.inputs.version }}" != *-SNAPSHOT ]]; then
+ resolvedVersion="${{ github.event.inputs.version }}-SNAPSHOT"
+ else
+ resolvedVersion="${{ github.event.inputs.version }}"
+ fi
+ # Otherwise, construct a version for deployment in form X.Y.Z-commit-$shortSHA-SNAPSHOT
+ else
+ longSHA=$(git rev-parse --verify HEAD)
+ shortSHA=$(echo "${longSHA:0:7}")
+ resolvedVersion="commit-$shortSHA-SNAPSHOT"
+ echo "Requesting deployment as version: $resolvedVersion"
+ fi
+
+ echo "Resolved SNAPSHOT Version: $resolvedVersion"
+ echo "resolved_version=$resolvedVersion" >> $GITHUB_OUTPUT
+
+ # Package up the native binaries
+ #TODO Centralize this block as we re-use it via copy/paste right now
+ - name: Download MacOS aarch64 Native Library
+ uses: actions/download-artifact@v4.0.0
+ with:
+ name: aarch64-apple-darwin-dylib
+ path: bound/kt/src/main/resources/
+ - name: Download MacOS x86_64 Native Library
+ uses: actions/download-artifact@v4.0.0
+ with:
+ name: x86_64-apple-darwin-dylib
+ path: bound/kt/src/main/resources/
+ - name: Download Linux x86_64 GNU Native Library
+ uses: actions/download-artifact@v4.0.0
+ with:
+ name: x86_64-unknown-linux-gnu-so
+ path: bound/kt/src/main/resources/
+ - name: Download Linux x86_64 MUSL Native Library
+ uses: actions/download-artifact@v4.0.0
+ with:
+ name: x86_64-unknown-linux-musl-so
+ path: bound/kt/src/main/resources/
+
+ - name: Deploy Snapshot / Verify
+ run: |
+
+ # cd into the Kotlin project
+ cd bound/kt/
+
+ # Set newly resolved version in POM config
+ mvn \
+ versions:set \
+ --batch-mode \
+ -DnewVersion=${{ steps.resolve_version.outputs.resolved_version }}
+
+ # Only attempt to publish artifact if we have credentials
+ if [ -n "${{ secrets.ARTIFACTORY_PASSWORD }}" ]; then
+ # Maven deploy lifecycle will build, run tests, verify, sign, and deploy
+ mvn deploy --batch-mode --settings .maven_settings.xml -P sign-artifacts
+ else
+ # Otherwise, Maven verify lifecycle will build, run tests, and verify
+ mvn verify --batch-mode
+ fi
+
+ env:
+ ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
+ ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
+ SIGN_KEY_PASS: ${{ secrets.GPG_SECRET_PASSPHRASE }}
+ SIGN_KEY: ${{ secrets.GPG_SECRET_KEY }}
diff --git a/.gitignore b/.gitignore
index 62122979..eb86c4ed 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,3 +17,7 @@ Cargo.lock
.hermit/
.idea/
+
+# Do not put native binaries in source control
+bound/kt/src/main/resources/*.dylib
+bound/kt/src/main/resources/*.so
\ No newline at end of file
diff --git a/CODEOWNERS b/CODEOWNERS
index 852764ce..1e4d694a 100644
--- a/CODEOWNERS
+++ b/CODEOWNERS
@@ -9,7 +9,7 @@
# The format is described: https://github.blog/2017-07-06-introducing-code-owners/
# These owners will be the default owners for everything in the repo.
-* @KendallWeihe @nitro-neal @kirahsapong @shamilovtim @diehuxx @decentralgabe @frankhinek
+* @KendallWeihe @nitro-neal @kirahsapong @shamilovtim @diehuxx @decentralgabe @frankhinek @leordev @ALRubinger
# -----------------------------------------------
diff --git a/Justfile b/Justfile
index 2b22e572..0f3287be 100644
--- a/Justfile
+++ b/Justfile
@@ -32,6 +32,7 @@ bind-kotlin: setup
generate --library bound/kt/src/main/resources/libweb5_uniffi_aarch64_apple_darwin.dylib \
--language kotlin \
--out-dir target/bindgen-kotlin
+ sed -i '' 's/findLibraryName(componentName)/detectSystemTarget()/' target/bindgen-kotlin/web5/sdk/rust/web5.kt
cp target/bindgen-kotlin/web5/sdk/rust/web5.kt bound/kt/src/main/kotlin/web5/sdk/rust/UniFFI.kt
test-bound: setup
diff --git a/bindings/web5_uniffi/libtargets/aarch64_apple_darwin/build b/bindings/web5_uniffi/libtargets/aarch64_apple_darwin/build
index 97772d29..4b9d7c63 100755
--- a/bindings/web5_uniffi/libtargets/aarch64_apple_darwin/build
+++ b/bindings/web5_uniffi/libtargets/aarch64_apple_darwin/build
@@ -9,6 +9,7 @@ rustup target add aarch64-apple-darwin
(
cd $REPO_DIR;
cargo build --target aarch64-apple-darwin --release --package web5_uniffi;
+ mkdir -p bound/kt/src/main/resources;
cp target/aarch64-apple-darwin/release/libweb5_uniffi.dylib \
bound/kt/src/main/resources/libweb5_uniffi_aarch64_apple_darwin.dylib
)
\ No newline at end of file
diff --git a/bindings/web5_uniffi/libtargets/x86_64_apple_darwin/build b/bindings/web5_uniffi/libtargets/x86_64_apple_darwin/build
index ea6fd337..b9a01839 100755
--- a/bindings/web5_uniffi/libtargets/x86_64_apple_darwin/build
+++ b/bindings/web5_uniffi/libtargets/x86_64_apple_darwin/build
@@ -11,6 +11,7 @@ rustup target add x86_64-apple-darwin
cargo build --target x86_64-apple-darwin --release \
--package web5_uniffi \
--features x86_64_apple_darwin;
+ mkdir -p bound/kt/src/main/resources;
cp target/x86_64-apple-darwin/release/libweb5_uniffi.dylib \
bound/kt/src/main/resources/libweb5_uniffi_x86_64_apple_darwin.dylib
)
\ No newline at end of file
diff --git a/bindings/web5_uniffi/libtargets/x86_64_unknown_linux_gnu/build b/bindings/web5_uniffi/libtargets/x86_64_unknown_linux_gnu/build
index 737ab163..3c7f6906 100755
--- a/bindings/web5_uniffi/libtargets/x86_64_unknown_linux_gnu/build
+++ b/bindings/web5_uniffi/libtargets/x86_64_unknown_linux_gnu/build
@@ -10,6 +10,8 @@ docker build -f $(pwd)/Dockerfile -t $IMAGE_NAME $REPO_DIR
docker run -d --name $CONTAINER_NAME $IMAGE_NAME
+mkdir -p $REPO_DIR/bound/kt/src/main/resources;
+
docker cp $CONTAINER_NAME:/usr/src/myapp/target/release/libweb5_uniffi.so \
$REPO_DIR/bound/kt/src/main/resources/libweb5_uniffi_x86_64_unknown_linux_gnu.so
diff --git a/bindings/web5_uniffi/libtargets/x86_64_unknown_linux_musl/build b/bindings/web5_uniffi/libtargets/x86_64_unknown_linux_musl/build
index 5efe619e..442c1859 100755
--- a/bindings/web5_uniffi/libtargets/x86_64_unknown_linux_musl/build
+++ b/bindings/web5_uniffi/libtargets/x86_64_unknown_linux_musl/build
@@ -10,6 +10,8 @@ docker build -f $(pwd)/Dockerfile -t $IMAGE_NAME $REPO_DIR
docker run -d --name $CONTAINER_NAME $IMAGE_NAME
+mkdir -p $REPO_DIR/bound/kt/src/main/resources;
+
docker cp $CONTAINER_NAME:/usr/src/myapp/target/release/libweb5_uniffi.so \
$REPO_DIR/bound/kt/src/main/resources/libweb5_uniffi_x86_64_unknown_linux_musl.so
diff --git a/bound/kt/.maven_settings.xml b/bound/kt/.maven_settings.xml
new file mode 100644
index 00000000..5316a612
--- /dev/null
+++ b/bound/kt/.maven_settings.xml
@@ -0,0 +1,29 @@
+
+
+
+ github
+ tbd-releases
+ ${env.TBD_RELEASE_GITHUB_PERSONAL_ACCESS_TOKEN}
+
+
+ tbd-oss-releases
+ ${env.ARTIFACTORY_USERNAME}
+ ${env.ARTIFACTORY_PASSWORD}
+
+
+ tbd-oss-snapshots
+ ${env.ARTIFACTORY_USERNAME}
+ ${env.ARTIFACTORY_PASSWORD}
+
+
+ ossrh-snapshots
+ ${env.SONATYPE_USERNAME}
+ ${env.SONATYPE_PASSWORD}
+
+
+ ossrh-releases
+ ${env.SONATYPE_USERNAME}
+ ${env.SONATYPE_PASSWORD}
+
+
+
diff --git a/bound/kt/pom.xml b/bound/kt/pom.xml
index 3dae4668..e1d62dc8 100644
--- a/bound/kt/pom.xml
+++ b/bound/kt/pom.xml
@@ -1,73 +1,524 @@
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+
4.0.0
- web5.sdk.core
- web5-core-kt
- 1.0-SNAPSHOT
+
+ xyz.block
+ web5
+ 0.0.0-main-SNAPSHOT
+ Web5 SDK for the JVM
+ https://developer.tbd.website
+ Web5 SDK for the JVM
+ 2024
+
+
+
+ scm:git:git://github.com/TBD54566975/web5-rs.git
+
+ scm:git:https://github.com/TBD54566975/web5-rs.git
+ https://github.com/TBD54566975/web5-rs
+ HEAD
+
+
+
+
+
+ TBD54566975
+ Block, Inc.
+ releases@tbd.email
+
+
+
+
+
+ github
+ https://github.com/TBD54566975/web5-rs/issues
+
+
+
+
+
+ Apache License, Version 2.0
+ http://www.apache.org/licenses/LICENSE-2.0.txt
+ repo
+
+
+
- 1.9.22
+
+ UTF-8
+
11
- 1.8
- 1.8
+ true
+
+ github
+
+
+
+
+ 1.9.22
+ 0.0.6
+
+
+ 2.17.0
+ 5.12.0
+ 1.8.1
+
+
+ 5.10.1
+
+
+
+
+
+
+
+
+
+ com.fasterxml.jackson.core
+ jackson-annotations
+ ${version.com.fasterxml.jackson}
+
+
+ com.fasterxml.jackson.core
+ jackson-core
+ ${version.com.fasterxml.jackson}
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+ ${version.com.fasterxml.jackson}
+
+
+ com.fasterxml.jackson.dataformat
+ jackson-dataformat-cbor
+ ${version.com.fasterxml.jackson}
+
+
+ com.fasterxml.jackson.dataformat
+ jackson-dataformat-yaml
+ ${version.com.fasterxml.jackson}
+
+
+ com.fasterxml.jackson.module
+ jackson-module-kotlin
+ ${version.com.fasterxml.jackson}
+
+
+
+ net.java.dev.jna
+ jna
+ ${version.net.java.dev.jna}
+
+
+ org.jetbrains.kotlin
+ kotlin-stdlib-jdk8
+ ${version.kotlin}
+
+
+ org.jetbrains.kotlinx
+ kotlinx-coroutines-core
+ ${version.org.jetbrains.kotlinx.kotlinx.coroutines.core}
+
+
+
+
+ org.junit.jupiter
+ junit-jupiter-api
+ ${version.org.junit.jupiter}
+ test
+
+
+ org.junit.jupiter
+ junit-jupiter-engine
+ ${version.org.junit.jupiter}
+ test
+
+
+
+
+
+
+
+
+
- org.jetbrains.kotlin
- kotlin-stdlib-jdk8
- ${kotlin.version}
+ com.fasterxml.jackson.core
+ jackson-databind
+
+
+ com.fasterxml.jackson.module
+ jackson-module-kotlin
net.java.dev.jna
jna
- 5.12.0
org.jetbrains.kotlinx
kotlinx-coroutines-core
- 1.8.0
-
-
- com.fasterxml.jackson.core
- jackson-databind
- 2.17.0
-
-
- com.fasterxml.jackson.core
- jackson-core
- 2.17.0
-
-
- com.fasterxml.jackson.core
- jackson-annotations
- 2.17.0
- com.fasterxml.jackson.module
- jackson-module-kotlin
- 2.17.0
+ org.jetbrains.kotlin
+ kotlin-stdlib-jdk8
org.junit.jupiter
junit-jupiter-api
- 5.10.2
- test
+
src/main/kotlin
src/test/kotlin
+
+
+
+ io.github.martinvisser
+ kover-maven-plugin
+ ${version.io.github.martinvisser}
+
+
+
+
+
+
+
+ maven-clean-plugin
+ 3.1.0
+
+
+
+ maven-resources-plugin
+ 3.0.2
+
+
+ maven-compiler-plugin
+ 3.8.0
+
+
+ org.apache.maven.plugins
+ maven-dependency-plugin
+ 3.1.2
+
+
+ copy-dependencies
+ package
+
+ copy-dependencies
+
+
+ ${project.build.directory}/lib
+ runtime
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-assembly-plugin
+ 3.3.0
+
+
+ jar-with-dependencies
+
+
+
+
+ make-assembly
+ package
+
+ single
+
+
+
+
+
+ maven-surefire-plugin
+ 3.2.5
+
+
+ *Test
+ *Tests
+
+ false
+
+
+
+ maven-jar-plugin
+ 3.0.2
+
+
+
+ true
+
+
+
+
+
+ maven-install-plugin
+ 2.5.2
+
+
+ maven-deploy-plugin
+ 2.8.2
+
+ true
+
+
+
+ org.simplify4u.plugins
+ sign-maven-plugin
+ 1.1.0
+
+
+
+ sign
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+ 3.3.0
+
+
+ attach-sources
+
+ jar
+
+
+
+
+
+ maven-release-plugin
+ 3.0.1
+
+ true
+ true
+ v@{project.version}
+ [TBD Release Manager 🚀]
+ @{prefix} Setting version to: @{releaseLabel}
+ @{prefix} Setting next development version after: @{releaseLabel}
+
+
+
+
+ maven-site-plugin
+ 3.7.1
+
+
+ maven-project-info-reports-plugin
+ 3.0.0
+
+
+ com.github.ozsie
+ detekt-maven-plugin
+ 1.23.5
+
+
+ verify
+
+ check
+
+
+ config/detekt.yml
+
+
+
+
+
+ io.gitlab.arturbosch.detekt
+ detekt-formatting
+ 1.23.5
+
+
+ com.github.TBD54566975
+ tbd-detekt-rules
+ 0.0.2
+
+
+
+
+ io.github.martinvisser
+ kover-maven-plugin
+ ${version.io.github.martinvisser}
+
+
+
+
+
+ 10
+ LINE
+ COVERED_PERCENTAGE
+
+
+ 10
+ BRANCH
+ COVERED_PERCENTAGE
+
+
+
+
+
+ org.codehaus.mojo
+ exec-maven-plugin
+ 3.2.0
+
+
+ org.jetbrains.kotlin
+ kotlin-maven-plugin
+ ${version.kotlin}
+
+
+ compile
+ compile
+
+ compile
+
+
+
+ test-compile
+ test-compile
+
+ test-compile
+
+
+
+
+ ${kotlin.jvm.target}
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-dependency-plugin
+
+
+ org.apache.maven.plugins
+ maven-assembly-plugin
+
+
+ org.apache.maven.plugins
+ maven-release-plugin
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+
+
+ io.github.martinvisser
+ kover-maven-plugin
+
+
+
+ org.jetbrains.dokka
+ dokka-maven-plugin
+ 1.9.20
+
+
+ package
+
+ javadocJar
+
+
+
+
org.jetbrains.kotlin
kotlin-maven-plugin
- ${kotlin.version}
compile
@@ -88,24 +539,107 @@
${kotlin.jvm.target}
-
- org.apache.maven.plugins
- maven-compiler-plugin
-
-
- 9
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
- 3.2.5
-
-
- *Test
-
-
-
+
+
+
+ sign-artifacts
+
+
+
+ org.simplify4u.plugins
+ sign-maven-plugin
+
+
+
+
+
+
+ ossrh
+
+
+
+ org.sonatype.plugins
+ nexus-staging-maven-plugin
+ 1.6.13
+ true
+
+ ossrh-releases
+ https://s01.oss.sonatype.org/
+ true
+
+
+
+
+
+
+ ossrh-snapshots
+ https://s01.oss.sonatype.org/content/repositories/snapshots
+
+
+
+ ossrh-releases
+ https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/
+
+
+
+
+
+
+
+ false
+ tbd-oss-releases
+ TBD OSS Releases Repository
+ https://blockxyz.jfrog.io/artifactory/tbd-oss-releases-maven2
+ default
+
+
+ false
+ tbd-oss-snapshots
+ TBD OSS Snapshots Repository
+ https://blockxyz.jfrog.io/artifactory/tbd-oss-snapshots-maven2
+ default
+
+
+
+
+
+ tbd-oss-thirdparty
+ tbd-oss-thirdparty
+
+ true
+
+
+ false
+
+ https://blockxyz.jfrog.io/artifactory/tbd-oss-thirdparty-maven2/
+
+
+ tbd-oss-snapshots
+ tbd-oss-snapshots
+
+ false
+
+
+ true
+
+ https://blockxyz.jfrog.io/artifactory/tbd-oss-snapshots-maven2/
+
+
+
+
+
+ tbd-oss-thirdparty
+ tbd-oss-thirdparty
+
+ true
+
+
+ false
+
+ https://blockxyz.jfrog.io/artifactory/tbd-oss-thirdparty-maven2/
+
+
+
diff --git a/bound/kt/src/main/kotlin/web5/sdk/crypto/keys/InMemoryKeyManager.kt b/bound/kt/src/main/kotlin/web5/sdk/crypto/keys/InMemoryKeyManager.kt
index 095f0360..f8fd6424 100644
--- a/bound/kt/src/main/kotlin/web5/sdk/crypto/keys/InMemoryKeyManager.kt
+++ b/bound/kt/src/main/kotlin/web5/sdk/crypto/keys/InMemoryKeyManager.kt
@@ -1,17 +1,12 @@
package web5.sdk.crypto.keys
import web5.sdk.crypto.signers.Signer
-import web5.sdk.rust.SystemTarget
import web5.sdk.rust.InMemoryKeyManager as RustCoreInMemoryKeyManager
/**
* A class for managing cryptographic keys in-memory.
*/
class InMemoryKeyManager : KeyManager {
- init {
- SystemTarget.set() // ensure the sys arch is set for first-time loading
- }
-
private val rustCoreInMemoryKeyManager = RustCoreInMemoryKeyManager()
/**
diff --git a/bound/kt/src/main/kotlin/web5/sdk/crypto/signers/Ed25519Signer.kt b/bound/kt/src/main/kotlin/web5/sdk/crypto/signers/Ed25519Signer.kt
index ca353ac9..48f99639 100644
--- a/bound/kt/src/main/kotlin/web5/sdk/crypto/signers/Ed25519Signer.kt
+++ b/bound/kt/src/main/kotlin/web5/sdk/crypto/signers/Ed25519Signer.kt
@@ -1,15 +1,9 @@
package web5.sdk.crypto.signers
import web5.sdk.crypto.keys.Jwk
-import web5.sdk.rust.SystemTarget
-
import web5.sdk.rust.Ed25519Signer as RustCoreEd25519Signer
class Ed25519Signer : Signer {
- init {
- SystemTarget.set() // ensure the sys arch is set for first-time loading
- }
-
private val rustCoreSigner: RustCoreEd25519Signer
constructor(privateKey: Jwk) {
diff --git a/bound/kt/src/main/kotlin/web5/sdk/dids/BearerDid.kt b/bound/kt/src/main/kotlin/web5/sdk/dids/BearerDid.kt
index 09928ffc..178d52e5 100644
--- a/bound/kt/src/main/kotlin/web5/sdk/dids/BearerDid.kt
+++ b/bound/kt/src/main/kotlin/web5/sdk/dids/BearerDid.kt
@@ -2,8 +2,6 @@ package web5.sdk.dids
import web5.sdk.crypto.signers.Signer
import web5.sdk.crypto.keys.KeyManager
-import web5.sdk.rust.SystemTarget
-
import web5.sdk.rust.BearerDid as RustCoreBearerDid
/**
@@ -14,10 +12,6 @@ import web5.sdk.rust.BearerDid as RustCoreBearerDid
* @property document The DID document associated with this instance.
*/
class BearerDid {
- init {
- SystemTarget.set() // ensure the sys arch is set for first-time loading
- }
-
val did: Did
val document: Document
val keyManager: KeyManager
diff --git a/bound/kt/src/main/kotlin/web5/sdk/dids/Document.kt b/bound/kt/src/main/kotlin/web5/sdk/dids/Document.kt
index 77c51546..abf3e20a 100644
--- a/bound/kt/src/main/kotlin/web5/sdk/dids/Document.kt
+++ b/bound/kt/src/main/kotlin/web5/sdk/dids/Document.kt
@@ -1,6 +1,5 @@
package web5.sdk.dids
-
import web5.sdk.rust.DocumentData as RustCoreDocumentData
/**
diff --git a/bound/kt/src/main/kotlin/web5/sdk/dids/PortableDid.kt b/bound/kt/src/main/kotlin/web5/sdk/dids/PortableDid.kt
index bc28c1eb..245d15e9 100644
--- a/bound/kt/src/main/kotlin/web5/sdk/dids/PortableDid.kt
+++ b/bound/kt/src/main/kotlin/web5/sdk/dids/PortableDid.kt
@@ -1,14 +1,9 @@
package web5.sdk.dids
import web5.sdk.crypto.keys.Jwk
-import web5.sdk.rust.SystemTarget
import web5.sdk.rust.PortableDid as RustCorePortableDid
class PortableDid {
- init {
- SystemTarget.set() // ensure the sys arch is set for first-time loading
- }
-
val didUri: String
val document: Document
val privateKeys: List
diff --git a/bound/kt/src/main/kotlin/web5/sdk/dids/methods/dht/DidDht.kt b/bound/kt/src/main/kotlin/web5/sdk/dids/methods/dht/DidDht.kt
index c89e371d..dc9c4675 100644
--- a/bound/kt/src/main/kotlin/web5/sdk/dids/methods/dht/DidDht.kt
+++ b/bound/kt/src/main/kotlin/web5/sdk/dids/methods/dht/DidDht.kt
@@ -5,8 +5,6 @@ import web5.sdk.crypto.signers.Signer
import web5.sdk.dids.Did
import web5.sdk.dids.Document
import web5.sdk.dids.ResolutionResult
-import web5.sdk.rust.SystemTarget
-
import web5.sdk.rust.didDhtResolve as rustCoreDidDhtResolve
import web5.sdk.rust.DidDht as RustCoreDidDht
import web5.sdk.rust.Signer as RustCoreSigner
@@ -18,10 +16,6 @@ import web5.sdk.rust.Signer as RustCoreSigner
* @property document The DID document associated with this instance.
*/
class DidDht {
- init {
- SystemTarget.set() // ensure the sys arch is set for first-time loading
- }
-
val did: Did
val document: Document
diff --git a/bound/kt/src/main/kotlin/web5/sdk/dids/methods/jwk/DidJwk.kt b/bound/kt/src/main/kotlin/web5/sdk/dids/methods/jwk/DidJwk.kt
index 8cf95e57..3bdc034f 100644
--- a/bound/kt/src/main/kotlin/web5/sdk/dids/methods/jwk/DidJwk.kt
+++ b/bound/kt/src/main/kotlin/web5/sdk/dids/methods/jwk/DidJwk.kt
@@ -4,8 +4,6 @@ import web5.sdk.crypto.keys.Jwk
import web5.sdk.dids.Did
import web5.sdk.dids.Document
import web5.sdk.dids.ResolutionResult
-import web5.sdk.rust.SystemTarget
-
import web5.sdk.rust.didJwkResolve as rustCoreDidJwkResolve
import web5.sdk.rust.DidJwk as RustCoreDidJwk
@@ -16,10 +14,6 @@ import web5.sdk.rust.DidJwk as RustCoreDidJwk
* @property document The DID document associated with this instance.
*/
class DidJwk {
- init {
- SystemTarget.set() // ensure the sys arch is set for first-time loading
- }
-
val did: Did
val document: Document
diff --git a/bound/kt/src/main/kotlin/web5/sdk/dids/methods/web/DidWeb.kt b/bound/kt/src/main/kotlin/web5/sdk/dids/methods/web/DidWeb.kt
index 6ec25ab1..d848c194 100644
--- a/bound/kt/src/main/kotlin/web5/sdk/dids/methods/web/DidWeb.kt
+++ b/bound/kt/src/main/kotlin/web5/sdk/dids/methods/web/DidWeb.kt
@@ -5,8 +5,6 @@ import web5.sdk.crypto.keys.Jwk
import web5.sdk.dids.Did
import web5.sdk.dids.Document
import web5.sdk.dids.ResolutionResult
-import web5.sdk.rust.SystemTarget
-
import web5.sdk.rust.didWebResolve as rustCoreDidWebResolve
import web5.sdk.rust.DidWeb as RustCoreDidWeb
@@ -17,10 +15,6 @@ import web5.sdk.rust.DidWeb as RustCoreDidWeb
* @property document The DID document associated with this instance.
*/
class DidWeb {
- init {
- SystemTarget.set() // ensure the sys arch is set for first-time loading
- }
-
val did: Did
val document: Document
diff --git a/bound/kt/src/main/kotlin/web5/sdk/rust/SystemTarget.kt b/bound/kt/src/main/kotlin/web5/sdk/rust/SystemTarget.kt
index 343700af..a31fb046 100644
--- a/bound/kt/src/main/kotlin/web5/sdk/rust/SystemTarget.kt
+++ b/bound/kt/src/main/kotlin/web5/sdk/rust/SystemTarget.kt
@@ -2,59 +2,47 @@ package web5.sdk.rust
import java.io.File
-object SystemTarget {
- @Volatile
- private var isSet = false
+internal val logLevel = System.getenv("WEB5_SDK_LOG_LEVEL")?.lowercase()
- fun set() {
- val logLevel = System.getenv("WEB5_SDK_LOG_LEVEL")?.lowercase()
+internal fun log(message: String) {
+ if (logLevel == "debug") {
+ println("web5 sdk SystemArchitecture $message")
+ }
+}
- fun log(message: String) {
- if (logLevel == "debug") {
- println("web5 sdk SystemArchitecture $message")
- }
- }
+internal fun detectSystemTarget(): String {
+ val arch = System.getProperty("os.arch")?.lowercase() ?: throw Exception("Unable to get OS arch")
+ val name = System.getProperty("os.name")?.lowercase() ?: throw Exception("Unable to get OS name")
+
+ log("System architecture: $arch")
+ log("Operating system name: $name")
+
+ when {
+ name.contains("mac") && arch.contains("aarch64") ->
+ return "web5_uniffi_aarch64_apple_darwin"
- if (!isSet) {
- synchronized(this) {
- if (!isSet) {
- val arch = System.getProperty("os.arch")?.lowercase() ?: throw Exception("Unable to get OS arch")
- val name = System.getProperty("os.name")?.lowercase() ?: throw Exception("Unable to get OS name")
-
- log("System architecture: $arch")
- log("Operating system name: $name")
-
- when {
- name.contains("mac") && arch.contains("aarch64") ->
- System.setProperty("uniffi.component.web5.libraryOverride", "web5_uniffi_aarch64_apple_darwin")
-
- name.contains("mac") && arch.contains("x86_64") ->
- System.setProperty("uniffi.component.web5.libraryOverride", "web5_uniffi_x86_64_apple_darwin")
-
- name.contains("linux") && arch.contains("amd64") -> {
- val osRelease = File("/etc/os-release")
- if (osRelease.exists()) {
- val osReleaseContent = osRelease.readText().lowercase()
- log("OS release content: $osReleaseContent")
- when {
- osReleaseContent.contains("ubuntu") ->
- System.setProperty("uniffi.component.web5.libraryOverride", "web5_uniffi_x86_64_unknown_linux_gnu")
-
- osReleaseContent.contains("alpine") ->
- System.setProperty("uniffi.component.web5.libraryOverride", "web5_uniffi_x86_64_unknown_linux_musl")
-
- else -> throw Exception("Unsupported OS arch $osReleaseContent")
- }
- } else {
- throw Exception("Linux /etc/os-release not found")
- }
- }
-
- else -> throw Exception("Unsupported OS arch $arch $name")
- }
- isSet = true
+ name.contains("mac") && arch.contains("x86_64") ->
+ return "web5_uniffi_x86_64_apple_darwin"
+
+ name.contains("linux") && arch.contains("amd64") -> {
+ val osRelease = File("/etc/os-release")
+ if (osRelease.exists()) {
+ val osReleaseContent = osRelease.readText().lowercase()
+ log("OS release content: $osReleaseContent")
+ return when {
+ osReleaseContent.contains("ubuntu") ->
+ "web5_uniffi_x86_64_unknown_linux_gnu"
+
+ osReleaseContent.contains("alpine") ->
+ "web5_uniffi_x86_64_unknown_linux_musl"
+
+ else -> throw Exception("Unsupported OS arch $osReleaseContent")
}
+ } else {
+ throw Exception("Linux /etc/os-release not found")
}
}
+
+ else -> throw Exception("Unsupported OS arch $arch $name")
}
}
\ No newline at end of file
diff --git a/bound/kt/src/main/kotlin/web5/sdk/rust/UniFFI.kt b/bound/kt/src/main/kotlin/web5/sdk/rust/UniFFI.kt
index 9ab044e0..ed39f91d 100644
--- a/bound/kt/src/main/kotlin/web5/sdk/rust/UniFFI.kt
+++ b/bound/kt/src/main/kotlin/web5/sdk/rust/UniFFI.kt
@@ -367,7 +367,7 @@ private fun findLibraryName(componentName: String): String {
private inline fun loadIndirect(
componentName: String
): Lib {
- return Native.load(findLibraryName(componentName), Lib::class.java)
+ return Native.load(detectSystemTarget(), Lib::class.java)
}
// Define FFI callback types
diff --git a/bound/kt/src/main/kotlin/web5/sdk/vc/pex/PresentationDefinition.kt b/bound/kt/src/main/kotlin/web5/sdk/vc/pex/PresentationDefinition.kt
index 52d66835..1236585b 100644
--- a/bound/kt/src/main/kotlin/web5/sdk/vc/pex/PresentationDefinition.kt
+++ b/bound/kt/src/main/kotlin/web5/sdk/vc/pex/PresentationDefinition.kt
@@ -2,7 +2,6 @@ package web5.sdk.vc.pex
import com.fasterxml.jackson.annotation.JsonProperty
import web5.sdk.Json
-import web5.sdk.rust.SystemTarget
import web5.sdk.rust.PresentationDefinition as RustCorePresentationDefinition
data class PresentationDefinition(
@@ -12,10 +11,6 @@ data class PresentationDefinition(
@JsonProperty("input_descriptors")
val inputDescriptors: List
) {
- init {
- SystemTarget.set() // ensure the sys arch is set for first-time loading
- }
-
internal val rustCorePresentationDefinition = RustCorePresentationDefinition(
Json.stringify(this)
)
diff --git a/bound/kt/src/main/resources/libweb5_uniffi_aarch64_apple_darwin.dylib b/bound/kt/src/main/resources/libweb5_uniffi_aarch64_apple_darwin.dylib
deleted file mode 100755
index 10d84835..00000000
Binary files a/bound/kt/src/main/resources/libweb5_uniffi_aarch64_apple_darwin.dylib and /dev/null differ
diff --git a/bound/kt/src/main/resources/libweb5_uniffi_x86_64_apple_darwin.dylib b/bound/kt/src/main/resources/libweb5_uniffi_x86_64_apple_darwin.dylib
deleted file mode 100755
index 5db2e256..00000000
Binary files a/bound/kt/src/main/resources/libweb5_uniffi_x86_64_apple_darwin.dylib and /dev/null differ
diff --git a/bound/kt/src/main/resources/libweb5_uniffi_x86_64_unknown_linux_gnu.so b/bound/kt/src/main/resources/libweb5_uniffi_x86_64_unknown_linux_gnu.so
deleted file mode 100755
index cc80cdec..00000000
Binary files a/bound/kt/src/main/resources/libweb5_uniffi_x86_64_unknown_linux_gnu.so and /dev/null differ
diff --git a/bound/kt/src/main/resources/libweb5_uniffi_x86_64_unknown_linux_musl.so b/bound/kt/src/main/resources/libweb5_uniffi_x86_64_unknown_linux_musl.so
deleted file mode 100755
index ea9210b0..00000000
Binary files a/bound/kt/src/main/resources/libweb5_uniffi_x86_64_unknown_linux_musl.so and /dev/null differ
diff --git a/bound/kt/src/test/kotlin/web5/sdk/rust/SystemTargetTest.kt b/bound/kt/src/test/kotlin/web5/sdk/rust/SystemTargetTest.kt
index 5aece0f4..67d1e28e 100644
--- a/bound/kt/src/test/kotlin/web5/sdk/rust/SystemTargetTest.kt
+++ b/bound/kt/src/test/kotlin/web5/sdk/rust/SystemTargetTest.kt
@@ -6,8 +6,7 @@ class SystemTargetTest {
@Test
fun `can load shared library`() {
System.setProperty("WEB5_SDK_LOG_LEVEL", "debug")
- SystemTarget.set()
UniffiLib.INSTANCE
- println("Successfully loaded shared library for ${System.getProperty("uniffi.component.web5.libraryOverride")}")
+ println("Successfully loaded shared library for ${detectSystemTarget()}")
}
}
\ No newline at end of file
diff --git a/jitpack.yml b/jitpack.yml
deleted file mode 100644
index b51ea8b0..00000000
--- a/jitpack.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-# jitpack.yml
-
-jdk:
- - openjdk11
-
-install:
- - cd bound/kt && mvn install -DskipTests=true