This repository has been archived by the owner on Feb 1, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.gradle
189 lines (154 loc) · 5.76 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
kotlin_version = '1.3.50'
kotlin_serialization_version = '0.12.0'
coroutines_version = "1.3.1"
android_tools_version = '3.5.1'
build_tools_version = "28.0.3"
min_sdk_version = 19
compile_sdk_version = 28
target_sdk_version = compile_sdk_version
support_lib_version = "28.0.0"
play_services_version = "15.0.0"
firebase_iid_version = "17.1.2"
test_runner_version = "1.0.2"
test_rules_version = test_runner_version
espresso_version = "3.0.2"
junit_version = "4.12"
mockito_version = "2.23.0"
mockito_kotlin_version = "2.0.0"
robolectric_version = "4.1"
mockk_version = "1.9.2"
assertk_version = "0.14"
detekt_version = "1.0.0-RC14"
moshi_version = "1.8.0"
okhttp_version = "3.14.1"
bivrost_version = "v0.7.1"
kmnid_version = "0.4.2"
kethereum_version = "0.76.2"
tweetnacl_k_version = "0.0.1"
did_jwt_version = "0.3.3"
kotlin_common_version = "0.3.2"
uport_signer_version = "0.3.6"
uport_sdk_version = "0.5.1"
jacoco_version = "0.8.4"
}
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
maven { url "https://kotlin.bintray.com/kotlinx" }
}
dependencies {
classpath "com.android.tools.build:gradle:$android_tools_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
classpath "com.github.gnosis.bivrost-kotlin:bivrost-gradle-plugin:$bivrost_version"
classpath "com.github.dcendents:android-maven-gradle-plugin:2.1"
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4"
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:$detekt_version"
}
}
plugins {
id "io.errorlab.gradle.vault" version "0.1.0"
}
apply plugin: "io.gitlab.arturbosch.detekt"
detekt {
version = detekt_version
input = files(
"$projectDir"
)
//config = "${projectDir}/detekt.yml"
filters = ".*test.*,.*/resources/.*,.*/tmp/.*,.*/build/.*"
parallel = true
reports {
xml {
enabled = true
destination = file("${project.buildDir}/reports/detekt.xml")
}
html {
enabled = true
destination = file("${project.buildDir}/reports/detekt.html")
}
}
}
allprojects {
apply plugin: 'jacoco'
jacoco {
toolVersion = jacoco_version
}
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
maven { url "https://kotlin.bintray.com/kotlinx" }
// mavenLocal()
}
//address warnings about multiple kotlin runtimes in classpath
configurations.all {
resolutionStrategy.dependencySubstitution {
substitute module("org.jetbrains.kotlin:kotlin-stdlib-jre7") because "warning about multiple runtimes in the classpath" with module("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version")
substitute module("org.jetbrains.kotlin:kotlin-stdlib-jre8") because "warning about multiple runtimes in the classpath" with module("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version")
}
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'org.jetbrains.kotlin' && requested.name in [
'kotlin-reflect', 'kotlin-stdlib', 'kotlin-stdlib-common',
'kotlin-stdlib-jdk7', 'kotlin-stdlib-jdk8',
]) {
details.useVersion kotlin_version
}
}
}
}
subprojects { subproject ->
afterEvaluate {
if (subproject.plugins.hasPlugin("com.android.application") || subproject.plugins.hasPlugin("com.android.library")) {
subproject.android {
packagingOptions {
exclude "META-INF/main.kotlin_module"
exclude "META-INF/atomicfu.kotlin_module"
pickFirst "META-INF/kotlinx-io.kotlin_module"
pickFirst "META-INF/kbignumbers.kotlin_module"
pickFirst "META-INF/ripemd160.kotlin_module"
pickFirst "META-INF/extensions.kotlin_module"
pickFirst "META-INF/core.kotlin_module"
pickFirst "META-INF/keccak.kotlin_module"
pickFirst "META-INF/sha256.kotlin_module"
pickFirst "META-INF/khash-extensions.kotlin_module"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
}
subproject.tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = "1.8"
}
}
}
}
apply from: "publishing.gradle"
task clean(type: Delete) {
delete rootProject.buildDir
}
task jacocoReport(type: JacocoReport) {
subprojects { sub ->
afterEvaluate {
//subproject tasks can only be gathered after evaluation
def testTasks = sub.tasks.withType(Test)
dependsOn testTasks
executionData testTasks
}
classDirectories.from(file("${sub.buildDir}/classes/java/main"))
classDirectories.from(file("${sub.buildDir}/classes/kotlin/main"))
}
reports {
html.enabled = true
xml.enabled = true
csv.enabled = false
}
}