我想獲得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嗎?你也可以顯示你得到的構建消息。 –