本文介绍了OCLint不在系统路径中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Xcode项目.我尝试将OcLint集成到其中.但是它说没有OCLint.如何下载OCLint并将其添加到系统路径中,以便可以将OCLint集成到我的xcode项目中.

I have an Xcode project. I tried to integrate OcLint in it. But it says there is no OCLint.How can I download and addOCLint to my system path so that I can integrateOCLint in my xcode project.

当我有一部分OCLint脚本作为

When I have a partof OCLint script as

hash oclint &> /dev/null
if [ $? -eq 1 ]; then
echo >&2 "oclint not found, analyzing stopped"
exit 1
fi

它给出oclint not found, analyzing stopped.

请给我一个解决方案.

推荐答案

您可以从以下网站下载oclint: http://archives.oclint.org/nightly/oclint-0.9.dev.02251e4-x86_64-darwin-14.0.0.tar.gz

You can download oclint from : http://archives.oclint.org/nightly/oclint-0.9.dev.02251e4-x86_64-darwin-14.0.0.tar.gz

要集成到您的xcode项目中,可以使用以下链接: http://docs.oclint.org/en/dev/guide/xcode.html

To integarte into your xcode project u could use this link :http://docs.oclint.org/en/dev/guide/xcode.html

下面是我用来生成html文件的脚本.

Below is the script I am using to generate html file.

OCLINT_HOME是oclint下载文件夹的路径.我已将文件夹重命名为oclintrelease.

OCLINT_HOME is the path for oclint downloaded folder. I have renamed the folder to 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中提供的路径.

Your report would be generated to the provided path in OCLINT_HOME using the above script.

如果要在派生数据文件夹中生成报告,则将最后一行替换为:

If you want to generate report in your derived data folder then replace the last line with :

oclint-json-compilation-database -v oclint_args "-report-type html -o report.html"

仅当构建成功并且可以在Xcode的Log Navigator中检查生成的报告路径和脚本报告时,才会生成HTML报告.

HTML report would be generated if and only if your build is successful and you can check your generated report path and script report into Log Navigator of Xcode.

这篇关于OCLint不在系统路径中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-10 14:44