-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle.kts
executable file
·50 lines (43 loc) · 1.13 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
@file:Suppress("UnstableApiUsage")
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
@Suppress("DSL_SCOPE_VIOLATION")
plugins {
alias(libs.plugins.dokka) apply false
alias(libs.plugins.dependencyUpdates)
}
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath(libs.gradle.kotlin)
classpath(libs.gradle.android)
classpath(libs.gradle.jetbrainsCompose)
}
}
allprojects {
repositories {
google()
mavenCentral()
// Needed for dokka
maven(url = "https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven")
}
if (!displayName.contains("example")) {
plugins.apply("org.jetbrains.dokka")
}
}
fun getStabilityLevel(version: String) : Int {
val v = version.toUpperCase()
return when {
v.contains("ALPHA") -> 0
v.contains("BETA") -> 1
v.contains(Regex("(?:RC)|(?:-M[0-9]+)")) -> 2
else -> 3
}
}
tasks.withType<DependencyUpdatesTask> {
rejectVersionIf {
getStabilityLevel(candidate.version) < getStabilityLevel(currentVersion)
}
}