-
Notifications
You must be signed in to change notification settings - Fork 3
/
bundle_framework.sh
executable file
·41 lines (29 loc) · 1.26 KB
/
bundle_framework.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
#!/bin/bash
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
LV_SOURCE_DIR=$SCRIPT_DIR/lv_src
BUILD_TYPE=release
SHARED_LIBARY_NAME=libtoml.dylib
BUILD_OUTPUT_DIR=$SCRIPT_DIR/target/$BUILD_TYPE
# # build shared library with Cargo
# cargo build --$BUILD_TYPE
# Create a variable with the name of the framework
FRAMEWORK_NAME=dragon_toml_64
# change directory to the one containing shared library
pushd $BUILD_OUTPUT_DIR
# Create the framework directory (and subdirectories)
rm -rf $FRAMEWORK_NAME.framework
mkdir -p $FRAMEWORK_NAME.framework/Versions/A
# Copy the `.dylib` file into the framework as version `A`
cp $SHARED_LIBARY_NAME $FRAMEWORK_NAME.framework/Versions/A/$FRAMEWORK_NAME
chmod ugo+rx $FRAMEWORK_NAME.framework/Versions/A/$FRAMEWORK_NAME
# Create symbolic links to the current version of the framework
ln -s ./A ./$FRAMEWORK_NAME.framework/Versions/Current
ln -s ./Versions/A/$FRAMEWORK_NAME ./$FRAMEWORK_NAME.framework
# Zip the framework
rm -rf $FRAMEWORK_NAME.framework.zip
zip -r $FRAMEWORK_NAME.framework.zip $FRAMEWORK_NAME.framework
# change directory back to the original
popd
# Copy into LabVIEW Source Folder
rm -rf $LV_SOURCE_DIR/$FRAMEWORK_NAME.framework
cp -R $BUILD_OUTPUT_DIR/$FRAMEWORK_NAME.framework $LV_SOURCE_DIR/