Note: This build phase script should be added in all targets!
TARGET_NAMES=( ShowMe ShowMeDev ShowMeEnterprise )
PREV_TOTAL=0
for TARGET_NAME in "${TARGET_NAMES[@]}"; do
TOTAL=`XcodeProjectTargetCheck -xcproj ${SRCROOT}/ShowMe.xcodeproj -targets ${TARGET_NAME} | wc -l`
echo 'Target Name: '${TARGET_NAME} '- Total Files: '${TOTAL}
if [ "$PREV_TOTAL" -gt 0 ]; then
if [ "$TOTAL" != "$PREV_TOTAL" ]; then
echo "error: Target with name \"${TARGET_NAME}\" has a different number of files!"
exit 1
fi
fi
PREV_TOTAL=$TOTAL
done
This option should be checked to only run in archive mode: https://www.dropbox.com/s/lhryblvomfmbhmk/xcode_run_only_archive.png?dl=0
Download the Xcode project structure reader (XcodeProjectTargetCheck) https://www.dropbox.com/s/trk5wkvb4dy9t0t/XcodeProjectTargetCheck?dl=1
XcodeProjectTargetCheck
binary is generated from https://github.com/ConfusedVorlon/ProjectFileTool
Place it in the /usr/bin
folder and give execution permission if needed (chmod +x XcodeProjectTargetCheck
)