The Jenkins Clang Scan-Build Plugin have not been updated for years. I fixed existing bugs to make it usable in Xcode 5,6 and latest clang-static-analyzer. I have published on Github, you could check out for more details.
Fixed Bugs:
- Fix “404 not found” bug when click “Details” in scan-build bug report
- Fix incorrect logic of finding xcode workspace
- added default argument for
scan-build
andxcodebuild
additional arguments- added
--use-analyzer Xcode
in scan-build additional arguments: this would make scan-build use clang executable from Xcode instead of its own - added
-derivedDataPath $WORKSPACE/build
in xcodebuild additional arguments: this will save build products and other derived data to ‘build’ directory under current worksapce
- added
How to use:
git clone https://github.com/truebit/clang-scanbuild-plugin.git
cd clang-scanbuild-plugin
mvn clean package -Dmaven.test.skip=true
- find
clang-scanbuild-plugin.hpi
intarget
directory - upload this .hpi file via
"Manage Plugins">"Advanced">"Upload Plugin"
- restart Jenkins to update the plugin
Setting in Jenkins job:
- Add build step “Clang Scan-Build”, example below:
- As above image displays, you can leave workspace empty, thus the plugin would search workspace location in Xcode project directory ( a.k.a the jenkins workspace directory plus “Xcode project sub-path”)
- Add post-build action: “Publish Clang Scan-Build Results”
Any concerns, you could fire an issue 🙂