Skip to content

Commit 2600a02

Browse files
committed
builds dynamic framworks
1 parent 90bb8b7 commit 2600a02

File tree

3 files changed

+89
-0
lines changed

3 files changed

+89
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//
2+
// Put this file alongside to the other both, as it contains what
3+
// both have in common. Don't rename this file.
4+
//
5+
// Copyright (c) 2014-2015 Marius Rackwitz. All rights reserved.
6+
//
7+
8+
// Make it universal
9+
SUPPORTED_PLATFORMS = iphonesimulator iphoneos
10+
VALID_ARCHS[sdk=iphoneos*] = arm64 armv7 armv7s
11+
VALID_ARCHS[sdk=iphonesimulator*] = i386 x86_64
12+
13+
// Dynamic linking uses different default copy paths
14+
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
15+
16+
DYLIB_INSTALL_NAME_BASE = @rpath
17+
18+
MACH_O_TYPE = mh_dylib
19+
CLANG_MODULES_AUTOLINK = YES
20+
IPHONEOS_DEPLOYMENT_TARGET = 8.0
21+
ONLY_ACTIVE_ARCH = NO
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//
2+
// Put this file alongside to the other both, as it contains what
3+
// both have in common. Don't rename this file.
4+
//
5+
// Copyright (c) 2014-2015 Marius Rackwitz. All rights reserved.
6+
//
7+
8+
// Make it universal
9+
SUPPORTED_PLATFORMS = iphonesimulator iphoneos
10+
VALID_ARCHS = arm64 armv7 armv7s i386 x86_64
11+
12+
// Dynamic linking uses different default copy paths
13+
LD_RUNPATH_SEARCH_PATHS[sdk=iphoneos*] = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
14+
LD_RUNPATH_SEARCH_PATHS[sdk=iphonesimulator*] = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
15+
16+
DYLIB_INSTALL_NAME_BASE = @rpath
17+
18+
MACH_O_TYPE = mh_dylib
19+
OTHER_LDFLAGS = $(inherited) '-dynamiclib' '-lsqlite3'
20+
CLANG_MODULES_AUTOLINK = YES
21+
IPHONEOS_DEPLOYMENT_TARGET = 8.0
22+
ONLY_ACTIVE_ARCH = NO

Scripts/build_ios_dynamic_lib.sh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
2+
WORKSPACE=./Parse.xcworkspace
3+
SCHEME=Parse-iOS
4+
CONFIGURATION=Release
5+
BUILD_DIR=./build
6+
7+
FRAMEWORK_NAME=Parse
8+
9+
SIMULATOR_LIBRARY_PATH="${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${FRAMEWORK_NAME}.framework"
10+
DEVICE_LIBRARY_PATH="${BUILD_DIR}/${CONFIGURATION}-iphoneos/${FRAMEWORK_NAME}.framework"
11+
UNIVERSAL_LIBRARY_DIR="${BUILD_DIR}/ios"
12+
FRAMEWORK="${UNIVERSAL_LIBRARY_DIR}/${FRAMEWORK_NAME}.framework"
13+
14+
export XCODE_XCCONFIG_FILE=$(pwd)/Configurations/Bolts-iOS-module.xcconfig
15+
16+
rm -rf "./Vendor/Bolts-ObjC/build/*"
17+
18+
./Scripts/build_third_party.rb ./Vendor/Bolts-ObjC/ "Vendor/Bolts-ObjC/scripts/build_framework.sh -n -c Release" | xcpretty
19+
20+
export XCODE_XCCONFIG_FILE=$(pwd)/Configurations/Parse-iOS-module.xcconfig
21+
22+
xcodebuild -workspace ${WORKSPACE} -scheme ${SCHEME} -configuration ${CONFIGURATION} BUILD_DIR=${BUILD_DIR} | xcpretty
23+
xcodebuild -workspace ${WORKSPACE} -scheme ${SCHEME} -configuration ${CONFIGURATION} -destination 'platform=iOS Simulator,name=iPhone 6,OS=8.1' BUILD_DIR=${BUILD_DIR} | xcpretty
24+
25+
rm -rf "${UNIVERSAL_LIBRARY_DIR}"
26+
27+
mkdir "${UNIVERSAL_LIBRARY_DIR}"
28+
29+
mkdir "${FRAMEWORK}"
30+
31+
32+
cp -r "${DEVICE_LIBRARY_PATH}/." "${FRAMEWORK}"
33+
lipo "${SIMULATOR_LIBRARY_PATH}/${FRAMEWORK_NAME}" "${DEVICE_LIBRARY_PATH}/${FRAMEWORK_NAME}" -create -output "${FRAMEWORK}/${FRAMEWORK_NAME}" | echo
34+
# For Swift framework, Swiftmodule needs to be copied in the universal framework
35+
if [ -d "${SIMULATOR_LIBRARY_PATH}/Modules/${FRAMEWORK_NAME}.swiftmodule/" ]; then
36+
cp -f ${SIMULATOR_LIBRARY_PATH}/Modules/${FRAMEWORK_NAME}.swiftmodule/*
37+
"${FRAMEWORK}/Modules/${FRAMEWORK_NAME}.swiftmodule/" | echo
38+
fi
39+
40+
if [ -d "${DEVICE_LIBRARY_PATH}/Modules/${FRAMEWORK_NAME}.swiftmodule/" ]; then
41+
cp -f ${DEVICE_LIBRARY_PATH}/Modules/${FRAMEWORK_NAME}.swiftmodule/* "${FRAMEWORK}/Modules/${FRAMEWORK_NAME}.swiftmodule/" | echo
42+
fi
43+
44+
cp -r "./Vendor/Bolts-ObjC/build/ios/Bolts.framework" "${UNIVERSAL_LIBRARY_DIR}"
45+
46+
echo 'Bolts.framework and Parse.framework are in ./build/ios'

0 commit comments

Comments
 (0)