Skip to content

Commit 5b60eea

Browse files
committed
Create build_frameworks.sh inside ci directory that's supposed to create xcarchives solely based on the Package.swift file. However, the Products folder is as of yet broken.
1 parent 14bd9d0 commit 5b60eea

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

ci/build_frameworks.sh

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# https://stackoverflow.com/a/4774063/299711
6+
BASEDIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
7+
BUILD_PRODUCTS_DIR="${BASEDIR}/../bindings/bin" # directory to copy the shared library and headers into
8+
BUILD_LOG_PATH="${BASEDIR}/build_frameworks.log"
9+
10+
# initialize the build log
11+
echo -n "" > $BUILD_LOG_PATH
12+
13+
# force xcode 13.2.1 for the tuple fix for macabi
14+
sudo xcode-select -s /Applications/Xcode\ 13.2.1.app/Contents/Developer/
15+
16+
if [[ $CONFIGURATION = "Debug" ]]; then
17+
RUST_CONFIGURATION="debug"
18+
RUST_CONFIGURATION_FLAG=""
19+
else
20+
RUST_CONFIGURATION="release"
21+
RUST_CONFIGURATION_FLAG="--release"
22+
fi
23+
24+
declare -a destinationNames=( "iOS Simulator" )
25+
declare -a lipoDirectoryNames=( "iphonesimulator" )
26+
27+
declare archiveCount=${#lipoDirectoryNames[@]}
28+
for (( i=0; i<$archiveCount; i++ ));
29+
do
30+
CURRENT_DESTINATION_NAME=${destinationNames[$i]}
31+
CURRENT_LIPO_DIRECTORY_NAME_INFIX=${lipoDirectoryNames[$i]}
32+
CURRENT_ARCHIVE_DIRECTORY="${BASEDIR}/../bindings/bin/${RUST_CONFIGURATION}/${CURRENT_LIPO_DIRECTORY_NAME_INFIX}/xcarchive"
33+
CURRENT_ARCHIVE_PATH="${CURRENT_ARCHIVE_DIRECTORY}/${CURRENT_LIPO_DIRECTORY_NAME_INFIX}"
34+
35+
CURRENT_LIPO_DIRECTORY_PATH="${BUILD_PRODUCTS_DIR}/${RUST_CONFIGURATION}/${CURRENT_LIPO_DIRECTORY_NAME_INFIX}/lipo"
36+
export LDK_C_BINDINGS_BINARY_DIRECTORY="${CURRENT_LIPO_DIRECTORY_PATH}"
37+
38+
echo "Building xcarchive for ${CURRENT_DESTINATION_NAME}" >> $BUILD_LOG_PATH
39+
echo "Current lipo input directory: ${CURRENT_LIPO_DIRECTORY_PATH}" >> $BUILD_LOG_PATH
40+
echo "Current xcarchive archive directory: ${CURRENT_ARCHIVE_PATH}" >> $BUILD_LOG_PATH
41+
42+
pushd "${BASEDIR}/LDKSwift"
43+
44+
mkdir -p "${CURRENT_ARCHIVE_DIRECTORY}"
45+
xcodebuild archive -scheme LDKSwift -destination "generic/platform=${CURRENT_DESTINATION_NAME}" -archivePath "${CURRENT_ARCHIVE_PATH}" ENABLE_BITCODE=NO SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES
46+
47+
popd
48+
done

0 commit comments

Comments
 (0)