-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
87 lines (78 loc) · 2.87 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
buildscript {
def ktlintVersion = libs.versions.ktlint.get()
configurations.classpath {
resolutionStrategy {
force(
"com.pinterest.ktlint:ktlint-core:$ktlintVersion",
"com.pinterest.ktlint:ktlint-cli-reporter-checkstyle:$ktlintVersion",
"com.pinterest.ktlint:ktlint-cli-reporter-json:$ktlintVersion",
"com.pinterest.ktlint:ktlint-cli-reporter-html:$ktlintVersion",
"com.pinterest.ktlint:ktlint-cli-reporter-plain:$ktlintVersion",
"com.pinterest.ktlint:ktlint-cli-reporter-sarif:$ktlintVersion",
"com.pinterest.ktlint:ktlint-ruleset-standard:$ktlintVersion"
)
}
}
dependencies {
// this is required for gradle version catalogs auto-complete in groovy build scripts
classpath files(libs.class.superclass.protectionDomain.codeSource.location)
}
}
plugins {
alias libs.plugins.android.application apply false
alias libs.plugins.android.library apply false
alias libs.plugins.kotlin.android apply false
alias libs.plugins.kotlin.kapt apply false
alias libs.plugins.kotlin.parcelize apply false
alias libs.plugins.kotlin.jvm apply false
alias libs.plugins.kotlin.serialization apply false
alias libs.plugins.ksp apply false
alias libs.plugins.anvil apply false
alias libs.plugins.whetstone apply false
alias libs.plugins.kotlinter apply false
alias libs.plugins.detekt apply false
alias libs.plugins.benManesVersions
alias libs.plugins.gradleDoctor
alias libs.plugins.moduleCheck
alias libs.plugins.dependencyAnalysis
}
moduleCheck {
deleteUnused = true
checks {
overShotDependency = true
redundantDependency = false
unusedDependency = false
mustBeApi = true
inheritedDependency = false
sortDependencies = false
sortPlugins = false
unusedKapt = true
anvilFactoryGeneration = true
disableAndroidResources = false
disableViewBinding = true
unusedKotlinAndroidExtensions = true
depths = true
}
additionalCodeGenerators = [
new modulecheck.config.CodeGeneratorBinding.KspExtension(
"konvert",
"io.mcarle:konvert",
["io.mcarle.konvert.api.Konverter"]
)
]
}
doctor {
javaHome {
ensureJavaHomeMatches = false
}
}
def isNonStable = { String version ->
def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) }
def regex = /^[0-9,.v-]+(-r)?$/
return !stableKeyword && !(version ==~ regex)
}
tasks.named("dependencyUpdates").configure {
rejectVersionIf {
isNonStable(it.candidate.version)
}
}