mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 12:57:04 +05:30
gradle: migrate to build-logic
This commit is contained in:
parent
4cef244d71
commit
3097eaf82f
26 changed files with 501 additions and 182 deletions
|
@ -1,7 +1,5 @@
|
|||
@file:Suppress("DSL_SCOPE_VIOLATION", "UnstableApiUsage")
|
||||
|
||||
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
maven {
|
||||
|
@ -9,44 +7,14 @@ buildscript {
|
|||
content { includeModule("com.android.tools", "r8") }
|
||||
}
|
||||
}
|
||||
dependencies { classpath(libs.r8) }
|
||||
dependencies {
|
||||
classpath(libs.r8)
|
||||
classpath(libs.javapoet)
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
alias(libs.plugins.spotless)
|
||||
alias(libs.plugins.versions)
|
||||
alias(libs.plugins.vcu)
|
||||
}
|
||||
|
||||
fun isNonStable(version: String): Boolean {
|
||||
val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { version.toUpperCase().contains(it) }
|
||||
val regex = "^[0-9,.v-]+(-r)?$".toRegex()
|
||||
val isStable = stableKeyword || regex.matches(version)
|
||||
return isStable.not()
|
||||
}
|
||||
|
||||
tasks.withType<DependencyUpdatesTask>().configureEach {
|
||||
rejectVersionIf {
|
||||
when (candidate.group) {
|
||||
"com.android.application", "com.android.library" -> true
|
||||
else -> isNonStable(candidate.version) && !isNonStable(currentVersion)
|
||||
}
|
||||
}
|
||||
checkForGradleUpdate = false
|
||||
checkBuildEnvironmentConstraints = true
|
||||
outputFormatter = "json"
|
||||
outputDir = "build/dependencyUpdates"
|
||||
reportfileName = "report"
|
||||
}
|
||||
|
||||
spotless {
|
||||
kotlin {
|
||||
target("**/*.kt")
|
||||
targetExclude("**/build/**")
|
||||
ktfmt("0.35").googleStyle()
|
||||
}
|
||||
kotlinGradle {
|
||||
target("**/*.gradle.kts")
|
||||
ktfmt("0.35").googleStyle()
|
||||
}
|
||||
id("dev.msfjarvis.claw.spotless")
|
||||
id("dev.msfjarvis.claw.versions")
|
||||
id("dev.msfjarvis.claw.kotlin-common")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue