-
Notifications
You must be signed in to change notification settings - Fork 20
/
build.gradle.kts
50 lines (44 loc) · 1.27 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
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
plugins {
id(BuildPlugins.androidApplication) version BuildVersions.agp apply false
id(BuildPlugins.kotlinAndroid) version BuildVersions.kotlin apply false
id(BuildPlugins.safeArgs) version BuildVersions.safeArgs apply false
id(BuildPlugins.detekt) version BuildVersions.detekt
id(BuildPlugins.ktlintGradle) version BuildVersions.ktlintGradle
id(BuildPlugins.versionsPlugin) version BuildVersions.versionsPlugin
}
allprojects {
repositories {
google()
jcenter()
maven("https://jitpack.io")
}
}
subprojects {
apply {
plugin(BuildPlugins.ktlintGradle)
plugin(BuildPlugins.detekt)
}
ktlint {
version.set(Versions.ktlint)
verbose.set(true)
android.set(true)
}
detekt {
reports {
html {
enabled = true
destination = file("build/reports/detekt.html")
}
}
}
}
tasks.register("clean", Delete::class) {
delete(rootProject.buildDir)
}
tasks.withType<DependencyUpdatesTask> {
rejectVersionIf {
isNonStable(candidate.version)
}
}
fun isNonStable(version: String) = "^[0-9,.v-]+(-r)?$".toRegex().matches(version).not()