-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle.kts
107 lines (95 loc) · 2.74 KB
/
build.gradle.kts
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
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import io.gitlab.arturbosch.detekt.Detekt
import io.gitlab.arturbosch.detekt.detekt
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
gradlePluginPortal()
jcenter()
}
dependencies {
classpath(Classpaths.gradle_plugin)
classpath(Classpaths.kotlin_gradle_plugin)
}
}
plugins {
id("io.gitlab.arturbosch.detekt") version Versions.detekt
id("com.github.ben-manes.versions") version Versions.ben_manes
id("org.jlleitschuh.gradle.ktlint") version Versions.ktlint
}
allprojects {
repositories {
google()
mavenCentral()
gradlePluginPortal()
jcenter()
maven { setUrl("https://mapbox.bintray.com/mapbox") }
}
}
tasks.register("clean", Delete::class) {
delete = setOf(rootProject.buildDir)
}
tasks.register("testAll") { dependsOn("clean", "build", "test", "connectedAndroidTest") }
subprojects {
apply(from = "$rootDir/versions.gradle.kts")
apply(plugin = "org.jlleitschuh.gradle.ktlint")
}
tasks.withType<Test> {
testLogging {
events("started", "skipped", "passed", "failed")
setExceptionFormat("full")
showStandardStreams = true
}
}
detekt {
toolVersion = Versions.detekt
input = files("$projectDir")
config = files("$rootDir/default-detekt-config.yml")
reports {
xml {
enabled = true
destination = file("$buildDir/reports/detekt-report.xml")
}
html {
enabled = true
destination = file("$buildDir/reports/detekt-report.html")
}
}
}
tasks.withType<Detekt> {
include("**/*.kt")
include("**/*.kts")
exclude(".*/resources/.*")
exclude(".*/build/.*")
exclude("/versions.gradle.kts")
exclude("buildSrc/settings.gradle.kts")
}
tasks.named<DependencyUpdatesTask>("dependencyUpdates") {
resolutionStrategy {
componentSelection {
all {
val rejected = listOf(
"alpha",
"beta",
"rc",
"cr",
"m",
"preview",
"b",
"ea"
).any { qualifier ->
candidate.version.matches(Regex("(?i).*[.-]$qualifier[.\\d-+]*"))
}
if (rejected) {
reject("Release candidate")
}
}
}
}
checkForGradleUpdate = true
outputFormatter = "json"
outputDir = "$buildDir/reports/dependencyUpdates"
reportfileName = "dependency-report"
}