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?
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.
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, ...
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.
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
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
Install Sonar Scanner
brew install sonar-scanner
Install Xctool
brew install xctool
Install OCLint
brew tap oclint/formulae
brew install oclint
Install gcovr
brew install gcovr
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
Install JAVA
brew cask install java
Download .properties
file from this Link and change project name, target and scheme
Copy and paste .properties
file to your project root directory
Install Maven - It is required to run Objective C plugin
brew install maven
Download Sonar Objective C plugin from this Link
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>
In Terminal go to your project's root directory and run below command to scan project for errors and bugs.
sonar-scanner
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With