Chromium Code Reviews| Index: webrtc/build/ios/build_ios_framework.sh |
| diff --git a/webrtc/build/ios/build_ios_framework.sh b/webrtc/build/ios/build_ios_framework.sh |
| new file mode 100755 |
| index 0000000000000000000000000000000000000000..3b45ad22b6325164e30fd462f5b3ed86cbd3a4c7 |
| --- /dev/null |
| +++ b/webrtc/build/ios/build_ios_framework.sh |
| @@ -0,0 +1,60 @@ |
| +#!/bin/bash |
| + |
| +# Copyright 2015 The WebRTC project authors. All Rights Reserved. |
| +# |
| +# Use of this source code is governed by a BSD-style license |
| +# that can be found in the LICENSE file in the root of the source |
| +# tree. An additional intellectual property rights grant can be found |
| +# in the file PATENTS. All contributing project authors may |
| +# be found in the AUTHORS file in the root of the source tree. |
| + |
| +# Generates dynamic FAT framework for iOS in out_ios_framework. |
| + |
| +# Check for Darwin. |
| +if [[ ! $(uname) = "Darwin" ]]; then |
| + echo "OS X required." >&2 |
| +fi |
| + |
| +# Check for iOS library build script. |
| +SCRIPT_DIR=$(dirname $0) |
| +WEBRTC_BASE_DIR=${SCRIPT_DIR}/../../.. |
| +BUILD_WEBRTC_SCRIPT=${WEBRTC_BASE_DIR}/webrtc/build/ios/build_ios_libs.sh |
| +if [[ ! -x ${BUILD_WEBRTC_SCRIPT} ]]; then |
| + echo "Failed to find iOS library build script." >&2 |
| + exit 1 |
| +fi |
| +# Check for flatten iOS headers script. |
| +FLATTEN_HEADERS_SCRIPT=${WEBRTC_BASE_DIR}/webrtc/build/ios/flatten_ios_headers.py |
| +if [[ ! -x ${FLATTEN_HEADERS_SCRIPT} ]]; then |
| + echo "Failed to find flatten iOS headers script." >&2 |
| + exit 1 |
| +fi |
| + |
| +pushd ${WEBRTC_BASE_DIR} |
| + |
| +# Build static libraries for iOS. |
| +${BUILD_WEBRTC_SCRIPT} |
|
tkchin_webrtc
2016/03/23 17:52:55
check for return code and exit if failure
hjon_webrtc
2016/03/25 00:09:46
Done.
|
| + |
| +# Flatten the directory structure for iOS headers. |
| +${FLATTEN_HEADERS_SCRIPT} |
|
tkchin_webrtc
2016/03/23 17:52:55
ditto
hjon_webrtc
2016/03/25 00:09:46
Done.
|
| + |
| +# Replace full paths for headers with framework paths. |
| +sed -E -i '' 's/"webrtc\/(api|base)\/objc\/(.*)"/<WebRTC\/\2>/g' out_ios_framework/include/*.h |
|
tkchin_webrtc
2016/03/23 17:52:55
This will be hard to maintain as we include more f
hjon_webrtc
2016/03/25 00:09:46
Done.
|
| + |
| +# Build the framework. |
| +pushd webrtc/build/ios/webrtc/WebRTC |
| +xcodebuild -project WebRTC.xcodeproj -scheme WebRTC -configuration Release build |
| +xcodebuild -project WebRTC.xcodeproj -scheme WebRTC -destination 'platform=iOS Simulator,name=iPhone 6' -configuration Release build |
|
tkchin_webrtc
2016/03/23 17:52:56
nit: same order of arguments
Do these build both a
hjon_webrtc
2016/03/25 00:09:46
Done. Correct, the first builds armv7/arm64 and th
|
| +popd |
| + |
| +# Copy podspec and framework to out_ios_framework |
| +cp webrtc/build/ios/webrtc/WebRTC.podspec out_ios_framework/ |
| +cp -R webrtc/build/ios/webrtc/WebRTC/build/Release-iphoneos/WebRTC.framework out_ios_framework/ |
| + |
| +# Remove _CodeSignature for distribution |
| +rm -R out_ios_framework/WebRTC.framework/_CodeSignature |
|
tkchin_webrtc
2016/03/23 17:52:56
Does this work? Is code signature just that direct
hjon_webrtc
2016/03/25 00:09:46
From everything I've tested so far, it does seem t
|
| + |
| +# Combine multiple architectures |
| +lipo out_ios_framework/WebRTC.framework/WebRTC webrtc/build/ios/webrtc/WebRTC/build/Release-iphonesimulator/WebRTC.framework/WebRTC -create -output out_ios_framework/WebRTC.framework/WebRTC |
| + |
| +popd |