Skip to content

Commit

Permalink
refactor: bindgen is part of taple-uniffi crate
Browse files Browse the repository at this point in the history
  • Loading branch information
Yeray Rodriguez committed Sep 19, 2023
1 parent 142bf86 commit 0f4f0f2
Show file tree
Hide file tree
Showing 29 changed files with 12 additions and 20 deletions.
6 changes: 5 additions & 1 deletion taple-uniffi/Cargo.toml → Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@ crate-type = [
"cdylib", # must for Android
]

[[bin]]
name = "uniffi-bindgen"
path = "uniffi-bindgen.rs"

[dependencies]
# taple-core = { path = "../../taple-core/core" }
taple-core = { git = "https://github.com/opencanarias/taple-core"}
hex = "0.4.3"
uniffi = "0.23.0"
uniffi = { version = "0.23.0", features = ["cli"] }
android_logger = {version = "0.13.3", optional = true}
oslog = {version = "0.2.0", optional = true}
log = "0.4"
Expand Down
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,19 @@ Minimium supported rust versión (MSRV) is 1.67.
### Compile
```bash
$ git clone https://github.com/opencanarias/taple-ffi.git
$ cd taple-ffi/taple-uniffi
$ sudo apt install -y libprotobuf-dev protobuf-compiler cmake
$ cd taple-ffi
$ cargo build --release
$ mkdir ../target
$ cp ./target/release/libtaple_uniffi.a ../target
$ cp ./target/release/libtaple_uniffi.so ../target
$ ls ./target/release
```

### Generate bindings
Any [Uniffi supported language](https://mozilla.github.io/uniffi-rs/Overview.html#supported-languages) with callback interfaces support can be used. For instance:
```bash
$ cd ../uniffi-bindgen
$ cargo run --bin uniffi-bindgen generate ../taple-uniffi/src/taple_uniffi.udl --out-dir ../target --language kotlin
$ cargo run --bin uniffi-bindgen generate ./src/taple_uniffi.udl --out-dir ./target/bindings/kotlin --language kotlin
$ cargo run --bin uniffi-bindgen generate ./src/taple_uniffi.udl --out-dir ./target/bindings/swift --language swift
$ cargo run --bin uniffi-bindgen generate ./src/taple_uniffi.udl --out-dir ./target/bindings/python --language python
```
Any [Uniffi supported language](https://mozilla.github.io/uniffi-rs/Overview.html#supported-languages) can be used instead of Kotlin.

## Documentation and examples
Documentation and examples are under development. If you need more information, check out the following resources.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 0 additions & 11 deletions uniffi-bindgen/Cargo.toml

This file was deleted.

2 changes: 1 addition & 1 deletion taple-uniffi/uniffi.toml → uniffi.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[bindings.kotlin]
package_name = "com.opencanarias.taple_uniffi"
package_name = "com.opencanarias.taple.uniffi"
cdylib_name = "taple_uniffi"

0 comments on commit 0f4f0f2

Please sign in to comment.