Skip to content

Commit

Permalink
perf: update libs
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed Jan 13, 2025
1 parent b686865 commit 9e1ab82
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
26 changes: 25 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,30 @@ plugins {

// 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()
}
}
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
kotlin = "2.1.0"
ksp = "2.1.0-1.0.29"
android = "8.7.3"
android = "8.8.0"
compose = "1.7.6"
rikka = "4.4.0"
room = "2.6.1"
Expand Down

0 comments on commit 9e1ab82

Please sign in to comment.