I used the Script launch phase for some time and modified it so that the generated build warnings directly refer to the file and the line where the keyword was found.
The solution is to print a line that matches the ones that Xcode knows how to parse:
{filename}:{line}:{character}: warning: {The content of the warning}.
So, Script looks like this:
KEYWORDS="FIXME|TODO:|FIXME:|\?\?\?:|\!\!\!:\@todo\@warning" find "${SRCROOT}" \( -name "*.h" -or -name "*.m" \) -exec egrep -Hno "($KEYWORDS).*\$" {} \; | \ sed -e 's/^\([^:]\{1,\}\):\([0-9]\{1,\}\):\(.*\)$/\1:\2:1: warning: \3/'
Note that I also included @todo and @warning in the keywords, as I often use javadoc / doxygen comments.
Bertrand
source share