-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
74 lines (64 loc) · 2.19 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
74 lines (64 loc) · 2.19 KB
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
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import org.jlleitschuh.gradle.ktlint.KtlintExtension
plugins {
base
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.android.kotlin.multiplatform.library) apply false
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.compose.multiplatform) apply false
alias(libs.plugins.kotlin.jvm) apply false
alias(libs.plugins.kotlin.multiplatform) apply false
alias(libs.plugins.kotlin.serialization) apply false
alias(libs.plugins.ktlint) apply false
alias(libs.plugins.metro) apply false
id("com.github.ben-manes.versions") version "0.61.0"
}
allprojects {
group = "com.gcaguilar.biciradar"
version = "0.1.0"
}
subprojects {
apply(plugin = "org.jlleitschuh.gradle.ktlint")
extensions.configure<KtlintExtension> {
version.set("1.8.0")
outputToConsole.set(true)
ignoreFailures.set(false)
filter {
exclude { element ->
val path = element.file.path
path.contains("/build/generated/")
}
}
}
}
val ktlintCheckAll by tasks.registering {
group = LifecycleBasePlugin.VERIFICATION_GROUP
description = "Runs ktlint checks for all subprojects."
dependsOn(subprojects.map { "${it.path}:ktlintCheck" })
}
val ktlintFormatAll by tasks.registering {
group = "formatting"
description = "Formats Kotlin sources with ktlint in all subprojects."
dependsOn(subprojects.map { "${it.path}:ktlintFormat" })
}
tasks.named<DependencyUpdatesTask>("dependencyUpdates") {
group = "help"
description = "Checks for available dependency and Gradle version updates."
fun isNonStable(version: String): Boolean {
val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { version.uppercase().contains(it) }
val regex = "^[0-9,.v-]+(-r)?$".toRegex()
val isStable = stableKeyword || regex.matches(version)
return isStable.not()
}
revision = "release"
rejectVersionIf {
isNonStable(candidate.version) && !isNonStable(currentVersion)
}
outputFormatter = "plain,json,html"
outputDir = "build/dependencyUpdates"
reportfileName = "report"
}
tasks.named("check") {
dependsOn(ktlintCheckAll)
}