From d30e3f33bfef72e8478c3f041fa6307751198dd6 Mon Sep 17 00:00:00 2001 From: "Markus M. May" <160079+triplem@users.noreply.github.com> Date: Thu, 26 Jan 2023 11:35:29 +0100 Subject: [PATCH] feat: bump all plugins and dependencies to latest versions (#14) BREAKING CHANGE some of these changes are not working with older version of the plugins (eg. sonarqube). Co-authored-by: May, Markus --- buildSrc/build.gradle.kts | 14 +++++++------- ....javafreedom.aggregation-conventions.gradle.kts | 9 ++++----- ...avafreedom.kotlin-common-conventions.gradle.kts | 6 +++--- .../verification/sonarqube-conventions.gradle.kts | 10 +++------- gradle.properties | 4 ++-- gradle/wrapper/gradle-wrapper.properties | 2 +- 6 files changed, 20 insertions(+), 25 deletions(-) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 71a19e6..61a0103 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -31,15 +31,15 @@ dependencies { implementation(kotlin("gradle-plugin", kotlinVersion)) implementation(kotlin("bom", kotlinVersion)) implementation(kotlin("reflect")) - implementation(kotlin("stdlib-jdk8")) - implementation("org.jetbrains.dokka:dokka-gradle-plugin:$kotlinVersion") { + implementation(kotlin("stdlib")) + implementation("org.jetbrains.dokka:dokka-gradle-plugin:1.7.20") { exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib-jdk8") } - implementation("org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:3.3") - implementation("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.19.0") { + implementation("org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:3.5.0.2730") + implementation("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.22.0") { exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib-jdk8") } - implementation("org.owasp:dependency-check-gradle:6.5.3") - implementation("org.asciidoctor:asciidoctor-gradle-jvm:3.3.2") - implementation("com.bmuschko:gradle-docker-plugin:6.7.0") + implementation("org.owasp:dependency-check-gradle:8.0.1") + implementation("org.asciidoctor:asciidoctor-gradle-jvm:4.0.0-alpha.1") + implementation("com.bmuschko:gradle-docker-plugin:9.1.0") } diff --git a/buildSrc/src/main/kotlin/org.javafreedom.aggregation-conventions.gradle.kts b/buildSrc/src/main/kotlin/org.javafreedom.aggregation-conventions.gradle.kts index 4fcff06..18a192a 100644 --- a/buildSrc/src/main/kotlin/org.javafreedom.aggregation-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/org.javafreedom.aggregation-conventions.gradle.kts @@ -1,6 +1,6 @@ import io.gitlab.arturbosch.detekt.Detekt import org.owasp.dependencycheck.reporting.ReportGenerator -import org.sonarqube.gradle.SonarQubeTask +import org.sonarqube.gradle.SonarTask plugins { id("org.javafreedom.verification.jacoco-consumer-conventions") @@ -47,7 +47,7 @@ subprojects { sonarTestSources.add("src/testIntegration") val testDirs = sonarTestSources.filter { baseDir.resolve(it).exists() }.joinToString() - sonarqube { + sonar { properties { property("sonar.sources", "src/main") property("sonar.kotlin.detekt.reportPaths", reportsDir) @@ -55,7 +55,7 @@ subprojects { } } - tasks.withType().configureEach { + tasks.withType().configureEach { shouldRunAfter("detekt") } } @@ -69,8 +69,7 @@ dependencyCheck { // remove plugin dependencies, for configs see // https://docs.gradle.org/current/userguide/java_plugin.html#sec:java_plugin_and_dependency_management - val validConfigurations = listOf("compileClasspath", "runtimeClasspath", "testCompileClasspath", - "testRuntimeClasspath", "default") + val validConfigurations = listOf("compileClasspath", "runtimeClasspath", "default") scanConfigurations = configurations.names .filter { validConfigurations.contains(it) } .toList() diff --git a/buildSrc/src/main/kotlin/org.javafreedom.kotlin-common-conventions.gradle.kts b/buildSrc/src/main/kotlin/org.javafreedom.kotlin-common-conventions.gradle.kts index b133a9d..2f133a2 100644 --- a/buildSrc/src/main/kotlin/org.javafreedom.kotlin-common-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/org.javafreedom.kotlin-common-conventions.gradle.kts @@ -43,17 +43,17 @@ detekt { dependencies { constraints { // Define dependency versions as constraints - implementation("org.apache.commons:commons-text:1.9") + implementation("org.apache.commons:commons-text:1.10.0") } // Align versions of all Kotlin components implementation(platform("org.jetbrains.kotlin:kotlin-bom")) // Use the Kotlin JDK 8 standard library. - implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") + implementation("org.jetbrains.kotlin:kotlin-stdlib") // Add additonal dependencies useful for development - implementation("io.github.microutils:kotlin-logging:2.1.21") + implementation("io.github.microutils:kotlin-logging:3.0.4") testImplementation("com.willowtreeapps.assertk:assertk-jvm:0.25") testImplementation(kotlin("test")) testImplementation(kotlin("test-junit5")) diff --git a/buildSrc/src/main/kotlin/org/javafreedom/verification/sonarqube-conventions.gradle.kts b/buildSrc/src/main/kotlin/org/javafreedom/verification/sonarqube-conventions.gradle.kts index 26a2038..e693fc7 100644 --- a/buildSrc/src/main/kotlin/org/javafreedom/verification/sonarqube-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/org/javafreedom/verification/sonarqube-conventions.gradle.kts @@ -1,6 +1,6 @@ package org.javafreedom.verification -import org.sonarqube.gradle.SonarQubeTask +import org.sonarqube.gradle.SonarTask plugins { `java-library` @@ -10,7 +10,7 @@ plugins { val github_org: String by project val github_project_url = "https://github.com/${github_org}/${rootProject.name}" -sonarqube { +sonar { properties { // See https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Gradle#AnalyzingwithSonarQubeScannerforGradle-Configureanalysisproperties property("sonar.sourceEncoding", "UTF-8") @@ -29,10 +29,6 @@ sonarqube { } } -tasks.withType().configureEach { +tasks.withType().configureEach { dependsOn(project.tasks.named("aggregateJacocoTestReport")) } - -//tasks.named("check") { -// dependsOn("sonarqube") -//} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 530fce8..09b3548 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,5 +2,5 @@ github_org=triplem org.gradle.jvmargs=-XX:MaxMetaspaceSize=512m org.gradle.caching=true -kotlinVersion=1.6.10 -junitVersion=5.8.2 +kotlinVersion=1.8.0 +junitVersion=5.9.2 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 41dfb87..070cb70 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists