Skip to content

Commit

Permalink
Updated scripts and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Gilles Grousset committed Jan 6, 2015
1 parent 13a60a7 commit d5d7a48
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
17 changes: 6 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,17 @@ Find below an example of an iOS SonarQube dashboard:

For more details, see the list of [Sonar metrics](https://github.com/octo-technology/sonar-objective-c/wiki/Features) implemented or pending.

###Download
###Compatibility

The latest release is the 0.3.1, and it's available [here](http://bit.ly/1fSwd5I).

You can also download the latest build of the plugin from [Cloudbees](https://rfelden.ci.cloudbees.com/job/sonar-objective-c/lastSuccessfulBuild/artifact/target/).

In the worst case, the Maven repository is available here: http://repository-rfelden.forge.cloudbees.com/
- Use 0.3.x releases for SonarQube 3.x
- Use 0.4.x releases for SonarQube 4.x

###Prerequisites

- a Mac with Xcode...
- [SonarQube](http://docs.codehaus.org/display/SONAR/Setup+and+Upgrade) and [SonarQube Runner](http://docs.codehaus.org/display/SONAR/Installing+and+Configuring+SonarQube+Runner) installed
- [SonarQube](http://docs.codehaus.org/display/SONAR/Setup+and+Upgrade) and [SonarQube Runner](http://docs.codehaus.org/display/SONAR/Installing+and+Configuring+SonarQube+Runner) installed ([HomeBrew](http://brew.sh) installed and ```brew install sonar-runner```)
- [xctool](https://github.com/facebook/xctool) ([HomeBrew](http://brew.sh) installed and ```brew install xctool```)
- [OCLint](http://docs.oclint.org/en/dev/intro/installation.html) installed. In my case the 0.7 version is failing on my project, so I recommend installing the 0.8.dev version (at least it works with oclint-0.8.dev.2888e0f).
- [OCLint](http://docs.oclint.org/en/dev/intro/installation.html) installed. Version 0.8.1 recommanded ([HomeBrew](http://brew.sh) installed and ```brew install https://gist.githubusercontent.com/TonyAnhTran/e1522b93853c5a456b74/raw/157549c7a77261e906fb88bc5606afd8bd727a73/oclint.rb```).
- [gcovr](http://gcovr.com) installed

###Installation (once for all your Objective-C projects)
Expand All @@ -53,15 +50,13 @@ In the worst case, the Maven repository is available here: http://repository-rfe
- Run the script ```run-sonar.sh``` in your Xcode project root folder
- Enjoy or file an issue!

###Build Status
[![Build Status](https://rfelden.ci.cloudbees.com/job/sonar-objective-c/badge/icon)](https://rfelden.ci.cloudbees.com/job/sonar-objective-c/)

###Credits
* **Cyril Picat**
* **Denis Bregeon**
* **Romain Felden**
* **François Helg**
* **Mete Balci**
* **Gilles Grousset**

###History
- v0.3.1 (2013/10): fix release
Expand Down
8 changes: 8 additions & 0 deletions sample/sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ sonar.projectDescription=Fake description

# Path to source directories
sonar.sources=srcDir1,srcDir2
# Path to test directories (comment if no test)
sonar.tests=testSrcDir


# Xcode project configuration (.xcodeproj or .xcworkspace)
# -> If you have a project: configure only sonar.objectivec.project
Expand Down Expand Up @@ -48,3 +51,8 @@ sonar.sourceEncoding=UTF-8
# Paths to exclude from coverage report (tests, 3rd party libraries etc.)
# sonar.objectivec.excludedPathsFromCoverage=pattern1,pattern2
sonar.objectivec.excludedPathsFromCoverage=.*Tests.*

# Project SCM settings
# sonar.scm.enabled=true
# sonar.scm.url=scm:git:https://...

6 changes: 4 additions & 2 deletions src/main/shell/run-sonar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ function runCommand() {
$command "$@"
fi

if [[ $? != 0 && $? != 5 ]] ; then
returnValue=$?
if [[ $returnValue != 0 && $returnValue != 5 ]] ; then
stopProgress
echo "ERROR - Command '$command $@' failed with error code: $returnValue"
exit $?
Expand Down Expand Up @@ -286,7 +287,8 @@ if [ "$oclint" = "on" ]; then
fi

# Run OCLint with the right set of compiler options
runCommand no oclint-json-compilation-database $includedCommandLineFlags -- -report-type pmd -o sonar-reports/oclint.xml
maxPriority=10000
runCommand no oclint-json-compilation-database $includedCommandLineFlags -- -max-priority-1 $maxPriority -max-priority-2 $maxPriority -max-priority-3 $maxPriority -report-type pmd -o sonar-reports/oclint.xml
else
echo 'Skipping OCLint (test purposes only!)'
fi
Expand Down

0 comments on commit d5d7a48

Please sign in to comment.