3

我一直在尝试将 OCLint 添加到我的项目中,它主要适用于

cd ${SRCROOT}

xcodebuild clean
xcodebuild -target {TARGET} -configuration Debug -scheme {SCHEME} | tee ${TARGET_TEMP_DIR}/xcodebuild.log

cd ${TARGET_TEMP_DIR}
oclint-xcodebuild

cp ${TARGET_TEMP_DIR}/compile_commands.json ${SRCROOT}/compile_commands.json

cd ${TARGET_TEMP_DIR}
oclint-json-compilation-database -e -v -- -report-type xcode

问题是,我不想每次在 xcode 中构建项目时都必须在 runscript 中调用 xcodebuild 并运行 xcodebuild 两次。有没有人找到从 xcode 的 build 命令创建 xcodebuild.log 文件的方法?

我找到了有关转到 DerivedData/{Project}/Logs/Build 并解压缩驻留在那里的 .xactivitylog 文件的信息,但它包含大量垃圾,使 oclint-xcodebuild 命令构建一个空的 compile_commands.json 文件。

4

0 回答 0