diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 5fa62447..ff1e63fb 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -8,6 +8,8 @@ repositories { dependencies { implementation("org.graalvm.buildtools.native:org.graalvm.buildtools.native.gradle.plugin:0.9.25") - implementation("io.micronaut.gradle:micronaut-gradle-plugin:4.0.3") - implementation("io.micronaut.gradle:micronaut-test-resources-plugin:4.0.0-M8") + implementation (libs.gradle.kotlin) + implementation (libs.gradle.kotlin.allopen) + implementation (libs.gradle.kotlin.noarg) + implementation (libs.micronaut.gradle.plugin) } diff --git a/buildSrc/settings.gradle b/buildSrc/settings.gradle new file mode 100644 index 00000000..6f31e6ef --- /dev/null +++ b/buildSrc/settings.gradle @@ -0,0 +1,7 @@ +dependencyResolutionManagement { + versionCatalogs { + libs { + from(files("../gradle/libs.versions.toml")) + } + } +} diff --git a/gradle.properties b/gradle.properties index 63958621..2c72c576 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,3 +14,16 @@ apimqttv3=https://www.eclipse.org/paho/files/javadoc/ org.gradle.caching=true org.gradle.jvmargs=-Xmx1g + +# No matter which Java toolchain we use, the Kotlin Daemon is always invoked by the current JDK. +# Therefor to fix Kapt errors when running tests under Java 21, we need to open up some modules for the Kotlin Daemon. +kotlin.daemon.jvmargs=--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED\ + --add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED \ + --add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED \ + --add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \ + --add-opens=jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED \ + --add-opens=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED \ + --add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \ + --add-opens=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED \ + --add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \ + --add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 7ca0020a..b0d5deba 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,8 +1,9 @@ [versions] micronaut-docs = "2.0.0" -micronaut = "4.0.0" +micronaut = "4.1.10" +micronaut-gradle-plugin = "4.1.1" -groovy = "4.0.13" +groovy = "4.0.15" spock = "2.3-groovy-4.0" managed-mqttv3 = "1.2.5" @@ -11,27 +12,26 @@ managed-hivemq-client = "1.3.1" awaitility = "4.2.0" bcpkix-jdk15on = "1.70" -kotlin = "1.8.22" -testcontainers = "1.18.3" +kotlin = "1.9.10" +testcontainers = "1.19.1" micronaut-reactor = "3.0.0" micronaut-serde = "2.0.0" micronaut-test = "4.0.0" micronaut-validation = "4.0.0" -micronaut-logging = "1.0.0" +micronaut-logging = "1.1.2" [libraries] # Core micronaut-core = { module = 'io.micronaut:micronaut-core-bom', version.ref = 'micronaut' } - micronaut-reactor = { module = "io.micronaut.reactor:micronaut-reactor-bom", version.ref = "micronaut-reactor" } +micronaut-serde = { module = "io.micronaut.serde:micronaut-serde-bom", version.ref = "micronaut-serde" } +micronaut-validation = { module = "io.micronaut.validation:micronaut-validation-bom", version.ref = "micronaut-validation" } + managed-paho-mqttv3-client = { module = "org.eclipse.paho:org.eclipse.paho.client.mqttv3", version.ref = "managed-mqttv3" } managed-paho-mqttv5-client = { module = "org.eclipse.paho:org.eclipse.paho.mqttv5.client", version.ref = "managed-mqttv5" } managed-hivemq-client = { module = "com.hivemq:hivemq-mqtt-client", version.ref = "managed-hivemq-client" } -micronaut-serde = { module = "io.micronaut.serde:micronaut-serde-bom", version.ref = "micronaut-serde" } -micronaut-validation = { module = "io.micronaut.validation:micronaut-validation-bom", version.ref = "micronaut-validation" } - awaitility = { module = "org.awaitility:awaitility", version.ref = "awaitility" } bcpkix-jdk15on = { module = "org.bouncycastle:bcpkix-jdk15on", version.ref = "bcpkix-jdk15on" } junit-jupiter-api = { module = "org.junit.jupiter:junit-jupiter-api" } @@ -39,6 +39,9 @@ junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine" } kotlin-stdlib-jdk8 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin" } testcontainers-spock = { module = "org.testcontainers:spock", version.ref = "testcontainers" } -[plugins] -kotlin-jvm = { id = 'org.jetbrains.kotlin.jvm', version.ref = 'kotlin' } -kotlin-kapt = { id = 'org.jetbrains.kotlin.kapt', version.ref = 'kotlin' } +gradle-kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } +gradle-kotlin-allopen = { module = "org.jetbrains.kotlin:kotlin-allopen", version.ref = "kotlin" } +gradle-kotlin-noarg = { module = "org.jetbrains.kotlin:kotlin-noarg", version.ref = "kotlin" } + +micronaut-gradle-plugin = { module = "io.micronaut.gradle:micronaut-gradle-plugin", version.ref="micronaut-gradle-plugin" } + diff --git a/settings.gradle b/settings.gradle index d2dac439..bfdb5d1b 100644 --- a/settings.gradle +++ b/settings.gradle @@ -6,7 +6,7 @@ pluginManagement { } plugins { - id("io.micronaut.build.shared.settings") version "6.5.3" + id("io.micronaut.build.shared.settings") version "6.6.0" } enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") diff --git a/test-suite-kotlin/build.gradle b/test-suite-kotlin/build.gradle index c0c52581..8d15eb61 100644 --- a/test-suite-kotlin/build.gradle +++ b/test-suite-kotlin/build.gradle @@ -1,6 +1,6 @@ plugins { - alias libs.plugins.kotlin.jvm - alias libs.plugins.kotlin.kapt + id "org.jetbrains.kotlin.jvm" + id("org.jetbrains.kotlin.kapt") id("io.micronaut.build.internal.mqtt-tests") } @@ -20,3 +20,9 @@ dependencies { tasks.named('test') { useJUnitPlatform() } + +kotlin { + jvmToolchain { + languageVersion.set(JavaLanguageVersion.of(17)) + } +} diff --git a/test-suite-utils/build.gradle b/test-suite-utils/build.gradle index 6137dca7..47e99d31 100644 --- a/test-suite-utils/build.gradle +++ b/test-suite-utils/build.gradle @@ -2,6 +2,7 @@ plugins { id 'java-library' id 'groovy' id("io.micronaut.build.internal.mqtt-tests") + id("io.micronaut.build.internal.common") } dependencies { @@ -12,3 +13,13 @@ dependencies { api(libs.testcontainers.spock) api(mnReactor.micronaut.reactor) } + +spotless { + groovy { + targetExclude("**/test/**") + } +} + +tasks.withType(Checkstyle) { + enabled = false +}