forked from hyperledger-archives/indy-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-libindy-core-ios.sh
executable file
·48 lines (36 loc) · 1.31 KB
/
build-libindy-core-ios.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/sh
export PKG_CONFIG_ALLOW_CROSS=1
export OPENSSL_DIR=/usr/local/Cellar/openssl/1.0.2k
export EVERNYM_REPO_KEY=~/Documents/EvernymRepo
export LIBINDY_POD_VERSION=0.0.3
export POD_FILE_NAME=libindy-core-ios.tar.gz
echo "\nBuild IOS POD started..."
cargo lipo
echo 'Build completed successfully.'
WORK_DIR=`mktemp -d`
echo "Try to create temporary directory: $WORK_DIR"
if [[ ! "$WORK_DIR" || ! -d "$WORK_DIR" ]]; then
echo "Could not create temp dir $WORK_DIR"
exit 1
fi
echo "Packing...\n\n"
cp include/*.h $WORK_DIR
cp target/universal/debug/libindy.a $WORK_DIR
CUR_DIR=`pwd`
cd $WORK_DIR
tar -cvzf $POD_FILE_NAME *
ls -l $WORK_DIR/$POD_FILE_NAME
echo "\nPacking completed."
cd $CUR_DIR
echo "Uploading...."
cat <<EOF | sftp -i $EVERNYM_REPO_KEY [email protected]
ls -l /var/repositories/deb/pods-ios/libindy-core/$LIBINDY_POD_VERSION/$POD_FILE_NAME
rm /var/repositories/deb/pods-ios/libindy-core/$LIBINDY_POD_VERSION/$POD_FILE_NAME
rmdir /var/repositories/deb/pods-ios/libindy-core/$LIBINDY_POD_VERSION
mkdir /var/repositories/deb/pods-ios/libindy-core/$LIBINDY_POD_VERSION
cd /var/repositories/deb/pods-ios/libindy-core/$LIBINDY_POD_VERSION
put $WORK_DIR/$POD_FILE_NAME
ls -l /var/repositories/deb/pods-ios/libindy-core/$LIBINDY_POD_VERSION
EOF
echo "Cleanup temporary directory: $WORK_DIR"
rm -rf "$WORK_DIR"