Skip to content

Latest commit

 

History

History
58 lines (37 loc) · 2.43 KB

DEVELOP.md

File metadata and controls

58 lines (37 loc) · 2.43 KB

Requirements

Rust is required to build the project. Xcode is required to build and test Swift wrappers. Andriod Stuio and Docker Desktop are required to build and test Android wrappers.

Swift wrappers

Build

Create Swift bindings by running build-swift-framework.sh. This will create xcframeworks from the static libraries generated by UniFFI. It also creates Swift bindings and copy them to swift/Sources directory.

Test

Run USE_LOCAL_XCFRAMEWORK=1 swift test. This will build the Swift package and run all the tests.

Publish

Swift xcframeworks are created in out directory of each modules. For example, anoncreds xcframework file is created at anoncreds/out/anoncreds_uniffiFFI.xcframework. Zip the xcframework to a zip file using zip -rq anoncreds/out/anoncreds_uniffiFFI.xcframework.zip anoncreds/out/anoncreds_uniffiFFI.xcframework and then upload it as a github release asset. Checksum can be computed using swift package compute-checksum anoncreds/out/anoncreds_uniffiFFI.xcframework.zip. Finally, update the url and checksum properties of binaray targets in the Package.swift file. Note that we need to create a tag after the update of Package.swift.

Kotlin wrappers

Build

Create Kotlin bindings by running build-kotlin-libraries.sh. This will create libraries and Kotlin bindings in out/kmpp-uniffi directory.

Test

Go to one of the Kotlin projects, e.g., kotlin/anoncreds and run tests using ./gradlew jvmTest.

Publish

Publish to Maven Local

Run ./gradlew publishToMavenLocal to publish to Maven Local.

To use Maven Local in a seperate project you'll want to make sure to add it inside of your build.gradle.kts.

    repositories {
        mavenLocal()
        mavenCentral()
        google()
    }

Publish Kotlin libraries to github

Publishing to github will require you to do a couple more steps. First we will want to get a github token with write:packages permissions, more details can be found here.

Once you have a token you will want to add both your token and your github username into kotlin/${library}/local.properties like so:

githubUsername=ExampleUsername
githubToken=ghp_ajsldk1FakeTokenjkash

Now you can publish to github packages using ./gradlew publishAllPublicationsToGithubRepository.