You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This repository hosts the Objective-C plugin for [SonarQube](http://www.sonarqube.org/). This plugin enables to analyze and track the quality of iOS (iPhone, iPad) and MacOS developments.
3
+
This repository hosts the Objective-C plugin for
4
+
[SonarQube](http://www.sonarqube.org/). This plugin aims to analyze and track
5
+
the quality of iOS (iPhone, iPad) and MacOS projects, but it can be used with
6
+
other Objective-C projects.
5
7
6
-
This plugin is not supported by SonarSource. SonarSource offers a [commercial SonarSource Objective-C plugin](http://www.sonarsource.com/products/plugins/languages/objective-c/) as well. Both plugins do not offer the same functionalities/support.
8
+
This plugin is not supported by SonarSource. SonarSource offers a
as well. The plugins do not offer the same features/support.
7
11
8
-
The development of this plugin has always been done thanks to the community. If you wish to contribute, check the [Contributing](https://github.com/octo-technology/sonar-objective-c/wiki/Contributing) wiki page.
12
+
The development of this plugin has always been done thanks to the community.
- Use 0.4.x releases for SonarQube >= 4.3 (4.x and 5.x)
40
+
- Use 0.4.0 or later releases for SonarQube >= 4.3 (4.x and 5.x)
41
+
31
42
32
-
###Download
43
+
##Download
33
44
34
45
The latest version is the 0.4.0 and it's available [here](http://bit.ly/18A7OkE).
35
46
The latest SonarQube 3.x release is the 0.3.1, and it's available [here](http://bit.ly/1fSwd5I).
36
47
37
-
You can also download the latest build of the plugin from [Cloudbees](https://rfelden.ci.cloudbees.com/job/sonar-objective-c/lastSuccessfulBuild/artifact/target/).
48
+
You can also download the latest build of the plugin from
- This will parse xcodebuild's output and generate a JUnit XML report
73
+
74
+
75
+
### Coverage
76
+
77
+
Run your tests with code coverage enabled, then run one of the following tools
78
+
to produce a Cobertura XML report which can be imported by this plugin.
79
+
80
+
- With Xcode prior to version 7, use [gcovr](http://gcovr.com) to parse ```*.gcda``` and ```*.gcno``` files
81
+
- With Xcode 7 or greater, use [slather](https://github.com/venmo/slather) to parse the ```Coverage.profdata``` file
82
+
- Note: at time of writing, support for the ```*.profdata``` format has not been released, but can be installed by running ```gem install specific_install && gem specific_install -l https://github.com/viteinfinite/slather.git -b 61f00988e6ad65f817ba81b08533cf78615fff16```
83
+
- Note: at time of writing, xctool is not capable of producing coverage data when using Xcode 7+
84
+
85
+
86
+
### Clang
87
+
88
+
[Clang Static Analyzer](http://clang-analyzer.llvm.org/) can produce Plist
89
+
reports which can be imported by this plugin.
90
+
91
+
There are different ways to produce the reports, such as using Clang's
Use it to produce a PMD-formatted XML report that can be imported by this
104
+
plugin.
40
105
41
-
###Prerequisites
42
106
43
-
- a Mac with Xcode...
44
-
-[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```)
45
-
-[xctool](https://github.com/facebook/xctool) ([HomeBrew](http://brew.sh) installed and ```brew install xctool```). If you are using Xcode 6, make sure to update xctool (```brew upgrade xctool```) to a version > 0.2.2.
46
-
-[OCLint](http://docs.oclint.org/en/dev/intro/installation.html) installed. Version 0.8.1 recommended ([HomeBrew](http://brew.sh) installed and ```brew install https://gist.githubusercontent.com/TonyAnhTran/e1522b93853c5a456b74/raw/157549c7a77261e906fb88bc5606afd8bd727a73/oclint.rb```).
###Installation (once for all your Objective-C projects)
51
-
- Install [the plugin](http://bit.ly/18A7OkE) through the Update Center (of SonarQube) or download it into the $SONARQUBE_HOME/extensions/plugins directory
52
-
- Copy [run-sonar.sh](https://rawgithub.com/octo-technology/sonar-objective-c/master/src/main/shell/run-sonar.sh) somewhere in your PATH
53
-
- Restart the SonarQube server.
109
+
Use [Lizard](https://github.com/terryyin/lizard) (```pip install lizard```)
110
+
to produce an XML report that can be imported by this plugin.
54
111
55
-
###Configuration (once per project)
56
-
- Copy [sonar-project.properties](https://rawgithub.com/octo-technology/sonar-objective-c/master/sample/sonar-project.properties) in your Xcode project root folder (along your .xcodeproj file)
57
-
- Edit the *sonar-project.properties* file to match your Xcode iOS/MacOS project
58
112
59
-
**The good news is that you don't have to modify your Xcode project to enable SonarQube!**. Ok, there might be one needed modification if you don't have a specific scheme for your test target, but that's all.
113
+
## Installation (once for all your Objective-C projects)
60
114
61
-
###Analysis
62
-
- Run the script ```run-sonar.sh``` in your Xcode project root folder
115
+
1. Install [the plugin](http://bit.ly/18A7OkE) through the Update Center (of SonarQube) or download it into the $SONARQUBE_HOME/extensions/plugins directory
116
+
2. Restart the SonarQube server.
117
+
118
+
119
+
## Configuration (once per project)
120
+
121
+
Create a ```sonar-project.properties``` file defining some basic project
122
+
configuration and the location of the reports you want to import.
123
+
124
+
The good news is that you don't have to modify your Xcode project to enable
125
+
SonarQube! Ok, there might be needed modification if you don't have a
126
+
specific scheme for your test target or if coverage is not enabled, but that's all.
127
+
128
+
129
+
## Analysis
130
+
131
+
- Run your build script to produce the various reports
132
+
- Run ```sonar-runner```
63
133
- Enjoy or file an issue!
64
134
65
-
###Update (once per plugin update)
135
+
136
+
## Troubleshooting
137
+
138
+
If the results from a report don't show up, make sure any relative file or
139
+
directory paths in the report match the paths of the files as configured
140
+
and indexed by SonarQube. Typically files are indexed relative to the base
141
+
directory of the project/module being analyzed.
142
+
143
+
For JUnit reports, most tools only record the classname, so make sure your
144
+
```*.m``` file is named the same as the classname it contains. Otherwise, the
145
+
plugin won't be able to find the test class.
146
+
147
+
148
+
## Update
149
+
66
150
- Install the [latest plugin](http://bit.ly/18A7OkE) version
67
-
- Copy [run-sonar.sh](https://rawgithub.com/octo-technology/sonar-objective-c/master/src/main/shell/run-sonar.sh) somewhere in your PATH
151
+
- Check for documented migration steps
152
+
153
+
### Migration to v0.5.x
154
+
155
+
- Analysis property names have changed. Check the sample.
156
+
- Cobertura, JUnit, OCLint, and Lizard report properties no longer have defaults
157
+
- Coverage report property no longer supports pattern matching. Only one coverage XML file is supported.
158
+
-```sonar.language``` key changed from ```objc``` to ```objectivec```
159
+
- As a side effect you may have to reconfigure your Quality Profiles
68
160
69
-
If you still have *run-sonar.sh* file in each of your project (not recommended), you will need to update all those files.
70
161
71
-
###Credits
72
-
***Cyril Picat**
73
-
***Gilles Grousset**
74
-
***Denis Bregeon**
75
-
***François Helg**
76
-
***Romain Felden**
77
-
***Mete Balci**
162
+
## Contributors
78
163
79
-
###History
164
+
- Cyril Picat
165
+
- Gilles Grousset
166
+
- Denis Bregeon
167
+
- François Helg
168
+
- Romain Felden
169
+
- Mete Balci
170
+
- Andrés Gil Herrera
171
+
- Matthew DeTullio
172
+
173
+
174
+
## History
175
+
176
+
- v0.5.0 (2015/11):
177
+
- added support for Clang
178
+
- made properties configurable in SonarQube UI
179
+
- major refactoring
180
+
- decouple report imports from the language so they can also be used with the commercial plugin
80
181
- v0.4.1 (2015/05): added support for Lizard to implement complexity metrics.
81
182
- v0.4.0 (2015/01): support for SonarQube >= 4.3 (4.x & 5.x)
82
183
- v0.3.1 (2013/10): fix release
83
184
- v0.3 (2013/10): added support for OCUnit tests and test coverage
84
185
- v0.2 (2013/10): added OCLint checks as SonarQube violations
85
186
- v0.0.1 (2012/09): v0 with basic metrics such as nb lines of code, nb lines of comment, nb of files, duplications
86
187
87
-
###License
88
188
89
-
SonarQube Plugin for Objective C is released under the GNU LGPL 3 license:
189
+
## License
190
+
191
+
SonarQube Plugin for Objective-C is released under the GNU LGPL 3 license:
0 commit comments