[ios] fixes #4536 include podspec for static framework (#5653)

* [ios] fixes #4536 include podspec for static framework

* [ios] removed excessive frameworks, libraries and flags from the static podspec

* [ios] cleaned up the podspec
This commit is contained in:
Fredrik Karlsson
2016-07-14 11:30:20 +02:00
committed by GitHub
parent 0d065af410
commit c531686ecc
2 changed files with 28 additions and 9 deletions

View File

@@ -0,0 +1,11 @@
m.ios.deployment_target = '7.0'
m.requires_arc = true
m.preserve_paths = '**'
m.source_files = 'Headers/*.h', 'MGLDummy.m'
m.resource_bundle = { 'Mapbox' => 'Mapbox.bundle/*' }
m.vendored_frameworks = 'Mapbox.framework'
m.module_name = 'Mapbox'
end

View File

@@ -178,24 +178,32 @@ if [[ "${GCC_GENERATE_DEBUGGING_SYMBOLS}" == false ]]; then
fi
fi
function create_local_podspec {
step "Creating local podspec"
function create_podspec {
step "Creating local podspec (${1})"
[[ $SYMBOLS = YES ]] && POD_SUFFIX="-symbols" || POD_SUFFIX=""
POD_SOURCE_PATH=' :path => ".",'
POD_FRAMEWORKS=" m.vendored_frameworks = '"${NAME}".framework'"
[[ $SYMBOLS = YES ]] && POD_SUFFIX="-symbols" || POD_SUFFIX=""
POD_LOCALSPEC=${OUTPUT}/$1/${NAME}-iOS-SDK${POD_SUFFIX}.podspec
sed "s/.*:http.*/${POD_SOURCE_PATH}/" platform/ios/${NAME}-iOS-SDK${POD_SUFFIX}.podspec > ${POD_LOCALSPEC}
sed -i.bak "s/.*vendored_frameworks.*/${POD_FRAMEWORKS}/" ${POD_LOCALSPEC}
rm -rf ${POD_LOCALSPEC}.bak
cp -pv LICENSE.md ${OUTPUT}/$1/
INPUT_PODSPEC=platform/ios/${NAME}-iOS-SDK${POD_SUFFIX}.podspec
OUTPUT_PODSPEC=${OUTPUT}/${1}/${NAME}-iOS-SDK${POD_SUFFIX}.podspec
if [[ ${1} == "dynamic" ]]; then
sed "s/.*:http.*/${POD_SOURCE_PATH}/" ${INPUT_PODSPEC} > ${OUTPUT_PODSPEC}
sed -i '' "s/.*vendored_frameworks.*/${POD_FRAMEWORKS}/" ${OUTPUT_PODSPEC}
fi
if [[ ${1} == "static" ]]; then
awk '/Pod::Spec.new/,/m.platform/' ${INPUT_PODSPEC} > ${OUTPUT_PODSPEC}
cat platform/ios/${NAME}-iOS-SDK-static-part.podspec >> ${OUTPUT_PODSPEC}
sed -i '' "s/.*:http.*/${POD_SOURCE_PATH}/" ${OUTPUT_PODSPEC}
fi
cp -pv LICENSE.md ${OUTPUT}/${1}/
}
if [[ ${BUILD_STATIC} == true ]]; then
stat "${OUTPUT}/static/${NAME}.framework"
create_podspec "static"
fi
if [[ ${BUILD_DYNAMIC} == true ]]; then
stat "${OUTPUT}/dynamic/${NAME}.framework"
create_local_podspec "dynamic"
create_podspec "dynamic"
fi
if [[ ${BUILD_STATIC} == true ]]; then