-
Notifications
You must be signed in to change notification settings - Fork 107
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
126 lines (108 loc) · 3.3 KB
/
build.gradle.kts
File metadata and controls
126 lines (108 loc) · 3.3 KB
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
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
import utils.LocalProperties
LocalProperties.init(project.rootProject)
buildscript {
repositories {
google()
mavenCentral()
flatDir { dir("app/libs") }
}
dependencies {
classpath(libs.kotlin.gradle)
classpath(libs.android.gradle)
// Huawei agconnect plugin
classpath("com.huawei.agconnect:agcp-1.9.1.303")
classpath("com.huawei.agconnect:agconnect-crash-symbol-lib-1.9.1.301")
classpath("com.huawei.agconnect:agconnect-apms-plugin-1.6.2.300")
classpath("com.huawei.agconnect:agconnect-core-1.9.1.301@aar")
}
}
plugins {
alias(libs.plugins.jacoco)
alias(libs.plugins.sonarqube)
alias(libs.plugins.ktlint)
alias(libs.plugins.compose.compiler) apply false
}
allprojects {
repositories {
google()
mavenCentral()
maven("https://jitpack.io")
flatDir { dir("libs") }
// Huawei
exclusiveContent {
forRepository {
maven("https://developer.huawei.com/repo/")
}
filter {
// Only matching dependencies will be installed from this repository.
includeGroup("com.huawei.hms")
includeGroup("com.huawei.android.hms")
includeGroup("com.huawei.hmf")
}
}
}
group = "ch.threema"
}
tasks.wrapper {
distributionType = Wrapper.DistributionType.ALL
}
sonarqube {
properties {
property("sonar.projectKey", "android-client")
property("sonar.projectName", "Threema for Android")
}
}
jacoco {
toolVersion = "0.8.7"
}
subprojects {
apply(plugin = "org.jlleitschuh.gradle.ktlint")
tasks.withType<KotlinJvmCompile>().configureEach {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_11)
freeCompilerArgs.add("-Xjvm-default=all")
}
}
configurations.configureEach {
resolutionStrategy {
eachDependency {
if (requested.group == "org.jacoco") {
useVersion("0.8.7")
}
}
}
}
ktlint {
outputToConsole = true
android = true
filter {
exclude { entry ->
entry.file.path.contains("/build/")
}
}
}
}
// task to gather code coverage from multiple subprojects
// NOTE: the `JacocoReport` tasks do *not* depend on the `test` task by default. Meaning you have to ensure
// that `test` (or other tasks generating code coverage) run before generating the report.
tasks.register<JacocoReport>("codeCoverageReport") {
// If a subproject applies the 'jacoco' plugin, add the result it to the report
subprojects {
val subproject = this
plugins.withType<JacocoPlugin>()
.configureEach {
tasks
.matching { it.extensions.findByType<JacocoTaskExtension>() != null }
.configureEach {
sourceSets(
subproject.extensions.getByType(SourceSetContainer::class.java).getByName("main"),
)
}
}
}
reports {
xml.required = true
}
}