-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathbuild.gradle.kts
49 lines (42 loc) · 1.7 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
plugins {
alias(libs.plugins.google.ksp) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.android.application) apply false
alias(libs.plugins.androidx.room) apply false
alias(libs.plugins.kotlin.serialization) apply false
alias(libs.plugins.kotlin.parcelize) apply false
alias(libs.plugins.kotlin.multiplatform) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.compose) apply false
alias(libs.plugins.rikka.refine) apply false
alias(libs.plugins.benmanes.version)
alias(libs.plugins.littlerobots.version)
}
// https://kotlinlang.org/docs/js-project-setup.html#use-pre-installed-node-js
rootProject.plugins.withType<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin> {
@Suppress("DEPRECATION")
rootProject.the<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension>().download =
false
}
val normalVersionRegex by lazy { "^[0-9\\.]+".toRegex() }
fun isSameTypeVersion(currentVersion: String, newVersion: String): Boolean {
if (normalVersionRegex.matches(currentVersion)) {
return normalVersionRegex.matches(newVersion)
}
arrayOf("alpha", "beta", "dev", "rc").forEach { v ->
if (currentVersion.contains(v, true)) {
return newVersion.contains(v, true)
}
}
throw IllegalArgumentException("Unknown version type: $currentVersion -> $newVersion")
}
tasks.withType<com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask> {
rejectVersionIf {
!isSameTypeVersion(currentVersion, candidate.version)
}
}
projectDir.resolve("./gradle/libs.versions.updates.toml").apply {
if (exists()) {
delete()
}
}