-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathbuild.gradle.kts
36 lines (32 loc) · 1.32 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
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.android.test) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.compose.compiler) apply false
alias(libs.plugins.kotlin.parcelize) apply false
alias(libs.plugins.hilt) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.play) apply false
alias(libs.plugins.baselineprofile) apply false
alias(libs.plugins.ktlint)
alias(libs.plugins.versions)
alias(libs.plugins.versionCatalogUpdate)
}
tasks.withType<DependencyUpdatesTask> {
checkForGradleUpdate = true
outputFormatter = "json"
outputDir = "build/dependencyUpdates"
reportfileName = "report"
rejectVersionIf {
isNonStable(candidate.version) && !isNonStable(currentVersion)
}
}
// Taken from https://github.com/ben-manes/gradle-versions-plugin#rejectversionsif-and-componentselection
private 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()
}