Skip to end of metadata
Go to start of metadata

By SonarSource – SonarSource – Issue Tracker – Supported by SonarSource
More versions
SonarCFamily 5.1 – Feb 05, 2018 – SonarQube 6.7+ (Compatible with LTS)
Multithreaded analysis for fastest feedback, support of IAR compilers
I accept the Terms and ConditionsDownloadRelease notes

Description

Enables the powerful SonarCFamily for Objective-C analyzer.

 

Steps to Analyze an Objective-C Project

Step 1: Install the Plugin and License

Install the SonarCFamily plugin and apply your License Key.

Step 2: Install the SonarQube Scanner

Download and install the SonarQube Scanner for command line.

Step 3: Prepare your build environment

Analysis of Objective-C projects requires the SonarQube Build Wrapper. It gathers all the configuration required for correct analysis of Objective-C projects (defined macros, include directories, …) directly from your project's build process. The Build Wrapper does not impact your build; it merely eavesdrops on it. 

 You can download the Build Wrapper directly from your SonarQube Server, so that its version perfectly matches your version of the plugin:

Step 4: Build and analyze your project using the build wrapper

  1. Add execution of Build Wrapper as a prefix to the usual build command that you use to build your project (the example below uses xcodebuild, but any build tool that performs a full build can be used)
  2. Create a sonar-project.properties file at the root of your project and include the sample configuration shown below
  3. Execute the SonarQube scanner (sonar-scanner) from the root directory of the project
  4. Follow the link provided at the end of the analysis to browse your project's quality metrics in the SonarQube UI

 

Example command line

build-wrapper-macosx-x86-64 --out-dir bw_output xcodebuild clean build
sonar-scanner

Example sonar-project.properties file

sonar.projectKey=myFirstSonarQubeProject
sonar.projectName=My First SonarQube Project
sonar.projectVersion=1.0
sonar.sources=.
sonar.cfamily.build-wrapper-output=bw_output
sonar.sourceEncoding=UTF-8

Sample Project

Check our sample Objective-C project here.

Advanced Use

With SonarCFamily for Objective-C, you can also:

Check the FAQ, it may help to resolve common troubles.

  • No labels