[macos][build] Validate dSYM and framework UUIDs

This commit is contained in:
Jason Wray
2016-09-30 16:24:00 -04:00
committed by Jason Wray
parent 161955209d
commit d7a44a6b90

View File

@@ -43,10 +43,31 @@ if [[ -e ${PRODUCTS}/${BUILDTYPE}/${NAME}.framework.dSYM ]]; then
fi
if [[ ${SYMBOLS} = NO ]]; then
step "Stripping binaries…"
step "Stripping symbols from binaries"
strip -Sx "${OUTPUT}/${NAME}.framework/${NAME}"
fi
function get_comparable_uuid {
echo $(dwarfdump --uuid ${1} | sed -n 's/.*UUID:\([^\"]*\) .*/\1/p' | sort)
}
function validate_dsym {
step "Validating dSYM and framework UUIDs…"
DSYM_UUID=$(get_comparable_uuid "${1}")
FRAMEWORK_UUID=$(get_comparable_uuid "${2}")
echo -e "${1}\n ${DSYM_UUID}\n${2}\n ${FRAMEWORK_UUID}"
if [[ ${DSYM_UUID} != ${FRAMEWORK_UUID} ]]; then
echo "Error: dSYM and framework UUIDs do not match."
exit 1
fi
}
if [[ ${BUILDTYPE} == Release ]]; then
validate_dsym \
"${OUTPUT}/${NAME}.framework.dSYM/Contents/Resources/DWARF/${NAME}" \
"${OUTPUT}/${NAME}.framework/${NAME}"
fi
step "Copying library resources…"
cp -pv LICENSE.md "${OUTPUT}"
cp -pv platform/macos/docs/pod-README.md "${OUTPUT}/README.md"