Skip to content

Instantly share code, notes, and snippets.

@tylermilner
Forked from ryuichis/gist:755e6297aec13c900cdf
Last active March 12, 2019 19:00
Show Gist options
  • Save tylermilner/287e9eb60dc8bc6b9da77760b16b6c98 to your computer and use it in GitHub Desktop.
Save tylermilner/287e9eb60dc8bc6b9da77760b16b6c98 to your computer and use it in GitHub Desktop.
Script integrating OCLint into Xcode 10. Put it in "Run script" build phase of aggregate target (see http://docs.oclint.org/en/stable/guide/xcode.html). Replace "<project_name>" and tweak "exclude" flags as necessary.
source ~/.bash_profile
unset LLVM_TARGET_TRIPLE_SUFFIX
xcodebuild -scheme <project_name> -workspace <project_name>.xcworkspace clean
xcodebuild -scheme <project_name> -workspace <project_name>.xcworkspace COMPILER_INDEX_STORE_ENABLE=NO | xcpretty -r json-compilation-database --output compile_commands.json
maxPriority=15000
oclint-json-compilation-database -exclude Pods -exclude build -- -report-type xcode -max-priority-1=$maxPriority -max-priority-2=$maxPriority -max-priority-3=$maxPriority
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment