1. <tfoot id='FI6Di'></tfoot>
    2. <small id='FI6Di'></small><noframes id='FI6Di'>

      <legend id='FI6Di'><style id='FI6Di'><dir id='FI6Di'><q id='FI6Di'></q></dir></style></legend>
        <bdo id='FI6Di'></bdo><ul id='FI6Di'></ul>

        <i id='FI6Di'><tr id='FI6Di'><dt id='FI6Di'><q id='FI6Di'><span id='FI6Di'><b id='FI6Di'><form id='FI6Di'><ins id='FI6Di'></ins><ul id='FI6Di'></ul><sub id='FI6Di'></sub></form><legend id='FI6Di'></legend><bdo id='FI6Di'><pre id='FI6Di'><center id='FI6Di'></center></pre></bdo></b><th id='FI6Di'></th></span></q></dt></tr></i><div id='FI6Di'><tfoot id='FI6Di'></tfoot><dl id='FI6Di'><fieldset id='FI6Di'></fieldset></dl></div>

        如何在 android studio 中集成 sonarqube?

        时间:2023-07-09

        <small id='nbmKQ'></small><noframes id='nbmKQ'>

        <i id='nbmKQ'><tr id='nbmKQ'><dt id='nbmKQ'><q id='nbmKQ'><span id='nbmKQ'><b id='nbmKQ'><form id='nbmKQ'><ins id='nbmKQ'></ins><ul id='nbmKQ'></ul><sub id='nbmKQ'></sub></form><legend id='nbmKQ'></legend><bdo id='nbmKQ'><pre id='nbmKQ'><center id='nbmKQ'></center></pre></bdo></b><th id='nbmKQ'></th></span></q></dt></tr></i><div id='nbmKQ'><tfoot id='nbmKQ'></tfoot><dl id='nbmKQ'><fieldset id='nbmKQ'></fieldset></dl></div>
            <bdo id='nbmKQ'></bdo><ul id='nbmKQ'></ul>
                  <tbody id='nbmKQ'></tbody>
                <tfoot id='nbmKQ'></tfoot>
                  <legend id='nbmKQ'><style id='nbmKQ'><dir id='nbmKQ'><q id='nbmKQ'></q></dir></style></legend>
                  本文介绍了如何在 android studio 中集成 sonarqube?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我们如何在 android studio 中集成 sonarqube?我遇到过使用 sonarqube 的静态代码分析.解释我们如何实现这一目标.有许多链接可用于集成 sonar-runner 和 sonarqube,但要么已过时,要么不足以完成工作.

                  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.

                  推荐答案

                  Sonarqube 是服务器端的静态代码分析工具.编写干净和高质量的代码非常有用.您应该在 localhost 或服务器上运行 sonarqube.在那里创建一个新项目,提供名称和唯一 ID,这个名称和唯一性将用于向服务器识别我们以及我们的用户名和密码.很少有东西需要在服务器端设置,比如-

                  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-

                  1. 创建用户.
                  2. 创建具有唯一 ID 的新项目.

                  现在在 Android Studio 中,我们将使用 gradle sonarqube 命令来分析我们的带有 sonarqube 的项目.

                  Now in Android studio we are going use gradle sonarqube command to analyze our project with sonarqube.

                  在运行gradle sonarqube命令之前需要覆盖以下步骤-

                  There are following steps need to be covered before running gradle sonarqube command-

                  1. 首先我们需要在我们的机器上安装 gradle.
                  2. (可选)在 android studio 中安装 sonarqube 插件.前往-

                  File -> Settings -> Plugins -> 然后输入 sonarqube 并点击在底部的浏览存储库.

                  File -> Settings -> Plugins -> then type sonarqube and click on Browse repositories at the bottom.

                  1. 打开 build.gradle 文件,添加插件 sonarqube.org 并添加以下属性-

                  1. Open build.gradle file, add plugin sonarqube.org and add following properties-

                  apply plugin: "org.sonarqube"
                  
                  sonarqube {
                      properties {
                          property "sonar.projectName", "MyProject"
                          property "sonar.projectKey", "com.example.myproject"
                          property "sonar.host.url", "http://192.114.1.1:9000"
                          property "sonar.language", "java"
                          property "sonar.sources", "src/main/"
                          property "sonar.login", "username"
                          property "sonar.password", "password"
                      }
                  }    
                  

                • 打开项目 gradle 文件并在依赖项中添加-

                • Open project gradle file and in dependencies add-

                  dependencies {
                      classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.6.1"
                  }
                  

                • 并在存储库中添加-

                • And in repository add-

                  allprojects {
                      repositories {
                          maven {
                              url "https://plugins.gradle.org/m2/"
                          }
                      }
                  }
                  

                • 现在在 Android Studio 端,您的设置已完成,运行命令 -gradle sonarqube 运行分析.

                  Now on Android studio side your setup is done, run the command- gradle sonarqube to run the analysis.

                  如果在团队中工作并希望为所有开发人员创建不同的分支,请运行命令-gradle sonarqube -Dsonar.branch={YouName}

                  If working in team and want to create different branches for all developers, run command- gradle sonarqube -Dsonar.branch={YouName}

                  这篇关于如何在 android studio 中集成 sonarqube?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Android 为现有数据库升级数据库的简单方法是什么 下一篇:Fastlane “nokogiri 需要 Ruby 版本 >= 2.3.0."错误

                  相关文章

                  • <bdo id='cEd8M'></bdo><ul id='cEd8M'></ul>

                  <small id='cEd8M'></small><noframes id='cEd8M'>

                      <tfoot id='cEd8M'></tfoot>
                    1. <legend id='cEd8M'><style id='cEd8M'><dir id='cEd8M'><q id='cEd8M'></q></dir></style></legend>

                    2. <i id='cEd8M'><tr id='cEd8M'><dt id='cEd8M'><q id='cEd8M'><span id='cEd8M'><b id='cEd8M'><form id='cEd8M'><ins id='cEd8M'></ins><ul id='cEd8M'></ul><sub id='cEd8M'></sub></form><legend id='cEd8M'></legend><bdo id='cEd8M'><pre id='cEd8M'><center id='cEd8M'></center></pre></bdo></b><th id='cEd8M'></th></span></q></dt></tr></i><div id='cEd8M'><tfoot id='cEd8M'></tfoot><dl id='cEd8M'><fieldset id='cEd8M'></fieldset></dl></div>