Skip to content

Commit

Permalink
chore: lower iOS compatibility
Browse files Browse the repository at this point in the history
Signed-off-by: blu3beri <blu3beri@proton.me>
  • Loading branch information
blu3beri committed May 17, 2023
1 parent 0d687c3 commit 660eda5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
13 changes: 2 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -371,17 +371,8 @@ jobs:
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
# First version with support for cdylib: https://github.com/rust-lang/rust/pull/100636
toolchain: "1.65.0"
targets: ${{ matrix.target }}

# Not useful unless the toolchain version matches the default
# - name: Cache cargo resources
# uses: Swatinem/rust-cache@v2
# with:
# shared-key: deps
# save-if: false

- name: Build
run: |
cargo build --lib --release --target ${{matrix.target}}
Expand All @@ -390,7 +381,7 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: library-${{ matrix.target }}
path: target/${{ matrix.target }}/release/libaries_askar.dylib
path: target/${{ matrix.target }}/release/libaries_askar.a

build-android:
name: Build library (Android)
Expand Down Expand Up @@ -436,7 +427,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Fetch dynamic libraries
- name: Fetch static libraries
uses: actions/download-artifact@v3

- run: >
Expand Down
12 changes: 6 additions & 6 deletions build-xcframework.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ then
fi

NAME="aries_askar"
BUNDLE_NAME="aries-askar"
VERSION=$(cargo generate-lockfile && cargo pkgid | sed -e "s/^.*#//")
BUNDLE_IDENTIFIER="org.hyperledger.$NAME"
LIBRARY_NAME="lib$NAME.dylib"
BUNDLE_IDENTIFIER="org.hyperledger.$BUNDLE_NAME"
LIBRARY_NAME="lib$NAME.a"
XC_FRAMEWORK_NAME="$NAME.xcframework"
FRAMEWORK_LIBRARY_NAME=$NAME
FRAMEWORK_NAME="$FRAMEWORK_LIBRARY_NAME.framework"
HEADER_NAME="lib$NAME.h"
OUT_PATH="out"
MIN_IOS_VERSION="12.0"

# Setting some default paths
AARCH64_APPLE_IOS_PATH="./target/aarch64-apple-ios/release"
Expand Down Expand Up @@ -156,6 +158,8 @@ cat <<EOT >> Info.plist
<string>$VERSION</string>
<key>NSPrincipalClass</key>
<string></string>
<key>MinimumOSVersion</key>
<string>$MIN_IOS_VERSION</string>
</dict>
</plist>
EOT
Expand All @@ -179,8 +183,4 @@ xcodebuild -create-xcframework \
echo "cleaning up..."
rm -rf $FRAMEWORK_NAME real sim

echo "Fixing the identifiers of the library..."
install_name_tool -id @rpath/$NAME.framework/$FRAMEWORK_LIBRARY_NAME $XC_FRAMEWORK_NAME/ios-arm64/$FRAMEWORK_NAME/$FRAMEWORK_LIBRARY_NAME
install_name_tool -id @rpath/$NAME.framework/$FRAMEWORK_LIBRARY_NAME $XC_FRAMEWORK_NAME/ios-arm64_x86_64-simulator/$FRAMEWORK_NAME/$FRAMEWORK_LIBRARY_NAME

echo "Framework written to $OUT_PATH/$XC_FRAMEWORK_NAME"

0 comments on commit 660eda5

Please sign in to comment.