Created
December 5, 2013 22:21
-
-
Save alanf/7815067 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
PATH=$PATH:'~/bin/' | |
PATH=$PATH:'/usr/bin/' | |
echo $PATH | |
hash oclint &> /dev/null | |
if [ $? -eq 1 ]; then | |
echo >&2 "oclint not found, analyzing stopped" | |
exit 1 | |
fi | |
cd ${TARGET_TEMP_DIR} | |
rm compile_commands.json | |
if [ ! -f compile_commands.json ]; then | |
echo "[*] compile_commands.json not found, possibly clean was performed" | |
echo "[*] starting xcodebuild to rebuild the project.." | |
# clean previous output | |
if [ -f xcodebuild.log ]; then | |
rm xcodebuild.log | |
fi | |
cd ${SRCROOT} | |
xcodebuild clean -target lintapp -configuration Debug -scheme lintapp | |
#build xcodebuild.log | |
xcodebuild -target lintapp -configuration Debug -scheme lintapp | tee ${TARGET_TEMP_DIR}/xcodebuild.log | |
#xcodebuild <options>| tee ${TARGET_TEMP_DIR}/xcodebuild.log | |
echo ${TARGET_TEMP_DIR}/xcodebuild.log | |
echo "[*] transforming xcodebuild.log into compile_commands.json..." | |
cd ${TARGET_TEMP_DIR} | |
#transform it into compile_commands.json | |
oclint-xcodebuild | |
echo "[*] copy compile_commands.json to the project root..." | |
cp ${TARGET_TEMP_DIR}/compile_commands.json ${SRCROOT}/compile_commands.json | |
fi | |
echo "[*] starting analyzing" | |
cd ${TARGET_TEMP_DIR} | |
oclint-json-compilation-database | sed 's/\(.*\.\m\{1,2\}:[0-9]*:[0-9]*:\)/\1 warning:/' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment