-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
68 lines (58 loc) · 1.93 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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath(Plugins.android_gradle_plugin)
classpath(Plugins.kotlin_gradle_plugin)
classpath(Plugins.google_services_plugin)
classpath(Plugins.junit5_plugin)
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
mavenCentral()
maven(url = "https://jitpack.io")
}
}
plugins {
id(Plugins.detekt_plugin).version(Versions.detektVersion)
id(Plugins.ktlint_plugin).version(Versions.ktlintVersion)
id(Plugins.libs_versions_plugin).version(Versions.libsVersionsPluginVersion)
}
detekt {
buildUponDefaultConfig = true // preconfigure defaults
allRules = false
config =
files("$projectDir/config/detekt.yml") // point to your custom config defining rules to run, overwriting default behavior
baseline = file("$projectDir/config/baseline.xml") // a way of suppressing issues before introducing detekt
reports {
html.enabled = true
txt.enabled = true
}
}
tasks.named<DependencyUpdatesTask>("dependencyUpdates").configure {
rejectVersionIf {
isNonStable(candidate.version)
}
checkForGradleUpdate = true
outputFormatter = "html"
outputDir = "build/dependencyUpdates"
reportfileName = "report"
}
fun isNonStable(version: String): Boolean {
val rejectedTag = listOf("alpha", "beta", /*"rc"*/ "cr", "m", "preview")
val rejected = rejectedTag.any { qualifier ->
version.matches(Regex("(?i).*[.-]$qualifier[.\\d-+]*"))
}
return rejected
}
tasks.register<Delete>("clean") {
delete(rootProject.buildDir)
}