sonar-objective-c icon indicating copy to clipboard operation
sonar-objective-c copied to clipboard

oclint.xml not found.!

Open sarang1991 opened this issue 9 years ago • 21 comments

I am using objective-c plugin from github in sonar.In my project directory sonar-report/oclint is not created, when i executing sonar-runner. So that in sonar no violations listed. But when i manually executing commands like xcodebuild clean build > xcodebuild.log

oclint-xcodebuild

oclint-json-compilation-database -- -report-type pmd -o oclint.xml

i got oclint.xml. then i created a sonar-report folder in project directory and pasted oclint.xml. Then i got violations listed in my sonar. why file not found exception occures ? why no folder created ? how can i execute above three commands to generate oclint.xml ? wher to add those commands? please give your valuable suggestions.

sarang1991 avatar Jul 09 '15 10:07 sarang1991

having same issue here

hrskrs avatar Oct 12 '15 08:10 hrskrs

hi,What error you are getting ?i resolved my issues.

sarang1991 avatar Oct 13 '15 04:10 sarang1991

Hi, i am getting same error: Error processing file named /Users/Shared/Jenkins/Home/jobs/Sample App/workspace/sonar-reports/oclint.xml java.io.FileNotFoundException: /Users/Shared/Jenkins/Home/jobs/Sample App/workspace/sonar-reports/oclint.xml (No such file or directory)

link:http://stackoverflow.com/questions/33040509/error-processing-oclint-xml-on-jenkins

hrskrs avatar Oct 13 '15 06:10 hrskrs

Do onething. go to project directory where .xcodeproj exist.and then execute following commands.

=> xcodebuild clean build CODE_SIGN_IDENTITY=" " CODE_SIGNING_REQUIRED=NO > xcodebuild.log

=> oclint-xcodebuild -output compile_commands.json xcodebuild.log

=> oclint-json-compilation-database -- -max-priority-1 99999 -max-priority-2 99999 -max-priority-3 99999 -report-type pmd -o oclint.xml

let me know which are the files you are getting .

sarang1991 avatar Oct 13 '15 06:10 sarang1991

after executing: => xcodebuild clean build CODE_SIGN_IDENTITY=" " CODE_SIGNING_REQUIRED=NO > xcodebuild.log It shows these errors: The following build commands failed: Ld build/SampleApp.build/Release-iphoneos/SampleApp.build/Objects-normal/arm64/SampleApp normal arm64 Ld build/SampleApp.build/Release-iphoneos/SampleApp.build/Objects-normal/armv7/SampleApp normal armv7

I will do a clean setup of the project and will try your suggestion though

hrskrs avatar Oct 13 '15 07:10 hrskrs

did you get xcodebuild.log file ??

sarang1991 avatar Oct 13 '15 07:10 sarang1991

yeap i do get it. I tried proceeding further by executing second line and it generated compile_commands.json. However after i executed the third one it started to generate something(ex: 23 errors generated, 2 errors generated...) but it didn't generate oclint.xml report file

hrskrs avatar Oct 13 '15 07:10 hrskrs

try this oclint-json-compilation-database -- -report-type pmd -o oclint.xml

sarang1991 avatar Oct 13 '15 08:10 sarang1991

nope it won't generate oclint.xml file

hrskrs avatar Oct 13 '15 08:10 hrskrs

you got xcodebuild.log and compile_commands.json files ,huh ? try this plugin...

https://github.com/sarang1991/Sonar-Objective-C-plugin.git

sarang1991 avatar Oct 13 '15 08:10 sarang1991

yeah i got them but not oclint.xml

hrskrs avatar Oct 13 '15 09:10 hrskrs

did you have OClint installed in your pc ??

sarang1991 avatar Oct 13 '15 09:10 sarang1991

yeah ofc Oclint 0.8.1. fyi: Installed it with brew

hrskrs avatar Oct 13 '15 09:10 hrskrs

installed using these commands ??

  1. brew install caskroom/cask/brew-cask
  2. brew cask install oclint

sarang1991 avatar Oct 13 '15 09:10 sarang1991

nope, i installed through gist link provided: brew install 'gist oclint formula link'

hrskrs avatar Oct 13 '15 09:10 hrskrs

i hope it is an error of your current oclint.can you try to install using abouve commands ?

sarang1991 avatar Oct 13 '15 09:10 sarang1991

Installed and tried but it still won't generate clint.xml. Can it be related with cocoa framework? Project i am trying to analyse is using Cocoa Framework?

hrskrs avatar Oct 13 '15 09:10 hrskrs

can you share the compile_commands.json file ?

sarang1991 avatar Oct 13 '15 09:10 sarang1991

Oclint.xml has been created after some tries. Ill try to analyze and update you with info

hrskrs avatar Oct 13 '15 10:10 hrskrs

https://groups.google.com/forum/#!topic/oclint-users/5O-M868dq34

sarang1991 avatar Oct 13 '15 10:10 sarang1991

It is Reporting 0 violations now. Oclint.xml file is not being populated probably somehow. No violations are shown in Sonar. Probably same issue as here: https://github.com/octo-technology/sonar-objective-c/issues/85

hrskrs avatar Oct 13 '15 10:10 hrskrs