octo-technology / sonar-objective-c

Sonar Plugin for Objective C
517 stars 206 forks source link

Adding support for white spaces in directories #54

Closed vdesaintpern closed 9 years ago

vdesaintpern commented 10 years ago

Adding support for specific test configuration + potential white spaces in directories : -> if your configuration was called "Unit Test" for example the script crashed (miserably). -> if you had a specific configuration for unit testing (different from the one you use for running : typically Debug), this was trying to look for gcda files in the Debug/$project.build folder. This now generates the compile-command.json out of the test scheme build configuration where the GCDA will sit when the tests are done.

////// OLD Commented workaround for flawed compile-commands.json with OCLINT : Some versions of xctool don't generate a compile-commands.json or generate a flawed one. Didn't take time to list the flawed versions of xctool or investigate more. Found a workaround building the app up manually with xcodebuild which is acceptable in my case.

Hint for surefire not picking up junit reports : Default sonarqube setup comes with surefire plugin 1.5. This doesn't support the property : sonar.junit.reportsPath. You've got to go with : sonar.surefire.reportsPath=sonar-reports/ Plus for some reason I didn't take time to investigate, it looks like with version 2.3 you need both properties... ////// OLD

cyrilpicat commented 10 years ago

thanks for your feedback, I think your points are valid. Could you start by doing different pull requests, one by issue?

Otherwise, to give a quick feedback: 1/ white space and configurations: ok I think it's all valid, you can make a PR or I will extract it, as you prefer. 2/ flawed compile-commands.json: I think I will need more insights on this one. Is it the case with the last version of xctool? As xctool will still be needed for running tests, I think it's important to fix that on the xctool side, don't you think? 3/ surefire: this should have been fixed in the trunk following partial fix for issue #50. Can you download the current build and check this?

cyrilpicat commented 10 years ago

by the way, do you think your issue with xctool is the same as #48? Is it only the 'compilation-database' xctool command that is failing? Or also the test command is failing?

Does the modified run-sonar.sh provided in this Gist (https://gist.github.com/xndou/7990501) fix your issue? If yes, I might change the approach and ony keep xctool for the test phase, yes.

vdesaintpern commented 10 years ago

Thanks! Sounds good to me. So, this means you only need line 243 and 263 in the run-sonar.sh. I'm sorry I'm quite new to pull requests. How can I just "cherry-pick" just these 2 lines and create a new pull request ? Do I need to-refork and commit again these 2 lines separately? Is there an easy way to do it? Thanks.

cyrilpicat commented 10 years ago

You can either create a new branch, cherry pick your commit 749a0bb and make a new pull request or you can revert your other commits in your current branch and submit again your pull request.

By looking at your other commits, I also saw you are passing arguments to OCLint through the command line. Will the enhancements #33 and #36 fix this issue?

vdesaintpern commented 10 years ago

Looks like it's working. Tell me if it looks good to you. Thanks.