Skip to content

Latest commit

 

History

History
executable file
·
43 lines (37 loc) · 1.06 KB

codesign-frameworks.sh

File metadata and controls

executable file
·
43 lines (37 loc) · 1.06 KB
 
1
2
#!/bin/sh
Jul 8, 2014
Jul 8, 2014
3
# WARNING: You may have to run Clean in Xcode after changing CODE_SIGN_IDENTITY!
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Verify that $CODE_SIGN_IDENTITY is set
if [ -z "$CODE_SIGN_IDENTITY" ] ; then
echo "CODE_SIGN_IDENTITY needs to be non-empty for codesigning frameworks!"
if [ "$CONFIGURATION" = "Release" ] ; then
exit 1
else
# Codesigning is optional for non-release builds.
exit 0
fi
fi
FRAMEWORK_DIR="${TARGET_BUILD_DIR}"
# Loop through all frameworks
Jul 8, 2014
Jul 8, 2014
20
FRAMEWORKS=`find "${FRAMEWORK_DIR}" -type d -name "*.framework" | sort -r`
21
22
23
24
25
26
27
RESULT=$?
if [[ $RESULT != 0 ]] ; then
exit 1
fi
for FRAMEWORK in $FRAMEWORKS;
do
Jul 8, 2014
Jul 8, 2014
28
29
30
31
32
33
34
35
36
if [[ "$CONFIGURATION" = "Release" ]]; then
echo "Stripping '${FRAMEWORK}'"
NAME=$(basename "${FRAMEWORK}" .framework)
xcrun strip -x "${FRAMEWORK}/${NAME}"
RESULT=$?
if [[ $RESULT != 0 ]] ; then
exit 1
fi
fi
37
echo "Signing '${FRAMEWORK}'"
Jul 8, 2014
Jul 8, 2014
38
codesign -f -v -s "${CODE_SIGN_IDENTITY}" "${FRAMEWORK}"
39
40
41
42
43
RESULT=$?
if [[ $RESULT != 0 ]] ; then
exit 1
fi
done