这是我的build.gradle,
apply plugin: 'org.sonarqube'
sonarqube {
properties {
property "sonar.host.url", "http://10.52.211.255:9000/sonar"
property "sonar.sources", "src/main/java"
property "sonar.language", "java"
property "sonar.profile", "Android Lint"
}
}
代码工作
财产“sonar.profile”,“声纳方式”。
但我需要这为Android皮棉。有什么可以与得到结果为零的问题。
声纳林特不压问题SonarQube服务器。它的目的是给在本地工作区中的代码开发的即时反馈。
要显示Sonarqube服务器的问题,您需要执行声纳的分析。例如使用声纳扫描仪(以前称为声纳浇道)
改变你这样的声纳性能:
apply plugin: "org.sonarqube"
sonarqube {
properties {
property "sonar.projectName", "appa"
property "sonar.projectKey", "appa_app"
property "sonar.projectVersion", "1.0"
property "sonar.analysis.mode", "publish"
property "sonar.language", "java"
property 'sonar.sourceEncoding', "UTF-8"
property "sonar.sources", "./src/main"
//property "sonar.exclusions", "**/*Entity.java"
// property "sonar.exclusions", "src/main/java/com/apparkb/model/**, **/*Entity.java"
property "sonar.host.url", "http://192.168.21.33:9000"
property "sonar.login", "admin"
property "sonar.profile", "testlint"
property 'sonar.import_unknown_files', true
property "sonar.android.lint.report", "./build/outputs/lint-results-debug.xml"
property "sonar.password", "admin"
property "sonar.java.binaries", "build/"
}
}
为了创建不起毛的结果,debug.xml你就要跑工作室终端上以下命令:
./gradlew lint
它会生成缺少的XML报告。要carful,它可以为每个构建变量的报告(调试默认情况下会生成编译/输出/掉毛的成果debug.xml)。所以,你可以调用lintDebug,lintRelease ... dependings您构建变量。
并更改绒性能:
lintOptions {
// set to true to turn off analysis progress reporting by lint
quiet true
// if true, stop the gradle build if errors are found
abortOnError false
// do not ignore warnings
warningsAsErrors true
}
现在,如果你运行./gradlew sonarqube
你会得到的结果显示,实际上得到在服务器承载其实际本地文件报告
该规范的变化帮我解决这个问题。
在摇篮,
apply plugin: 'com.android.application' android { lintOptions { // set to true to turn off analysis progress reporting by lint quiet true // if true, stop the gradle build if errors are found abortOnError false // if true, only report errors ignoreWarnings true } compileSdkVersion 24 buildToolsVersion "23.0.1" useLibrary 'org.apache.http.legacy' defaultConfig { applicationId "com.pearson.writer" minSdkVersion 11 targetSdkVersion 21 } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' } } } buildscript { repositories { maven { url "https://plugins.gradle.org/m2/" } } dependencies { classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.0.1" } } apply plugin: 'org.sonarqube' sonarqube { properties { property "sonar.projectName", "Writer40 sonarway" property "sonar.host.url", "http://...:9000/sonar" property "sonar.sources", "src" property "sonar.import_unknown_files", "true" property "sonar.language", "java" property "sonar.profile", "Android Lint" property "sonar.android.lint.report", "/data/jenkins/workspace/SonarJobs/PearsonWriterSonar/writer40/build/outputs/lint-results-debug.xml" } } dependencies { compile files('libs/android-async-http-1.4.4.jar') compile files('libs/android-support-v4.jar') compile files('libs/libGoogleAnalyticsServices.jar') compile files('libs/universal-image-loader-1.7.0.jar') }
然后我得到了有关到Android林特一放出来
谢谢。
就不得不提到的分析模式发布到结果提交给服务器。
财产“sonar.analysis.mode”,“发布”