Created
March 20, 2016 03:06
-
-
Save ulhas/3d995e416fd3286dfc06 to your computer and use it in GitHub Desktop.
Script for building universal framework used in HyperTrack iOS SDK
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
UNIVERSAL_OUTPUTFOLDER=../build/ | |
# make the output directory and delete the framework directory | |
mkdir -p "${UNIVERSAL_OUTPUTFOLDER}" | |
rm -rf "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework" | |
# Step 1. Build Device and Simulator versions | |
set -o pipefail && xctool -workspace "../${WORKSPACE_NAME}" -scheme "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build | xcpretty | |
set -o pipefail && xctool -workspace "../${WORKSPACE_NAME}" -scheme "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphonesimulator BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" -destination 'platform=iOS Simulator,name=iPhone 6' clean build | xcpretty | |
# Step 2. Copy the framework structure to the universal folder | |
cp -R "${BUILD_DIR}/${CONFIGURATION}-iphoneos/${PROJECT_NAME}.framework" "${UNIVERSAL_OUTPUTFOLDER}/" | |
# Step 3. Create universal binary file using lipo and place the combined executable in the copied framework directory | |
lipo -create -output "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework/${PROJECT_NAME}" "${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${PROJECT_NAME}.framework/${PROJECT_NAME}" "${BUILD_DIR}/${CONFIGURATION}-iphoneos/${PROJECT_NAME}.framework/${PROJECT_NAME}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment