How we can integrate sonarqube in android studio? I have come across static code analysis using sonarqube. Explain how we can achieve that. There are many link available to integrate sonar-runner and sonarqube but either outdated or not sufficient to get the job done.
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
If you are using gradle 3.X follow this steps:
1.- Download and run on localhost Sonarqube from this: https://www.sonarqube.org/downloads/
2.- At the gradle.properties:
3.- At the build.gradle(Module:app) inside repositories:
And inside dependencies:
And finally outside buildscript:
4.- Run the command:
gradle sonarqube
5.- wait 5 minutes after build successfull to see the result report
Sonarqube is static code analyzer tool on server side. It is very useful to write clean and quality code. You should have sonarqube running on localhost or server. There create a new project giving name and unique id, this name and unique we will use to identify us to the server along with our username and password. Few things need to be set up on server side like-
Now in Android studio we are going use gradle sonarqube command to analyze our project with sonarqube.
There are following steps need to be covered before running gradle sonarqube command-
File -> Settings -> Plugins -> then type sonarqube and click on Browse repositories at the bottom.
Open build.gradle file, add plugin sonarqube.org and add following properties-
Open project gradle file and in dependencies add-
And in repository add-
Now on Android studio side your setup is done, run the command- gradle sonarqube to run the analysis.
If working in team and want to create different branches for all developers, run command- gradle sonarqube -Dsonar.branch={YouName}