Skip to content

Commit

Permalink
Add makefile for kotlin, python, swift bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
ok300 committed Apr 12, 2024
1 parent 887af4f commit cddf2fc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/ls-sdk-bindings/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
To build the bindings:

```bash
# Kotlin
cargo run --features=uniffi/cli --bin uniffi-bindgen generate src/ls_sdk.udl --no-format --language kotlin -o ffi/kotlin
make kotlin

# Python
cargo run --features=uniffi/cli --bin uniffi-bindgen generate src/ls_sdk.udl --no-format --language python -o ffi/python
make python

# Swift
cargo run --features=uniffi/cli --bin uniffi-bindgen generate src/ls_sdk.udl --no-format --language swift -o ffi/swift
make swift
```
17 changes: 17 additions & 0 deletions lib/ls-sdk-bindings/makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
SOURCES=$(sort $(wildcard ./src/*.rs ./src/**/*.rs))

TARGET ?= x86_64-unknown-linux-gnu

all: python kotlin swift

python: $(SOURCES)
cargo build --release --target $(TARGET)
cargo run --features=uniffi/cli --bin uniffi-bindgen generate src/ls_sdk.udl --no-format --language python -o ffi/python

kotlin: $(SOURCES)
cargo build --release --target $(TARGET)
cargo run --features=uniffi/cli --bin uniffi-bindgen generate src/ls_sdk.udl --no-format --language kotlin -o ffi/kotlin

swift: $(SOURCES)
cargo build --release --target $(TARGET)
cargo run --features=uniffi/cli --bin uniffi-bindgen generate src/ls_sdk.udl --no-format --language swift -o ffi/swift

0 comments on commit cddf2fc

Please sign in to comment.