-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
138 lines (119 loc) · 5.19 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
kotlin_version = "1.7.10"
room_version = '2.4.2'
hilt_version = '2.42'
kover_version = '0.5.0'
gradle_plugin_version = '7.2.1'
jacoco_version = '0.8.7'
robolectric_version = '4.8.1'
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:$gradle_plugin_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.google.dagger:hilt-android-gradle-plugin:$hilt_version"
classpath "org.jetbrains.kotlinx:kover:$kover_version"
classpath "org.jacoco:org.jacoco.core:$jacoco_version"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.5.0"
classpath 'com.google.gms:google-services:4.3.13'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
plugins {
id "org.sonarqube" version "3.4.0.2513"
}
allprojects {
apply plugin: 'jacoco'
}
task clean(type: Delete) {
delete rootProject.buildDir
}
task printPropsGradlePropertiesGlobal() {
doLast {
println keyAlias
println keyPassword
println storeFile
println storePassword
println file(System.getProperty('user.home') + '/keystores/dayoff.keystore').exists()
println sonar.host.url
}
}
sonarqube {
androidVariant "debug"
properties {
property "sonar.sourceEncoding", "UTF-8"
property "sonar.projectName", rootProject.name
property "sonar.projectVersion", VERSION_NAME
}
}
subprojects {
version = VERSION_NAME
sonarqube {
androidVariant "debug"
properties {
// I was testing with JaCoCo, so the next line is not needed if you're using some other tool
property "sonar.coverage.jacoco.xmlReportPaths", "build/reports/jacoco/testDebugUnitTestCoverage/testDebugUnitTestCoverage.xml"
property "sonar.projectVersion", version
property "sonar.sourceEncoding", "UTF-8"
property "sonar.language", "kotlin"
property "sonar.java.binaries", "build/tmp/kotlin-classes"
property "sonar.android.lint.report", "build/reports/lint-results-debug.xml"
//property "sonar.kotlin.detekt.reportPaths", "build/reports/detekt.xml"
property "sonar.junit.reportPaths", "build/test-results/testDebugUnitTest/"
property "sonar.java.coveragePlugin", "jacoco"
property "sonar.exclusions", "**/*Test*/**, " +
"src/test/java, " +
"**/*.json, " +
"**/*test*/**, " +
"**/*.sh, " +
"**/.gradle/**, " +
"**/R.class" +
"**/build/**,"
}
}
}
//apply plugin: 'kover'
//apply from: 'kover.gradle'
//kover {
// disabled = false // true to disable instrumentation of all test tasks in all projects
// coverageEngine.set(kotlinx.kover.api.CoverageEngine.JACOCO) // change instrumentation agent and reporter
// intellijEngineVersion.set('1.0.656') // change version of IntelliJ agent and reporter
// jacocoEngineVersion.set('0.8.7') // change version of JaCoCo agent and reporter
// generateReportOnCheck = true // false to do not execute `koverMergedReport` task before `check` task
// disabledProjects = [] // ["project-name"] to disable coverage for project with name `project-name`
// instrumentAndroidPackage = false // true to instrument packages `android.*` and `com.android.*`
// runAllTestsForProjectTask = true // true to run all tests in all projects if `koverHtmlReport`, `koverXmlReport`, `koverReport`, `koverVerify` or `check` tasks executed on some project
//}
//tasks.koverMergedHtmlReport {
// enabled = true // false to disable report generation
// htmlReportDir.set(layout.buildDirectory.dir("my-merged-report/html-result"))
// includes = ['fr.pitdev.dayoff.*'] // inclusion rules for classes
// excludes = project.koverExcludes // exclusion rules for classes
//}
//tasks.koverMergedXmlReport {
// enabled = true // false to disable report generation
// xmlReportFile.set(layout.buildDirectory.file("my-merged-report/result.xml"))
// includes = ['fr.pitdev.dayoff.*'] // inclusion rules for classes
// excludes = project.koverExcludes // exclusion rules for classes
//}
//tasks.koverCollectReports {
// outputDir.set(layout.buildDirectory.dir("all-projects-reports") )
//}
//tasks.koverVerify {
// includes = ['fr.pitdev.dayoff.*'] // inclusion rules for classes
// excludes = project.koverExcludes // exclusion rules for classes
// rule {
// name = "Minimal line coverage rate in percent"
// bound {
// minValue = 100
// valueType is 'COVERED_LINES_PERCENTAGE' by default
// }
// }
//}