Xcode/SDL/pkg-support/codesign-frameworks.sh
author Sam Lantinga
Mon, 07 Jul 2014 23:48:21 -0700
changeset 8996 b8147002c991
parent 8995 d095e572e0d5
child 8997 9e23a50a63f7
permissions -rwxr-xr-x
Fixed supporting multiple frameworks
     1 #!/bin/sh
     2 
     3 # WARNING: You may have to run Clean in Xcode after changing CODE_SIGN_IDENTITY!
     4 
     5 # Verify that $CODE_SIGN_IDENTITY is set
     6 if [ -z "$CODE_SIGN_IDENTITY" ] ; then
     7     echo "CODE_SIGN_IDENTITY needs to be non-empty for codesigning frameworks!"
     8 
     9     if [ "$CONFIGURATION" = "Release" ] ; then
    10         exit 1
    11     else
    12         # Codesigning is optional for non-release builds.
    13         exit 0
    14     fi
    15 fi
    16 
    17 FRAMEWORK_DIR="${TARGET_BUILD_DIR}"
    18 
    19 # Loop through all frameworks
    20 FRAMEWORKS=`find "${FRAMEWORK_DIR}" -type d -name "*.framework" | sort -r`
    21 RESULT=$?
    22 if [[ $RESULT != 0 ]] ; then
    23     exit 1
    24 fi
    25 
    26 echo "Found: ${FRAMEWORKS}"
    27 
    28 for FRAMEWORK in $FRAMEWORKS;
    29 do
    30     echo "Signing '${FRAMEWORK}'"
    31     `codesign -f -v -s "${CODE_SIGN_IDENTITY}" "${FRAMEWORK}"`
    32     RESULT=$?
    33     if [[ $RESULT != 0 ]] ; then
    34         exit 1
    35     fi
    36 done