forked from sogilis/sonarqube-for-android-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
android-sonarqube.gradle
53 lines (46 loc) · 1.69 KB
/
android-sonarqube.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
sonarqube {
//noinspection GroovyAssignabilityCheck
properties {
// Update your android version
def libraries = project.android.sdkDirectory.getPath() + "/platforms/android-23/android.jar"
if (project.plugins.hasPlugin('com.android.application')) {
"build/intermediates/exploded-aar/**/classes.jar"
}
property "sonar.sources", "src/main/java"
// Defines where the java files are
property "sonar.binaries", "build/intermediates/classes/debug"
property "sonar.libraries", libraries
// Defines where the xml files are
property "sonar.java.binaries", "build/intermediates/classes/debug"
property "sonar.java.libraries", libraries
// Analyze tests classes
if (project.plugins.hasPlugin('com.android.application')) {
property "sonar.tests", "src/test/java, src/androidTest/java"
} else {
property "sonar.tests", "src/test/java"
}
property "sonar.java.test.binaries", "build/intermediates/classes/debug"
property "sonar.java.test.libraries", libraries
property "sonar.jacoco.reportPath", "build/jacoco/testDebugUnitTest.exec"
property "sonar.java.coveragePlugin", "jacoco"
property "sonar.junit.reportsPath", "build/test-results/Debug"
property "sonar.android.lint.report", "build/outputs/lint-results.xml"
}
}
jacoco {
toolVersion = "0.7.6.201602180812"
}
jacocoAndroidUnitTestReport {
csv.enabled false
html.enabled false
xml.enabled true
}
android {
testOptions {
unitTests.all {
jacoco {
includeNoLocationClasses = true
}
}
}
}