Created
February 2, 2017 09:46
-
-
Save dominik-hadl/2df890a021ada999bda383b8413c9473 to your computer and use it in GitHub Desktop.
A script meant to be used as Xcode build phase to detect todo and fixme and output warnings and errors.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TODO_PROJECT_NAME="YourProject" | |
if [ $CONFIGURATION = "Release" ]; then | |
TAGS="FIXME" | |
find "${SRCROOT}/${TODO_PROJECT_NAME}" \( -name "*.swift" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($TAGS).*\$" | perl -p -e "s/($TAGS)/ error: \$1/" | |
TAGS="TODO" | |
find "${SRCROOT}/${TODO_PROJECT_NAME}" \( -name "*.swift" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($TAGS).*\$" | perl -p -e "s/($TAGS)/ warning: \$1/" | |
else | |
TAGS="FIXME|TODO" | |
find "${SRCROOT}/${TODO_PROJECT_NAME}" \( -name "*.swift" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($TAGS).*\$" | perl -p -e "s/($TAGS)/ warning: \$1/" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment