diff --git a/.editorconfig b/.editorconfig index a9a165bae9..6ef5d690a7 100644 --- a/.editorconfig +++ b/.editorconfig @@ -12,6 +12,9 @@ end_of_line = lf [{*.bat,*.cmd}] end_of_line = crlf +[{*.mustache,*.ftl}] +insert_final_newline = false + [*.java] indent_size = 4 tab_width = 4 diff --git a/.github/workflows/graalvm-latest.yml b/.github/workflows/graalvm-latest.yml index bfbfff345f..d150aa6064 100644 --- a/.github/workflows/graalvm-latest.yml +++ b/.github/workflows/graalvm-latest.yml @@ -34,7 +34,9 @@ jobs: runs-on: ubuntu-latest strategy: max-parallel: 6 - matrix: ${{ fromJson(needs.build_matrix.outputs.matrix) }} + matrix: + java: ['17', '21'] + native_test_task: ${{ fromJson(needs.build_matrix.outputs.matrix).native_test_task }} env: GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USERNAME }} @@ -46,7 +48,7 @@ jobs: id: pre-build with: distribution: 'graalvm' - java: '17' + java: ${{ matrix.java }} - name: Build Steps uses: micronaut-projects/github-actions/graalvm/build@master id: build @@ -60,4 +62,4 @@ jobs: uses: micronaut-projects/github-actions/graalvm/post-build@master id: post-build with: - java: '17' + java: ${{ matrix.java }} diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index f601824514..7c0d4941be 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: ['17'] + java: ['17', '21'] env: GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USERNAME }} @@ -64,7 +64,7 @@ jobs: ./gradlew check --no-daemon --continue - name: "🔎 Run static analysis" - if: env.SONAR_TOKEN != '' + if: env.SONAR_TOKEN != '' && matrix.java == '17' run: | ./gradlew sonar diff --git a/docs-examples/example-kotlin/build.gradle b/docs-examples/example-kotlin/build.gradle index 5b9c36c24a..640abb9514 100644 --- a/docs-examples/example-kotlin/build.gradle +++ b/docs-examples/example-kotlin/build.gradle @@ -1,5 +1,3 @@ -import org.jetbrains.kotlin.gradle.dsl.JvmTarget - plugins { alias(libs.plugins.kotlin.jvm) alias(libs.plugins.kotlin.kapt) @@ -50,10 +48,9 @@ test { failFast = true } -compileTestKotlin { - compilerOptions { - jvmTarget = JvmTarget.JVM_17 - javaParameters = true +kotlin { + jvmToolchain { + languageVersion.set(JavaLanguageVersion.of(17)) } } ext.skipDocumentation=true diff --git a/gradle.properties b/gradle.properties index c86ee2d40d..161461f3f0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,3 +13,16 @@ developers=Puneet Behl,Álvaro Sánchez-Mariscal,Iván López org.gradle.caching=true kotlin.stdlib.default.dependency=false org.gradle.jvmargs=-Xmx1g -Dfile.encoding=UTF-8 + +# 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/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 033e24c4cd..7f93135c49 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ac72c34e8a..3fa8f862f7 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index fcb6fca147..1aa94a4269 100755 --- a/gradlew +++ b/gradlew @@ -83,7 +83,8 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -144,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -201,11 +202,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/settings.gradle b/settings.gradle index b8e6a52ac0..e834d55685 100644 --- a/settings.gradle +++ b/settings.gradle @@ -7,7 +7,7 @@ pluginManagement { } plugins { - id 'io.micronaut.build.shared.settings' version '6.5.7' + id 'io.micronaut.build.shared.settings' version '6.6.0' } enableFeaturePreview 'TYPESAFE_PROJECT_ACCESSORS'