Skip to content

Commit

Permalink
fax build for Java 21
Browse files Browse the repository at this point in the history
  • Loading branch information
wetted committed Oct 23, 2023
1 parent d754f84 commit c68e0a5
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 17 deletions.
6 changes: 4 additions & 2 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
7 changes: 7 additions & 0 deletions buildSrc/settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dependencyResolutionManagement {
versionCatalogs {
libs {
from(files("../gradle/libs.versions.toml"))
}
}
}
13 changes: 13 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
27 changes: 15 additions & 12 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -11,34 +12,36 @@ 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" }
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" }

2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
10 changes: 8 additions & 2 deletions test-suite-kotlin/build.gradle
Original file line number Diff line number Diff line change
@@ -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")
}

Expand All @@ -20,3 +20,9 @@ dependencies {
tasks.named('test') {
useJUnitPlatform()
}

kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
11 changes: 11 additions & 0 deletions test-suite-utils/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
id 'java-library'
id 'groovy'
id("io.micronaut.build.internal.mqtt-tests")
id("io.micronaut.build.internal.common")
}

dependencies {
Expand All @@ -12,3 +13,13 @@ dependencies {
api(libs.testcontainers.spock)
api(mnReactor.micronaut.reactor)
}

spotless {
groovy {
targetExclude("**/test/**")
}
}

tasks.withType(Checkstyle) {
enabled = false
}

0 comments on commit c68e0a5

Please sign in to comment.