From b0c8cb16f08745625a713d68a8e9b795bf19c9a6 Mon Sep 17 00:00:00 2001 From: Carter Jernigan Date: Thu, 2 Jun 2022 14:53:46 -0400 Subject: [PATCH] [#41] Add dependency update gradle task --- .run/dependencyUpdates.run.xml | 23 +++++++++++++++++++++++ build.gradle.kts | 23 +++++++++++++++++++++++ buildscript-gradle.lockfile | 5 +++++ 3 files changed, 51 insertions(+) create mode 100644 .run/dependencyUpdates.run.xml diff --git a/.run/dependencyUpdates.run.xml b/.run/dependencyUpdates.run.xml new file mode 100644 index 0000000..5fdff61 --- /dev/null +++ b/.run/dependencyUpdates.run.xml @@ -0,0 +1,23 @@ + + + + + + + true + true + false + + + \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 8bbd331..641e080 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -11,6 +11,7 @@ dependencyLocking { plugins { id("bip39.ktlint-conventions") alias(libs.plugins.detekt) + alias(libs.plugins.versions) } tasks { @@ -28,4 +29,26 @@ tasks { baseline.set(file("$rootDir/tools/detekt-baseline.xml")) buildUponDefaultConfig = true } + + withType { + gradleReleaseChannel = "current" + + resolutionStrategy { + componentSelection { + all { + if (isNonStable(candidate.version) && !isNonStable(currentVersion)) { + reject("Unstable") + } + } + } + } + } } + +val unstableKeywords = listOf("alpha", "beta", "rc", "m", "ea", "build") + +fun isNonStable(version: String): Boolean { + val versionLowerCase = version.toLowerCase() + + return unstableKeywords.any { versionLowerCase.contains(it) } +} \ No newline at end of file diff --git a/buildscript-gradle.lockfile b/buildscript-gradle.lockfile index 728b558..5c0b120 100644 --- a/buildscript-gradle.lockfile +++ b/buildscript-gradle.lockfile @@ -1,6 +1,8 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +com.github.ben-manes.versions:com.github.ben-manes.versions.gradle.plugin:0.42.0=classpath +com.github.ben-manes:gradle-versions-plugin:0.42.0=classpath com.github.gundy:semver4j:0.16.4=classpath com.google.code.findbugs:jsr305:3.0.2=classpath com.google.code.gson:gson:2.8.9=classpath @@ -9,8 +11,10 @@ com.google.guava:failureaccess:1.0.1=classpath com.google.guava:guava:29.0-jre=classpath com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=classpath com.google.j2objc:j2objc-annotations:1.3=classpath +com.thoughtworks.xstream:xstream:1.4.17=classpath de.undercouch:gradle-download-task:4.1.1=classpath io.github.detekt.sarif4k:sarif4k:0.0.1=classpath +io.github.x-stream:mxparser:1.2.1=classpath io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.20.0=classpath io.gitlab.arturbosch.detekt:detekt-utils:1.20.0=classpath io.gitlab.arturbosch.detekt:io.gitlab.arturbosch.detekt.gradle.plugin:1.20.0=classpath @@ -45,4 +49,5 @@ org.jetbrains.kotlinx:kotlinx-serialization-core:1.1.0=classpath org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:1.1.0=classpath org.jetbrains.kotlinx:kotlinx-serialization-json:1.1.0=classpath org.jetbrains:annotations:13.0=classpath +xmlpull:xmlpull:1.1.3.1=classpath empty=