source ~/.bash_profile | |
cd ${SRCROOT} | |
xcodebuild clean | |
xcodebuild | xcpretty -r json-compilation-database | |
oclint-json-compilation-database -- -report-type xcode |
This comment has been minimized.
This comment has been minimized.
Error: compile_commands.json not found at current location.? |
This comment has been minimized.
This comment has been minimized.
Did anyone got this to work with xcode8? I am getting no compile_commands.json after running xcodebuild | xcpretty -r json-compilation-database all tools installed from brew |
This comment has been minimized.
This comment has been minimized.
For those getting the "compile_commands.json not found" error; my solution was to change
to
The --output parameter tells xcpretty to generate the compilation database JSON file in the same folder and with the filename that oclint expects, "compile_commands.json". By default, xcpretty generates a "commands_db.json" file under PROJECT_DIR/build/reports, which is why oclint-json-compilation-database can't seem to find it. |
This comment has been minimized.
This comment has been minimized.
not works on Xcode 8 :( .... @bsameh I got multiple target on my workspace |
This comment has been minimized.
This comment has been minimized.
I tried the following commands: But I got "Error: compile_commands.json not found at current location." for both in XCode. |
This comment has been minimized.
This comment has been minimized.
cp: build/reports/compilation_db.json: No such file or directory |
This comment has been minimized.
This comment has been minimized.
env: ruby_executable_hooks: No such file or directory |
This comment has been minimized.
This comment has been minimized.
Hi all, I was having trouble getting this script to work as well. @bsameh's solution helped, but I still needed to make some tweaks to the parameters for the Here's what the final script looks like (substituting
|
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
I was recently having some trouble getting this working on a project using Xcode 10 and OCLint 0.13.1. Here's a summary of some of the errors I saw and how I resolved them:
I've got a working version of the script that contains the above fixes in my fork. Also including it below (again, you will need to replace source ~/.bash_profile
unset LLVM_TARGET_TRIPLE_SUFFIX
xcodebuild -scheme <project_name> -workspace <project_name>.xcworkspace clean
xcodebuild -scheme <project_name> -workspace <project_name>.xcworkspace COMPILER_INDEX_STORE_ENABLE=NO | xcpretty -r json-compilation-database --output compile_commands.json
maxPriority=15000
oclint-json-compilation-database -exclude Pods -exclude build -- -report-type xcode -max-priority-1=$maxPriority -max-priority-2=$maxPriority -max-priority-3=$maxPriority |
This comment has been minimized.
This comment has been minimized.
worked with Xcode 11.2.1
|
This comment has been minimized.
.bash_profile: No such file or directory
getting shell script error?