|
| 1 | +# Anoncreds Uniffi |
| 2 | + |
| 3 | +A `uniffi` wrapper built on top of [hyperledger/anoncreds-rs](https://github.com/hyperledger/anoncreds-rs). |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +Before you start, please ensure you have the following installed: |
| 8 | + |
| 9 | +- Rust, you can install it via [rustup](https://rustup.rs/) |
| 10 | +- Swift, you can install it via Xcode, you can download it from [Mac App Store](https://apps.apple.com/us/app/xcode/id497799835) |
| 11 | +- [uniffi-rs](https://github.com/mozilla/uniffi-rs), you can add it as a dependency to your `Cargo.toml` |
| 12 | + |
| 13 | +## Building the Project |
| 14 | + |
| 15 | +After you have installed all the necessary prerequisites, follow these steps to build the project: |
| 16 | + |
| 17 | +1. Clone the repository: |
| 18 | + |
| 19 | +`git clone https://github.com/input-output-hk/anoncreds-rs.git` |
| 20 | + |
| 21 | +2. Navigate into the project directory: |
| 22 | + |
| 23 | +`cd uniffi` |
| 24 | + |
| 25 | +3. Build the project: |
| 26 | + |
| 27 | +`cargo build` |
| 28 | + |
| 29 | +## Building release for a target |
| 30 | + |
| 31 | +To build this uniffi to any target you can run the following commands: |
| 32 | + |
| 33 | +1. Create the wrapper bindings from uniffi |
| 34 | + |
| 35 | +`uniffi-bindgen generate src/anoncreds.udl --language <swift or kotlin> -o ./wrappers/<language>/anoncreds` |
| 36 | + |
| 37 | +2. Create a release build for all the targets you required. A target is the arch and the OS (example: `x86_64-apple-darwin` is the target for intel macos). |
| 38 | + |
| 39 | +`cargo build --release --target <target>` |
| 40 | + |
| 41 | +⚠️ **WARNING:** If your not sure of the available targets you can run `rustup target list` and add a target by running `rustup target add <target>`. |
| 42 | + |
| 43 | +## Building for macOS and iOS |
| 44 | + |
| 45 | +For macOS, you can build a Swift Package project for all architectures using the provided `build-release-apple-universal.sh` script: |
| 46 | + |
| 47 | +1. Ensure the script is executable: |
| 48 | + |
| 49 | +`chmod +x ./build-release-apple-universal.sh` |
| 50 | + |
| 51 | +2. Run the script: |
| 52 | + |
| 53 | +`./build-release-apple-universal.sh` |
| 54 | + |
| 55 | +This will create a Swift Package project inside the `output-frameworks` folder, containing everything needed to run `uniffi` for Swift on macOS and iOS for all architectures. |
| 56 | + |
| 57 | +## Contributing |
| 58 | + |
| 59 | +Contributions are always welcome! Please read our [contributing guide](CONTRIBUTING.md) to get started. |
| 60 | + |
| 61 | +## License |
| 62 | + |
| 63 | +This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. |
0 commit comments