-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
78 lines (70 loc) · 1.89 KB
/
build.gradle.kts
File metadata and controls
78 lines (70 loc) · 1.89 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
75
76
77
78
import java.util.Locale
buildscript {
repositories { google() }
}
allprojects {
repositories {
google()
maven("https://jitpack.io")
mavenCentral()
jcenter {
content {
includeGroup("com.adsamcik")
includeGroup("com.github.adsamcik")
}
}
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile::class.java) {
options.compilerArgs = listOf("-Xlint:unchecked", "-Xlint:deprecation")
}
}
// Configure Kotlin compiler options for all projects
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
compilerOptions {
freeCompilerArgs.add("-Xannotation-default-target=param-property")
}
}
}
tasks.register("clean", Delete::class) {
delete(rootProject.layout.buildDirectory)
}
plugins {
// gradlew dependencyUpdates -Drevision=release
alias(libs.plugins.benmanes.versions)
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.android.dynamic.feature) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.parcelize) apply false
alias(libs.plugins.kotlin.compose) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.google.services) apply false
alias(libs.plugins.secrets) apply false
alias(libs.plugins.oss.licenses) apply false
}
/**
* Returns true if version is not considered stable.
*/
fun isStable(version: String): Boolean {
val stableKeyword = listOf("RELEASE", "FINAL", "GA", "RC").any {
version.uppercase(Locale.getDefault())
.contains(it)
}
val regex = "^[0-9,.v-]+(-r)?$".toRegex()
return stableKeyword || regex.matches(version)
}
tasks.named(
"dependencyUpdates",
com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask::class.java
).configure {
resolutionStrategy {
componentSelection {
all {
if (!isStable(candidate.version) && isStable(currentVersion)) {
reject("Release candidate")
}
}
}
}
}