forked from threema-ch/threema-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
112 lines (98 loc) · 3.3 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
buildscript {
ext.kotlin_version = '1.8.10'
ext.kotlin_coroutines_version = '1.6.4'
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:7.4.2'
classpath 'org.owasp:dependency-check-gradle:6.5.3'
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.18'
// Huawei agconnect plugin
classpath 'com.huawei.agconnect:agcp-1.6.0.300'
classpath 'com.huawei.agconnect:agconnect-crash-symbol-lib-1.6.0.300'
classpath 'com.huawei.agconnect:agconnect-apms-plugin-1.5.2.302'
classpath 'com.huawei.agconnect:agconnect-core-1.5.0.300@aar'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
plugins {
id 'jacoco'
id 'org.sonarqube' version '3.0'
}
allprojects {
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
jcenter() // TODO(ANDR-2023): Remove repository
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
}
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 {
configurations.all {
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.enabled true
}
}