-
Notifications
You must be signed in to change notification settings - Fork 93
/
build.gradle
128 lines (110 loc) · 3.68 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
buildscript {
ext.kotlin_version = '1.9.21'
ext.kotlin_coroutines_version = '1.8.1'
ext.slf4j_version = '1.7.36'
ext.junit_version = '4.13.2'
repositories {
google()
mavenCentral()
flatDir { dirs 'app/libs' }
}
dependencies {
classpath 'com.android.tools.build:gradle:8.5.2'
classpath 'org.owasp:dependency-check-gradle:10.0.4'
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.9.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// 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'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
plugins {
id 'jacoco'
id 'org.sonarqube' version '4.4.1.3373'
}
allprojects {
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
flatDir { dirs 'libs' }
// Huawei
exclusiveContent {
forRepository {
maven { url '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"
}
}
}
// OWASP dependency-check-gradle plugin
apply plugin: 'org.owasp.dependencycheck'
dependencyCheck {
skipConfigurations += 'lintClassPath'
suppressionFile 'dependencyCheckSuppressions.xml'
// Fail dependency check if any dependency has a CVE with a score of 3+
failBuildOnCVSS 3
// NVD API config. The key is not very secret, but please don't mis-use it.
nvd {
apiKey = "fc7aab31-d936-4807-b43b-e061c84a12dd"
validForHours = 6
}
}
group = 'ch.threema'
}
wrapper {
distributionType = Wrapper.DistributionType.ALL
}
sonarqube {
properties {
property 'sonar.projectKey', 'android-client'
property 'sonar.projectName', 'Threema for Android'
}
}
jacoco {
toolVersion = '0.8.7'
}
subprojects {
tasks.withType(KotlinCompile).tap {
configureEach {
kotlinOptions.jvmTarget = JavaVersion.VERSION_11.toString()
}
}
}
subprojects {
configurations.configureEach {
resolutionStrategy {
eachDependency { details ->
if ('org.jacoco' == details.requested.group) {
details.useVersion "0.8.7"
}
}
}
}
}
// 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("codeCoverageReport", JacocoReport) {
// If a subproject applies the 'jacoco' plugin, add the result it to the report
subprojects { subproject ->
subproject.plugins.withType(JacocoPlugin).configureEach {
subproject.tasks.matching({ t -> t.extensions.findByType(JacocoTaskExtension) }).configureEach { testTask ->
sourceSets subproject.sourceSets.main
executionData(testTask)
}
}
}
reports {
xml.required = true
}
}