forked from LaiFengiOS/LFLiveKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
chenliming
committed
Oct 21, 2016
1 parent
8b39f68
commit 3f80463
Showing
2 changed files
with
129 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/sh | ||
|
||
UNIVERSAL_OUTPUT_FOLDER="${PROJECT_DIR}/build/" | ||
|
||
# make the output directory and delete the framework directory | ||
mkdir -p "${UNIVERSAL_OUTPUT_FOLDER}" | ||
rm -rf "${UNIVERSAL_OUTPUT_FOLDER}/${PROJECT_NAME}.framework" | ||
|
||
# Step 1. Build Device and Simulator versions | ||
xcodebuild -target "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build | ||
xcodebuild -target "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphonesimulator BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build | ||
|
||
# Step 2. Copy the framework structure to the universal folder | ||
echo "==============Step 2==============" | ||
echo "${BUILD_DIR}/${CONFIGURATION}-iphoneos/${PROJECT_NAME}.framework" | ||
|
||
cp -R "${BUILD_DIR}/${CONFIGURATION}-iphoneos/${PROJECT_NAME}.framework" "${UNIVERSAL_OUTPUT_FOLDER}/" | ||
|
||
# Step 3. Create universal binary file using lipo and place the combined executable in the copied framework directory | ||
lipo -create -output "${UNIVERSAL_OUTPUT_FOLDER}/${PROJECT_NAME}.framework/${PROJECT_NAME}" "${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${PROJECT_NAME}.framework/${PROJECT_NAME}" "${BUILD_DIR}/${CONFIGURATION}-iphoneos/${PROJECT_NAME}.framework/${PROJECT_NAME}" | ||
|
||
echo "==============Completion==============" | ||
echo "${UNIVERSAL_OUTPUT_FOLDER}/${PROJECT_NAME}.framework/${PROJECT_NAME}" | ||
|
||
# Step 4. Copy strings bundle if exists | ||
STRINGS_INPUT_FOLDER="${PROJECT_NAME}Strings.bundle" | ||
if [ -d "${STRINGS_INPUT_FOLDER}" ]; then | ||
STRINGS_OUTPUT_FOLDER="${UNIVERSAL_OUTPUT_FOLDER}/${PROJECT_NAME}Strings.bundle" | ||
rm -rf "${STRINGS_OUTPUT_FOLDER}" | ||
cp -R "${STRINGS_INPUT_FOLDER}" "${STRINGS_OUTPUT_FOLDER}" | ||
fi |