This repository has been archived by the owner on Aug 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
build.gradle
55 lines (48 loc) · 1.77 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
buildscript {
apply from: rootProject.file('gradle/dependencies.gradle')
repositories {
jcenter()
}
}
plugins {
id 'org.jetbrains.kotlin.android' version '1.3.70' apply false
id 'org.jmailen.kotlinter' version '2.2.0' apply false
id 'com.android.library' version '3.6.2' apply false
id 'com.vanniktech.maven.publish' version '0.11.1' apply false
// `jacoco-android` is incompatible with Gradle 6.x, fails with:
// groovy.lang.GroovyRuntimeException: Cannot set the value of read-only property 'executionData'...
// https://github.com/arturdm/jacoco-android-gradle-plugin/issues/72
id 'com.hiya.jacoco-android' version '0.2' apply false
id 'binary-compatibility-validator' version '0.2.3'
}
subprojects {
repositories {
google()
jcenter()
}
}
subprojects {
tasks.withType(Test) {
testLogging {
events "started", "passed", "skipped", "failed", "standardOut", "standardError"
exceptionFormat "full"
showExceptions true
showStackTraces true
showCauses true
}
}
}
// Prevent publishing if `VERSION_NAME` property is invalid (i.e. enforce `-PVERSION_NAME` command
// line argument).
gradle.taskGraph.whenReady { taskGraph ->
taskGraph.getAllTasks().findAll { task ->
task.name.startsWith('installArchives') || task.name.startsWith('publishArchives')
}.forEach { task ->
task.doFirst {
if (!project.hasProperty("VERSION_NAME") || project.findProperty("VERSION_NAME").startsWith("unspecified")) {
logger.error("VERSION_NAME=" + project.findProperty("VERSION_NAME"))
throw new GradleException("Unable to publish without valid VERSION_NAME property")
}
}
}
}