From 33e77bd859bbb147ccf300b314997c1daca2302f Mon Sep 17 00:00:00 2001 From: abhishek Date: Mon, 30 Sep 2024 19:47:24 +0530 Subject: [PATCH] tesing ios script --- .github/workflows/afc_updates.yml | 25 ++++++++++++++++--- aries_framework_vcx/Cargo.toml | 14 ++++++++++- .../src/scripts/ios.build.cargo.sh | 19 +++++++------- 3 files changed, 45 insertions(+), 13 deletions(-) diff --git a/.github/workflows/afc_updates.yml b/.github/workflows/afc_updates.yml index 1518d735fc..b7cac41f57 100644 --- a/.github/workflows/afc_updates.yml +++ b/.github/workflows/afc_updates.yml @@ -15,7 +15,26 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - - name: Run Tests + - name: Install Dependencies run: | - # Add your test commands here - echo "CI for aries-vcx-framework run test" + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + brew update + brew install pkg-config libsodium openssl zeromq just jq + + - name: Set up Rust + run: | + rustc --version + rustup default 1.78.0 + rustc --version + + - name: Run the script + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REPO: ${{ github.repository }} + TAG: ${{ github.ref_name }} + run: | + echo "executing ios build" + chmod +x ./aries_framework_vcx/src/scripts/ios.build.cargo.sh + ./aries_framework_vcx/src/scripts/ios.build.cargo.sh + + \ No newline at end of file diff --git a/aries_framework_vcx/Cargo.toml b/aries_framework_vcx/Cargo.toml index 1577c49f46..837ed54b9f 100644 --- a/aries_framework_vcx/Cargo.toml +++ b/aries_framework_vcx/Cargo.toml @@ -7,8 +7,8 @@ edition = "2021" [dependencies] uniffi = { version = "0.28.0", features = ["cli"] } +openssl = { version = "0.10", features = ["vendored"] } aries_vcx = { path = "../aries/aries_vcx", features = [ - "anoncreds", "askar_wallet", ] } async-trait = "0.1.81" @@ -25,3 +25,15 @@ uuid = { version = "1.10.0", features = [ "v4", # Lets you generate random UUIDs "fast-rng", # Use a faster (but still sufficiently random) RNG ] } + +[lib] +crate-type = ["cdylib", "staticlib"] +name = "uniffi_vcx" + +[[bin]] +name = "uniffi-bindgen" +path = "uniffi-bindgen.rs" + +[build-dependencies] +uniffi = { version = "0.23.0", features = ["build", "cli"] } + diff --git a/aries_framework_vcx/src/scripts/ios.build.cargo.sh b/aries_framework_vcx/src/scripts/ios.build.cargo.sh index 6b2f5cdce8..c1e32bef50 100644 --- a/aries_framework_vcx/src/scripts/ios.build.cargo.sh +++ b/aries_framework_vcx/src/scripts/ios.build.cargo.sh @@ -5,7 +5,6 @@ # Required env vars ARIES_VCX_ROOT=$(dirname $(dirname $(dirname $SCRIPT_DIR))) - IOS_BUILD_DEPS_DIR=${ARIES_VCX_ROOT}/aries_framework_vcx/target/ios_build_deps LANGUAGE="swift" TARGET="aarch64-apple-ios" TARGET_NICKNAME="arm64" @@ -13,7 +12,7 @@ generate_bindings() { - export UNIFFI_ROOT="${ARIES_VCX_ROOT}/aries_framework_vcx/" + export UNIFFI_ROOT="${ARIES_VCX_ROOT}/aries_framework_vcx" export IOS_APP_DIR="${ARIES_VCX_ROOT}/aries_framework_vcx/ios/" rustup target add ${TARGET} @@ -22,24 +21,26 @@ pushd "${UNIFFI_ROOT}" cargo run --features=uniffi/cli --bin uniffi-bindgen generate src/aries_framework_vcx.udl --language ${LANGUAGE} + #cargo run --features=uniffi/cli --bin uniffi-bindgen generate src/aries_framework_vcx.udl --language ${LANGUAGE} popd #mkdir ${IOS_APP_DIR}/Source - cp -R ${UNIFFI_ROOT}/src/vcx.swift ${UNIFFI_ROOT}/src/vcxFFI.* ${IOS_APP_DIR} - cp -R ${UNIFFI_ROOT}/src/vcx.swift ${UNIFFI_ROOT}/src/vcxFFI.* ${IOS_APP_DIR}/Source - rm -R ${UNIFFI_ROOT}/src/vcx.swift ${UNIFFI_ROOT}/src/vcxFFI.* + cp -R ${UNIFFI_ROOT}/src/aries_framework_vcx.swift ${UNIFFI_ROOT}/src/aries_framework_vcxFFI.* ${IOS_APP_DIR} + cp -R ${UNIFFI_ROOT}/src/aries_framework_vcx.swift ${UNIFFI_ROOT}/src/aries_framework_vcxFFI.* ${IOS_APP_DIR}/Source + rm -R ${UNIFFI_ROOT}/src/aries_framework_vcx.swift ${UNIFFI_ROOT}/src/aries_framework_vcxFFI.* } build_uniffi_for_demo() { echo "Running build_uniffi_for_demo..." - export UNIFFI_ROOT="${ARIES_VCX_ROOT}/aries_framework_vcx/" + export UNIFFI_ROOT="${ARIES_VCX_ROOT}/aries_framework_vcx" export IOS_APP_DIR="${ARIES_VCX_ROOT}/aries_framework_vcx/ios" export ABI_PATH=${IOS_APP_DIR}/Frameworks mkdir -p ${ABI_PATH} - pushd ${UNIFFI_ROOT}/core - cargo build --target ${TARGET} --features "aries_vcx_anoncreds/zmq_vendored" + pushd ${UNIFFI_ROOT} + cargo build --target ${TARGET} + #--features "aries_vcx_anoncreds/zmq_vendored" cp ${ARIES_VCX_ROOT}/aries_framework_vcx/target/${TARGET}/debug/libuniffi_vcx.a ${ABI_PATH}/libuniffi_vcx.a popd @@ -51,7 +52,7 @@ export IOS_APP_DIR="${ARIES_VCX_ROOT}/aries_framework_vcx/ios" export ABI_PATH=${IOS_APP_DIR}/Frameworks - mv ${IOS_APP_DIR}/Source/vcxFFI.modulemap ${IOS_APP_DIR}/Source/module.modulemap + mv ${IOS_APP_DIR}/Source/aries_framework_vcxFFI.modulemap ${IOS_APP_DIR}/Source/module.modulemap xcodebuild -create-xcframework -library ${ABI_PATH}/libuniffi_vcx.a -headers ${IOS_APP_DIR}/Source -output "${ABI_PATH}/vcx.xcframework"