Skip to content

Instantly share code, notes, and snippets.

@byaruhaf
Forked from Ashton-W/RevealBuildPhase.sh
Created December 13, 2020 02:27
Show Gist options
  • Select an option

  • Save byaruhaf/3f566f359bda1d842732d4d19beb3497 to your computer and use it in GitHub Desktop.

Select an option

Save byaruhaf/3f566f359bda1d842732d4d19beb3497 to your computer and use it in GitHub Desktop.
Build Phase Script for copying and signing libReveal in Debug Configuration
#!/usr/bin/env bash
# Build Phase Script for copying and signing libReveal based on Configuration
# https://gist.github.com/Ashton-W/6db611ac93be2f8bad7f
set -o errexit
set -o nounset
LIBREVEAL_PATH="/Applications/Reveal.app/Contents/SharedSupport/iOS-Libraries/libReveal.dylib"
INJECT_REVEAL="${INJECT_REVEAL:-NO}"
#
copy_library() {
cp -vRf "$LIBREVEAL_PATH" "${CODESIGNING_FOLDER_PATH}/libReveal.dylib"
}
#
codesign_library() {
if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" ]; then
codesign -fs "${EXPANDED_CODE_SIGN_IDENTITY}" "${CODESIGNING_FOLDER_PATH}/libReveal.dylib"
fi
}
#
main() {
if [ "${INJECT_REVEAL}" == "YES" ]; then
if [ -e $LIBREVEAL_PATH ]; then
copy_library && codesign_library
echo "Reveal library copied (INJECT_REVEAL=YES)"
else
echo "Reveal library not found at: $LIBREVEAL_PATH"
echo "set LIBREVEAL_PATH to correct"
fi
else
echo "Did not copy Reveal library (Build Setting INJECT_REVEAL=NO or not set)"
fi
}
main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment