Skip to content

Commit

Permalink
Remove dependency updates plugin
Browse files Browse the repository at this point in the history
Not necessary anymore after exclusively using renovate.
  • Loading branch information
Maxr1998 authored and nielsvanvelzen committed Jun 11, 2023
1 parent 187290f commit 56b6c05
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 38 deletions.
21 changes: 0 additions & 21 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import com.github.benmanes.gradle.versions.updates.gradle.GradleReleaseChannel
import io.gitlab.arturbosch.detekt.Detekt
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

Expand All @@ -10,7 +8,6 @@ plugins {
alias(libs.plugins.kotlin.parcelize)
alias(libs.plugins.detekt)
alias(libs.plugins.android.junit5)
alias(libs.plugins.dependencyupdates)
}

// Apply workaround
Expand Down Expand Up @@ -211,24 +208,6 @@ tasks {
}
}

// Configure dependency updates task
withType<DependencyUpdatesTask> {
gradleReleaseChannel = GradleReleaseChannel.CURRENT.id
rejectVersionIf {
val currentType = classifyVersion(currentVersion)
val candidateType = classifyVersion(candidate.version)

when (candidateType) {
// Always accept stable updates
VersionType.STABLE -> true
// Accept milestone updates for current milestone and unstable
VersionType.MILESTONE -> currentType != VersionType.STABLE
// Only accept unstable for current unstable
VersionType.UNSTABLE -> currentType == VersionType.UNSTABLE
}.not()
}
}

register("versionTxt") {
val path = buildDir.resolve("version.txt")

Expand Down
15 changes: 0 additions & 15 deletions buildSrc/src/main/kotlin/VersionUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,3 @@ fun getVersionCode(versionName: String): Int {

return code
}

enum class VersionType {
STABLE, MILESTONE, UNSTABLE
}

fun classifyVersion(version: String): VersionType {
val normalizedVersion = version.toLowerCase(Locale.ROOT)
return when {
normalizedVersion.containsAny(listOf("alpha", "beta", "dev")) -> VersionType.UNSTABLE
normalizedVersion.containsAny(listOf("rc", "m")) -> VersionType.MILESTONE
else -> VersionType.STABLE
}
}

fun String.containsAny(strings: Iterable<String>): Boolean = strings.any { contains(it) }
2 changes: 0 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ kotlin = "1.8.21"
kotlin-ksp = "1.8.21-1.0.11"
detekt = "1.22.0"
android-junit5 = "1.9.3.0"
dependencyupdates = "0.46.0"

# KotlinX
coroutines = "1.7.1"
Expand Down Expand Up @@ -70,7 +69,6 @@ kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref =
kotlin-ksp = { id = "com.google.devtools.ksp", version.ref = "kotlin-ksp" }
android-junit5 = { id = "de.mannodermaus.android-junit5", version.ref = "android-junit5" }
detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
dependencyupdates = { id = "com.github.ben-manes.versions", version.ref = "dependencyupdates" }

[libraries]
# KotlinX
Expand Down

0 comments on commit 56b6c05

Please sign in to comment.