我想获得OCLint iOS项目的工作。我已经使用Brew安装了OCLint并且它已经正确安装(我可以通过运行oclint命令来检查终端)。OCLint与Xcode空报告
我试图通过创建一个单独的目标(tutorial here)并创建一个新的运行脚本来整合它。当我构建新目标时,它会生成一个report.html文件,但它没有扫描任何文件,Total Files = 0:/
如何获取它以扫描我的项目?非常感谢。
我的脚本如下:
OCLINT_HOME=/Users/johndoe/Documents/Programs/oclint-0.8.1
export PATH=$OCLINT_HOME/bin:$PATH
hash oclint &> /dev/null
if [ $? -eq 1 ]; then
echo >&2 "oclint not found, analyzing stopped"
exit 1
fi
cd ${TARGET_TEMP_DIR}
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
#build xcodebuild.log
xcodebuild | tee ${TARGET_TEMP_DIR}/xcodebuild.log
#xcodebuild <options>| tee ${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
fi
echo "[*] starting analyzing"
cd ${TARGET_TEMP_DIR}
oclint-json-compilation-database -v oclint_args "-report-type html -o $OCLINT_HOME/report.html"
你试过用oclint 0.9吗?你也可以显示你得到的构建消息。 –