Skip to content

Instantly share code, notes, and snippets.

@edwardean
Created July 28, 2018 14:28
Show Gist options
  • Save edwardean/a3310e55ecc941217fe3c7d3e1f86574 to your computer and use it in GitHub Desktop.
Save edwardean/a3310e55ecc941217fe3c7d3e1f86574 to your computer and use it in GitHub Desktop.
xcode-enhancement-scripts
# Under the projects folder -> Build Phases -> click on add new build phase on top left corner -> select New Run Script Phase
# Select the Run Script from the dropdown of Build Phase
# let the Shell be the default (/bin/sh)
# Paste below code in the place provided
# This code run every time the project is build
# To create warning (TODO, FIXME) & error msgs (ERROR) comment tags
TAGS="TODO|FIXME"
ERRORTAG="ERROR"
find "${SRCROOT}" \( -name "*.h" -or -name "*.m" -or -name "*.swift" \) -print0 | \
xargs -0 egrep --with-filename --line-number --only-matching "($TAGS).*\$|($ERRORTAG).*\$" | \
perl -p -e "s/($TAGS)/ warning: \$1/" | perl -p -e "s/($ERRORTAG)/ error: \$1/"
# without the EROOR Msgs
TAGS="TODO|FIXME"
find "${SRCROOT}" \( -name "*.h" -or -name "*.m" -or -name "*.swift" \) -print0 | \
xargs -0 egrep --with-filename --line-number --only-matching "($TAGS).*\$" | \
perl -p -e "s/($TAGS)/ warning: \$1/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment