Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SonarQube integration with XCode

I have a remote server where I've deployed a SonarQube system, for tracking the quality of the code, and want to integrate Android Studio and Xcode with it.

For Android Studio it worked using:

* SonarQube plugin
* Gradle parameters (sonar.host.url, login, etc...)

for setting up the server and its credentials.

But for Xcode (v8.2.1) I don't know what's the best way to do this, or if any software is needed to be installed.

Has anyone accomplished this?

like image 624
nano Avatar asked Apr 26 '17 09:04

nano


People also ask

How do you integrate with SonarQube?

Configure your SonarQube server(s): Log into Jenkins as an administrator and go to Manage Jenkins > Configure System. Scroll down to the SonarQube configuration section, click Add SonarQube, and add the values you're prompted for. The server authentication token should be created as a 'Secret Text' credential.

Can SonarQube be integrated with ALM tools?

The following schema shows how SonarQube integrates with other ALM tools and where the various components of SonarQube are used. Developers code in their IDEs and use SonarLint to run local analysis. Developers push their code into their favourite SCM : git, SVN, TFVC, ...


1 Answers

I did tried that and able to get install SonarQube and Sonar Scanner in Mac Sierra. But the Objective C plugin for SonarQube requires licence from Sonar Community. I have requested for trial version of that and still waiting response from them.

You can follow below steps to full fill Prerequisites.

  1. Open terminal and run below command to install Homebrew

    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    

Or if it is already installed then update it using below command

    brew update
  1. Install SonarQube using below command:

    brew install sonar
    
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
    
  2. Install Sonar Scanner

    brew install sonar-scanner
    
  3. Install Xctool

    brew install xctool
    
  4. Install OCLint

    brew tap oclint/formulae
    brew install oclint
    
  5. Install gcovr

    brew install gcovr
    
  6. Set environment variables for Sonar Home

    export SONAR_HOME=/usr/local/Cellar/sonar-runner/2.4/libexec
    export SONAR=$SONAR_HOME/bin
    export PATH=$SONAR:$PATH
    
  7. Install JAVA

    brew cask install java
    
  8. Download .properties file from this Link and change project name, target and scheme

  9. Copy and paste .properties file to your project root directory

  10. Install Maven - It is required to run Objective C plugin

    brew install maven
    
  11. Download Sonar Objective C plugin from this Link

  12. Add your local host for SonarQube server. Open sonar-project.properties file and add below command at top of the file

    sonar.host.url=<YOUR-LOCAL-HOST>
    
  13. In Terminal go to your project's root directory and run below command to scan project for errors and bugs.

    sonar-scanner
    
like image 94
Kampai Avatar answered Sep 20 '22 05:09

Kampai