-
Notifications
You must be signed in to change notification settings - Fork 15
/
build.gradle
63 lines (50 loc) · 1.64 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.11'
ext.jacoco_version = '0.8.2'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.7"
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
apply plugin: "org.sonarqube"
sonarqube {
androidVariant 'debug'
properties {
property "sonar.sourceEncoding", "UTF-8"
property "sonar.verbose", true
property "sonar.host.url", "http://localhost:9000"
property "sonar.projectName", "Test Android Coverage"
property "sonar.projectKey", "test-android-coverage"
property "sonar.sourceEncoding", "UTF-8"
property "sonar.projectVersion", "0.1"
property "sonar.issuesReport.html.enable", "true"
property "sonar.issuesReport.console.enable", "true"
property "sonar.coverage.jacoco.xmlReportPaths", findAllReports()
property "detekt.sonar.kotlin.config.path", "${rootProject.projectDir}/detekt-config.yml"
property "sonar.java.coveragePlugin", "jacoco"
}
}
String findAllReports() {
def file = "${rootProject.buildDir}/reports"
def sonarEnabledProjects = rootProject.subprojects
.findAll { p -> p.sonarqube.getProperties().get("skipProject") == false }
*.name
.collect { projectName -> "$file/jacocoTestReport-${projectName}.xml" }
.join(",")
return sonarEnabledProjects
}