-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
66 lines (59 loc) · 1.46 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
buildscript {
ext.jacoco_version = '0.8.8'
ext.kotlin_version = '1.6.21'
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:7.1.3"
classpath "org.jacoco:org.jacoco.core:$jacoco_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
plugins {
id "io.gitlab.arturbosch.detekt" version "1.19.0"
id "org.jlleitschuh.gradle.ktlint" version "10.3.0"
}
allprojects {
repositories {
google()
mavenCentral()
}
}
subprojects {
apply plugin: "org.jlleitschuh.gradle.ktlint"
}
task clean(type: Delete) {
delete rootProject.buildDir
}
detekt {
config = files("detekt.yml")
input = files(
"lifecyklelog/src/main/java",
"lifecyklelog-sample/src/main/java"
)
reports {
xml {
enabled = true
destination = file("build/reports/detekt/detekt.xml")
}
html {
enabled = true
destination = file("build/reports/detekt/detekt.html")
}
}
}
ext.getVersionTag = {
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'describe', '--tags', '--always'
standardOutput = stdout
}
def longTag = stdout.toString().trim()
if (longTag.contains('-')) {
return longTag.substring(longTag.indexOf('/') + 1, longTag.indexOf('-'))
} else {
return longTag
}
}