[ios] Force workspace-relative DerivedData
A workspace places derived data under ~/Library/ by default. We need it to live under build/ for all users. Instead of a legacy-style build products directory, force a workspace-relative DerivedData directory that matches the standard Xcode 4+ layout. Share the workspace settings file that forces the setting. Note that Xcode places its build and index output one level deeper than xcodebuild does. Also fixed make ipackage-sim by conditionalizing anything related to the .dSYM file, which isn’t generated in the Debug configuration.
This commit is contained in:
5
Makefile
5
Makefile
@@ -41,6 +41,7 @@ test-osx: $(OSX_PROJ_PATH) $(OSX_PROJ_PATH)/xcshareddata/xcschemes/osxtest.xcsch
|
||||
|
||||
IOS_PROJ_PATH = build/ios-all/platform/ios/platform.xcodeproj
|
||||
IOS_WORK_PATH = platform/ios/ios.xcworkspace
|
||||
IOS_DERIVED_DATA_PATH = build/DerivedData/ios
|
||||
|
||||
$(IOS_PROJ_PATH): platform/ios/platform.gyp platform/ios/scripts/configure.sh mbgl.gypi test/test.gypi
|
||||
$(RUN) PLATFORM=ios Xcode/__project__
|
||||
@@ -48,6 +49,7 @@ $(IOS_PROJ_PATH): platform/ios/platform.gyp platform/ios/scripts/configure.sh mb
|
||||
ios: $(IOS_PROJ_PATH)
|
||||
set -o pipefail && xcodebuild \
|
||||
ARCHS=x86_64 ONLY_ACTIVE_ARCH=YES \
|
||||
-derivedDataPath $(IOS_DERIVED_DATA_PATH) \
|
||||
-configuration $(BUILDTYPE) -sdk iphonesimulator \
|
||||
-destination 'platform=iOS Simulator,name=iPhone 6,OS=latest' \
|
||||
-workspace $(IOS_WORK_PATH) -scheme CI build | xcpretty
|
||||
@@ -57,9 +59,10 @@ iproj: $(IOS_PROJ_PATH)
|
||||
|
||||
test-ios: ios
|
||||
ios-sim start --devicetypeid 'com.apple.CoreSimulator.SimDeviceType.iPhone-6,9.3'
|
||||
ios-sim launch build/ios-all/$(BUILDTYPE)-iphonesimulator/ios-test.app --verbose --devicetypeid 'com.apple.CoreSimulator.SimDeviceType.iPhone-6,9.3'
|
||||
ios-sim launch $(IOS_DERIVED_DATA_PATH)/Build/Products/$(BUILDTYPE)-iphonesimulator/ios-test.app --verbose --devicetypeid 'com.apple.CoreSimulator.SimDeviceType.iPhone-6,9.3'
|
||||
set -o pipefail && xcodebuild \
|
||||
ARCHS=x86_64 ONLY_ACTIVE_ARCH=YES \
|
||||
-derivedDataPath $(IOS_DERIVED_DATA_PATH) \
|
||||
-configuration $(BUILDTYPE) -sdk iphonesimulator \
|
||||
-destination 'platform=iOS Simulator,name=iPhone 6,OS=latest' \
|
||||
-workspace $(IOS_WORK_PATH) -scheme CI test | xcpretty
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>BuildLocationStyle</key>
|
||||
<string>UseAppPreferences</string>
|
||||
<key>CustomBuildLocationType</key>
|
||||
<string>RelativeToDerivedData</string>
|
||||
<key>DerivedDataCustomLocation</key>
|
||||
<string>../../build/DerivedData</string>
|
||||
<key>DerivedDataLocationStyle</key>
|
||||
<string>WorkspaceRelativePath</string>
|
||||
<key>IssueFilterStyle</key>
|
||||
<string>ShowActiveSchemeOnly</string>
|
||||
<key>LiveSourceIssuesEnabled</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -6,6 +6,8 @@ set -u
|
||||
|
||||
NAME=Mapbox
|
||||
OUTPUT=build/ios/pkg
|
||||
DERIVED_DATA=build/DerivedData/ios
|
||||
PRODUCTS=${DERIVED_DATA}/Build/Products
|
||||
|
||||
BUILDTYPE=${BUILDTYPE:-Release}
|
||||
BUILD_FOR_DEVICE=${BUILD_DEVICE:-true}
|
||||
@@ -84,6 +86,7 @@ fi
|
||||
xcodebuild \
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS=${GCC_GENERATE_DEBUGGING_SYMBOLS} \
|
||||
CURRENT_PROJECT_VERSION=${PROJ_VERSION} \
|
||||
-derivedDataPath ${DERIVED_DATA} \
|
||||
-workspace ./platform/ios/ios.xcworkspace \
|
||||
-scheme ${SCHEME} \
|
||||
-configuration ${BUILDTYPE} \
|
||||
@@ -94,6 +97,7 @@ if [[ ${BUILD_FOR_DEVICE} == true ]]; then
|
||||
xcodebuild \
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS=${GCC_GENERATE_DEBUGGING_SYMBOLS} \
|
||||
CURRENT_PROJECT_VERSION=${PROJ_VERSION} \
|
||||
-derivedDataPath ${DERIVED_DATA} \
|
||||
-workspace ./platform/ios/ios.xcworkspace \
|
||||
-scheme ${SCHEME} \
|
||||
-configuration ${BUILDTYPE} \
|
||||
@@ -111,22 +115,24 @@ if [[ "${BUILD_FOR_DEVICE}" == true ]]; then
|
||||
libtool -static -no_warning_for_no_symbols \
|
||||
`find mason_packages/ios-${IOS_SDK_VERSION} -type f -name libgeojsonvt.a` \
|
||||
-o ${OUTPUT}/static/${NAME}.framework/${NAME} \
|
||||
${LIBS[@]/#/build/ios-all/${BUILDTYPE}-iphoneos/libmbgl-} \
|
||||
${LIBS[@]/#/build/ios-all/${BUILDTYPE}-iphonesimulator/libmbgl-}
|
||||
${LIBS[@]/#/${PRODUCTS}/${BUILDTYPE}-iphoneos/libmbgl-} \
|
||||
${LIBS[@]/#/${PRODUCTS}/${BUILDTYPE}-iphonesimulator/libmbgl-}
|
||||
fi
|
||||
|
||||
if [[ ${BUILD_DYNAMIC} == true ]]; then
|
||||
step "Copying dynamic framework into place for iOS devices"
|
||||
cp -r \
|
||||
build/ios-all/${BUILDTYPE}-iphoneos/${NAME}.framework \
|
||||
${OUTPUT}/dynamic/
|
||||
cp -r build/ios-all/${BUILDTYPE}-iphoneos/${NAME}.framework.dSYM \
|
||||
${PRODUCTS}/${BUILDTYPE}-iphoneos/${NAME}.framework \
|
||||
${OUTPUT}/dynamic/
|
||||
if [[ -e ${PRODUCTS}/${BUILDTYPE}-iphoneos/${NAME}.framework.dSYM ]]; then
|
||||
cp -r ${PRODUCTS}/${BUILDTYPE}-iphoneos/${NAME}.framework.dSYM \
|
||||
${OUTPUT}/dynamic/
|
||||
fi
|
||||
|
||||
step "Merging simulator dynamic library into device dynamic library…"
|
||||
lipo \
|
||||
build/ios-all/${BUILDTYPE}-iphoneos/${NAME}.framework/${NAME} \
|
||||
build/ios-all/${BUILDTYPE}-iphonesimulator/${NAME}.framework/${NAME} \
|
||||
${PRODUCTS}/${BUILDTYPE}-iphoneos/${NAME}.framework/${NAME} \
|
||||
${PRODUCTS}/${BUILDTYPE}-iphonesimulator/${NAME}.framework/${NAME} \
|
||||
-create -output ${OUTPUT}/dynamic/${NAME}.framework/${NAME} | echo
|
||||
fi
|
||||
else
|
||||
@@ -136,16 +142,18 @@ else
|
||||
libtool -static -no_warning_for_no_symbols \
|
||||
`find mason_packages/ios-${IOS_SDK_VERSION} -type f -name libgeojsonvt.a` \
|
||||
-o ${OUTPUT}/static/${NAME}.framework/${NAME} \
|
||||
${LIBS[@]/#/build/ios-all/${BUILDTYPE}-iphonesimulator/libmbgl-}
|
||||
${LIBS[@]/#/${PRODUCTS}/${BUILDTYPE}-iphonesimulator/libmbgl-}
|
||||
fi
|
||||
|
||||
if [[ ${BUILD_DYNAMIC} == true ]]; then
|
||||
step "Copying dynamic framework into place for iOS Simulator…"
|
||||
cp -r \
|
||||
build/ios-all/${BUILDTYPE}-iphonesimulator/${NAME}.framework \
|
||||
${PRODUCTS}/${BUILDTYPE}-iphonesimulator/${NAME}.framework \
|
||||
${OUTPUT}/dynamic/${NAME}.framework
|
||||
cp -r build/ios-all/${BUILDTYPE}-iphonesimulator/${NAME}.framework.dSYM \
|
||||
${OUTPUT}/dynamic/
|
||||
if [[ -e ${PRODUCTS}/${BUILDTYPE}-iphonesimulator/${NAME}.framework.dSYM ]]; then
|
||||
cp -r ${PRODUCTS}/${BUILDTYPE}-iphonesimulator/${NAME}.framework.dSYM \
|
||||
${OUTPUT}/dynamic/
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -168,9 +176,9 @@ fi
|
||||
|
||||
if [[ ${BUILD_STATIC} == true ]]; then
|
||||
step "Copying static library headers…"
|
||||
cp -rv "build/ios-all/${BUILDTYPE}-iphoneos/Headers" "${OUTPUT}/static/${NAME}.framework/Headers"
|
||||
cp -rv "${PRODUCTS}/${BUILDTYPE}-iphoneos/Headers" "${OUTPUT}/static/${NAME}.framework/Headers"
|
||||
cat platform/ios/framework/Mapbox-static.h > "${OUTPUT}/static/${NAME}.framework/Headers/Mapbox.h"
|
||||
cat "build/ios-all/${BUILDTYPE}-iphoneos/Headers/Mapbox.h" >> "${OUTPUT}/static/${NAME}.framework/Headers/Mapbox.h"
|
||||
cat "${PRODUCTS}/${BUILDTYPE}-iphoneos/Headers/Mapbox.h" >> "${OUTPUT}/static/${NAME}.framework/Headers/Mapbox.h"
|
||||
fi
|
||||
|
||||
step "Copying library resources…"
|
||||
|
||||
Reference in New Issue
Block a user