我有一个Xcode项目。我试图将OcLint集成到其中。但是它说没有OCLint.How,我可以下载并添加OCLint到我的系统路径,这样我就可以在我的xcode项目中集成OCLint。
编辑:
当我有一部分OCLint脚本时
hash oclint &> /dev/null
if [ $? -eq 1 ]; then
echo >&2 "oclint not found, analyzing stopped"
exit 1
fi它给了oclint not found, analyzing stopped。
请给我一个解决办法。
发布于 2015-05-05 12:35:04
您可以从:64-darwin-14.0.0.tar.gz下载oclint。
要在xcode项目中进行整数运算,可以使用以下链接:http://docs.oclint.org/en/dev/guide/xcode.html
下面是我用来生成html文件的脚本。
OCLINT_HOME是oclint下载文件夹的路径。我已将文件夹重命名为oclintrelease。
OCLINT_HOME=/Users/Dheeraj/Downloads/oclintrelease
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_HOME中提供的路径。
如果要在派生数据文件夹中生成报表,请将最后一行替换为:
oclint-json-compilation-database -v oclint_args "-report-type html -o report.html"只有在构建成功的情况下才会生成HTML报告,并且您可以将生成的报表路径和脚本报表检查到Xcode的Log中。
https://stackoverflow.com/questions/30052686
复制相似问题