@@ -64,8 +64,8 @@ dependencies {
6464}
6565
6666java {
67- sourceCompatibility = JavaVersion .VERSION_1_8
68- targetCompatibility = JavaVersion .VERSION_1_8
67+ sourceCompatibility = JavaVersion .toVersion(libs.versions.java.sdk.get())
68+ targetCompatibility = JavaVersion .toVersion(libs.versions.java.sdk.get())
6969
7070 withJavadocJar()
7171 withSourcesJar()
@@ -79,7 +79,7 @@ tasks.javadoc {
7979
8080detekt {
8181 toolVersion = libs.versions.detekt.get()
82- config = files(" ${project.rootDir} /config/detekt.yml" )
82+ config.setFrom( files(" ${project.rootDir} /config/detekt.yml" ) )
8383 autoCorrect = true
8484}
8585
@@ -94,9 +94,10 @@ tasks {
9494 maxHeapSize = " 1G"
9595 }
9696
97- withType< io.gitlab.arturbosch.detekt.Detekt > {
98- // Target version of the generated JVM bytecode. It is used for type resolution.
99- this .jvmTarget = " 1.8"
97+ withType< org.jetbrains.kotlin.gradle.tasks.KotlinCompile > ().configureEach {
98+ kotlinOptions {
99+ jvmTarget = libs.versions.java.sdk.get()
100+ }
100101 }
101102
102103 val installGitHooks by registering(Copy ::class ) {
@@ -169,18 +170,16 @@ publishing {
169170 }
170171 }
171172}
172-
173- // https://github.com/ben-manes/gradle-versions-plugin
174- // Disallow release candidates as upgradable versions from stable versions
175- fun String.isNonStable (): Boolean {
176- val stableKeyword = listOf (" RELEASE" , " FINAL" , " GA" ).any { toUpperCase().contains(it) }
177- val regex = " ^[0-9,.v-]+(-r)?$" .toRegex()
178- val isStable = stableKeyword || regex.matches(this )
179- return isStable.not ()
180- }
181-
173+ // Get only stable versions when running dependencyUpdates
182174tasks.withType<DependencyUpdatesTask > {
175+ fun isNonStable (version : String ): Boolean {
176+ val stableKeyword = listOf (" RELEASE" , " FINAL" , " GA" ).any { version.uppercase().contains(it) }
177+ val regex = " ^[0-9,.v-]+(-r)?$" .toRegex()
178+ val isStable = stableKeyword || regex.matches(version)
179+ return isStable.not ()
180+ }
181+
183182 rejectVersionIf {
184- candidate.version.isNonStable( ) && ! currentVersion. isNonStable()
183+ isNonStable( this . candidate.version) && ! isNonStable(this .currentVersion )
185184 }
186185}
0 commit comments