Skip to content

Instantly share code, notes, and snippets.

@ManWithBear
Created November 8, 2016 10:14
Show Gist options
  • Save ManWithBear/2adc2b9609ce39471d70ead81201be25 to your computer and use it in GitHub Desktop.
Save ManWithBear/2adc2b9609ce39471d70ead81201be25 to your computer and use it in GitHub Desktop.
OCLint script for xcode
if [ -f ~/.bash_profile ]; then
source ~/.bash_profile
fi
hash oclint &> /dev/null
if [ $? -eq 1 ]; then
echo >&2 "oclint not found, analyzing stopped"
exit 1
fi
cd ${SRCROOT}
xcodebuild -target <Put here target> -configuration <Debug|Release> -scheme <Put here scheme> -dry-run | xcpretty -r json-compilation-database
oclint-json-compilation-database -- -report-type xcode
@JesusMartinAlonso
Copy link

JesusMartinAlonso commented Nov 21, 2016

For make this script works in xCode 8 I had to add the --output compile_commands.json option to xcpretty command

@ManWithBear
Copy link
Author

It's weird, I already using it on Xcode 8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment