OCLint without running xcodebuild in run script

402 Views Asked by At

I've been trying to add OCLint to my project and it mostly works with

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

The problem is, I don't want to have to call xcodebuild in a runscript and be running xcodebuild twice whenever I build my project in xcode. Has anyone found a way to create the xcodebuild.log file from xcode's build command?

I've found information on going to the DerivedData/{Project}/Logs/Build and unzipping the .xactivitylog file that resides there, but it contains a lot of garbage that makes the oclint-xcodebuild command build an empty compile_commands.json file.

0

There are 0 best solutions below