Skip to content

Commit

Permalink
build: update rust and uniffi version
Browse files Browse the repository at this point in the history
  • Loading branch information
goncalo-frade-iohk committed Oct 10, 2023
1 parent 13c746a commit 09a25ae
Show file tree
Hide file tree
Showing 7 changed files with 1,536 additions and 1,230 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: "Anoncreds"

env:
RUST_VERSION: "1.65.0"
RUST_VERSION: "1.73.0"
CROSS_VERSION: "0.2.4"

on:
Expand Down Expand Up @@ -107,8 +107,8 @@ jobs:
- name: Release artifacts
uses: a7ul/[email protected]
if: |
(${{ matrix.architecture }} != 'swift-package-universal' &&
github.event_name == 'release' ||
matrix.architecture != 'swift-package-universal' &&
(github.event_name == 'release' ||
(github.event_name == 'workflow_dispatch' && github.event.inputs.publish-binaries == 'true'))
with:
command: c
Expand All @@ -118,8 +118,8 @@ jobs:

- name: Add library artifacts to release
if: |
(${{ matrix.architecture }} != 'swift-package-universal' &&
github.event_name == 'release' ||
matrix.architecture != 'swift-package-universal' &&
(github.event_name == 'release' ||
(github.event_name == 'workflow_dispatch' && github.event.inputs.publish-binaries == 'true'))
uses: svenstaro/upload-release-action@v2
with:
Expand All @@ -128,10 +128,10 @@ jobs:

- name: Add swift package artifacts to release
if: |
(${{ matrix.architecture }} == 'swift-package-universal' &&
github.event_name == 'release' ||
matrix.architecture == 'swift-package-universal' &&
(github.event_name == 'release' ||
(github.event_name == 'workflow_dispatch' && github.event.inputs.publish-binaries == 'true'))
uses: svenstaro/upload-release-action@v2
with:
file: ${{ matrix.lib }}
file: ${{ matrix.libPath }}
asset_name: "${{ matrix.lib }}"
9 changes: 6 additions & 3 deletions uniffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@ crate-type = [
]
name = "anoncreds_uniffi"

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

[dependencies.anoncreds_core]
path = '..'
package = "anoncreds"
features = ["vendored"]

[dependencies]
uniffi_macros = "0.20.0"
uniffi = { version = "0.20.0", features=["builtin-bindgen"] }
uniffi = { version = "0.24.3" }
lazy_static = "1.3"
futures = { version = "0.3.17", features = ["thread-pool"] }
num_cpus = "1.8.0"
Expand All @@ -39,5 +42,5 @@ features = [
]

[build-dependencies]
uniffi_build = { version = "0.20.0", features=["builtin-bindgen"] }
uniffi = { version = "0.24.3", features = [ "build", "cli" ] }
swift-bridge-build = "0.1.51"
2 changes: 1 addition & 1 deletion uniffi/build-release-apple-universal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ mkdir -p ./target/universal-darwin/release || true

# Generate Uniffi bindings
echo "Creating uniffi bindings"
uniffi-bindgen generate src/anoncreds.udl --language swift -o ./wrappers/swift/anoncreds
cargo run --bin uniffi-bindgen generate src/anoncreds.udl --language swift -o ./wrappers/swift/anoncreds

# Build targets
echo "Build all targets"
Expand Down
4 changes: 2 additions & 2 deletions uniffi/build-release-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ rm -f ./wrappers/kotlin/anoncreds/uniffi/anoncreds/anoncreds.kt || true
cargo build --release --target x86_64-unknown-linux-gnu

# Generate the file anoncreds.kt in wrappers/kotlin/anoncreds/uniffi/anoncreds/anoncreds.kt
~/.cargo/bin/uniffi-bindgen generate src/anoncreds.udl --language kotlin -o ./wrappers/kotlin/anoncreds
cargo run --bin uniffi-bindgen generate src/anoncreds.udl --language kotlin -o ./wrappers/kotlin/anoncreds

# Move code to output-frameworks/anoncreds-jvm
rm -f ./output-frameworks/anoncreds-jvm/src/main/uniffi/anoncreds/anoncreds.kt
mv ./wrappers/kotlin/anoncreds/uniffi/anoncreds/anoncreds.kt ./output-frameworks/anoncreds-jvm/src/main/uniffi/anoncreds/anoncreds.kt

# make the jar
cd ./output-frameworks/anoncreds-jvm
./gradlew jar
./gradlew jar
2 changes: 1 addition & 1 deletion uniffi/build.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
fn main() {
uniffi_build::generate_scaffolding("./src/anoncreds.udl").unwrap();
uniffi::generate_scaffolding("./src/anoncreds.udl").unwrap();
}
Loading

0 comments on commit 09a25ae

Please sign in to comment.