0

I have been working on setting up SonarQube for and iOS Project implemented with Objective-C. Used OCLint for setting up the tool.

It was success when I tried to setup the SonarQube for simple Xcode project and I'm failing while setting it up for an Xcode project having workspace with multiple .xcodeproj files.

The warning that displaying while running the run-sonar.sh file in terminal is that,

Running OCLint...Skipping /Users/alex/Desktop/DemoWorkSpaceApp/SonarSampleWokspaceApp/. Compile command not found.

After completing the run-sonar.sh run process, the sonar dashboard for the project issues area is displaying all the counts as 0. As in this image

Here is the sonar-project.properties file content.

red metadata
sonar.projectKey=com.qb.SonarSampleWokspaceApp.SonarSampleWokspaceApp

sonar.projectName=SonarSampleWokspaceApp
sonar.projectVersion=1.0

# optional description
sonar.projectDescription=Interns project on Wear

# path to source directories (required)
sonar.sources=/Users/alex/Desktop/DemoWorkSpaceApp/SonarSampleWokspaceApp

# The value of the property must be the key of the language.
sonar.language=objc

# Xcode project configuration
sonar.objectivec.workspace=SonarSampleWokspaceApp.xcworkspace
sonar.objectivec.projects=SonarSampleWokspaceApp.xcodeproj
sonar.objectivec.appScheme=SonarSampleWokspaceApp

# Encoding of the source code
sonar.sourceEncoding=UTF-8

# JUnit report generated by run-sonar.sh is stored in sonar-reports/TEST-report.xml
# Change it only if you generate the file on your own
# The XML files have to be prefixed by TEST- otherwise they are not processed 
sonar.junit.reportsPath=sonar-reports/

# Paths to exclude from coverage report (tests, 3rd party libraries etc.)
#sonar.objectivec.excludedPathsFromCoverage=.*Tests.*

And this is the folder structure of the project.enter image description here

I'm running the run-sonar.sh file in terminal using Alexs-Mac:SonarSampleWokspaceApp alex$ sudo ./run-sonar.sh

Anybody please help to figure out this issue of Compile command not found with the OCLint.

Alex Andrews
  • 1,498
  • 2
  • 19
  • 33
  • try running `sh run-sonar.sh -v` and `sonar-runner -X` and post the error stack so we can identify the error easier – hrskrs Nov 17 '15 at 08:35
  • hi @hrskrs, Thanks man. I tacked down the issue with the help of sh run-sonar.sh -v command for running the run-sonar.sh file. It was actually problem while preparing relative path for the target files. Updated the path in the sonar-properties file and now everything okay... Thanks for the great help. :) – Alex Andrews Nov 17 '15 at 09:27
  • For the sake of marking this question as solved i have added the comment as an answer – hrskrs Nov 17 '15 at 09:52

1 Answers1

2

Your configuration looks ok. Probably there is some path mistake.

Track your problem by running:

sh run-sonar.sh -v

which will also activate verbose logs. If that wont help you find your problem, try running:

sonar-runner -X

which will show full stack trace

hrskrs
  • 4,447
  • 5
  • 38
  • 52