diff --git a/build.gradle b/build.gradle index 773ea030..984af453 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ -rootProject.version = '9.9.2' +rootProject.version = "9.10.0" group = 'javasabr' -allprojects { +subprojects { repositories { mavenCentral() @@ -11,8 +11,11 @@ allprojects { apply plugin: "java-test-fixtures" apply plugin: 'maven-publish' - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + java { + toolchain { + languageVersion = JavaLanguageVersion.of(21) + } + } javadoc { failOnError = false @@ -20,17 +23,21 @@ allprojects { test { useJUnitPlatform() + failOnNoDiscoveredTests = false } dependencies { compileOnly libs.jetbrains.annotations + compileOnly libs.jspecify compileOnly libs.lombok annotationProcessor libs.lombok testImplementation libs.junit.api testCompileOnly libs.lombok testCompileOnly libs.jetbrains.annotations + testCompileOnly libs.jspecify testRuntimeOnly libs.junit.engine + testRuntimeOnly libs.junit.platform.launcher testAnnotationProcessor libs.lombok } @@ -44,11 +51,7 @@ allprojects { } }*/ - compileJava { - options.encoding = "UTF-8" - } - - compileTestJava { + tasks.withType(JavaCompile).configureEach { options.encoding = "UTF-8" } @@ -56,20 +59,20 @@ allprojects { options.encoding = "UTF-8" } - task sourcesJar(type: Jar, dependsOn: classes) { - afterEvaluate { - getArchiveClassifier().set("sources") - getArchiveBaseName().set(jar.getArchiveBaseName()) - from sourceSets.main.allSource - } + tasks.register("sourcesJar", Jar) { + dependsOn "classes" + group "build" + archiveClassifier = "sources" + archiveBaseName = jar.archiveBaseName + from sourceSets.main.allSource } - task javadocJar(type: Jar, dependsOn: javadoc) { - afterEvaluate { - getArchiveClassifier().set("javadoc") - getArchiveBaseName().set(jar.getArchiveBaseName()) - from sourceSets.main.allSource - } + tasks.register("javadocJar", Jar) { + dependsOn "javadoc" + group "build" + archiveClassifier = "javadoc" + archiveBaseName = jar.archiveBaseName + from sourceSets.main.allSource } publishing { @@ -106,7 +109,7 @@ allprojects { } tasks.register('testJar', Jar) { - getArchiveClassifier().set("test") + archiveClassifier = "test" from sourceSets.test.output } @@ -114,14 +117,12 @@ allprojects { testArtifacts testJar } - tasks.withType(Test).tap { - configureEach { - maxParallelForks = Runtime.runtime.availableProcessors() - } + tasks.withType(Test).configureEach { + maxParallelForks = Runtime.runtime.availableProcessors() } } wrapper { - gradleVersion = '8.11.1' + gradleVersion = '9.0.0' distributionType = Wrapper.DistributionType.ALL } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 59255aca..3d2ed4fc 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,26 +1,33 @@ [versions] # https://mvnrepository.com/artifact/org.slf4j/slf4j-api -slf4j = "2.0.16" +slf4j = "2.0.17" # https://mvnrepository.com/artifact/io.projectreactor/reactor-core -project-reactor = "3.7.1" +project-reactor = "3.7.8" # https://mvnrepository.com/artifact/jakarta.mail/jakarta.mail-api jakarta-mail = "2.1.3" -angus-mail = "2.0.3" +# https://mvnrepository.com/artifact/org.eclipse.angus/angus-mail +angus-mail = "2.0.4" # https://mvnrepository.com/artifact/org.testcontainers/testcontainers -testcontainers = "1.20.4" +testcontainers = "1.21.3" # https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-engine -junit-jupiter = "5.11.4" +junit-jupiter = "5.13.4" # https://mvnrepository.com/artifact/org.jetbrains/annotations -jetbrains-annotations = "26.0.1" +jetbrains-annotations = "26.0.2" # https://mvnrepository.com/artifact/org.projectlombok/lombok -lombok = "1.18.36" +lombok = "1.18.38" +# https://mvnrepository.com/artifact/org.jspecify/jspecify +jspecify = "1.0.0" +# https://mvnrepository.com/artifact/org.junit.platform/junit-platform-launcher +junit-platform-launcher = "1.13.4" [libraries] project-reactor-core = { module = "io.projectreactor:reactor-core", version.ref = "project-reactor" } jetbrains-annotations = { module = "org.jetbrains:annotations", version.ref = "jetbrains-annotations" } +jspecify = { module = "org.jspecify:jspecify", version.ref = "jspecify" } lombok = { module = "org.projectlombok:lombok", version.ref = "lombok" } junit-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junit-jupiter" } junit-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "junit-jupiter" } +junit-platform-launcher = { module = "org.junit.platform:junit-platform-launcher", version.ref = "junit-platform-launcher" } slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" } slf4j-simple = { module = "org.slf4j:slf4j-simple", version.ref = "slf4j" } slf4j-ext = { module = "org.slf4j:slf4j-ext", version.ref = "slf4j" } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 41d9927a..8bdaf60c 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 11581996..48b43d35 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-all.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 1b6c7873..ef07e016 100755 --- a/gradlew +++ b/gradlew @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright © 2015-2021 the original authors. +# Copyright © 2015 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,13 +82,11 @@ do esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# 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"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -114,7 +114,7 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +CLASSPATH="\\\"\\\"" # Determine the Java command to use to start the JVM. @@ -133,22 +133,29 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. 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=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -193,18 +200,28 @@ if "$cygwin" || "$msys" ; then done fi -# 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. + +# 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 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" \ -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + # Use "xargs" to parse quoted args. # # With -n1 it outputs one arg per line, with the quotes and backslashes removed. diff --git a/gradlew.bat b/gradlew.bat index ac1b06f9..5eed7ee8 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,8 +13,10 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +27,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -40,13 +43,13 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,32 +59,34 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail :execute @rem Setup the command line -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +set CLASSPATH= @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/rlib-common/build.gradle b/rlib-common/build.gradle index ab1cb739..b3fd7a24 100644 --- a/rlib-common/build.gradle +++ b/rlib-common/build.gradle @@ -1,7 +1,3 @@ dependencies { api projects.rlibLoggerApi } - -jar { - archiveBaseName.set('rlib.common') -} \ No newline at end of file diff --git a/rlib-fx/build.gradle b/rlib-fx/build.gradle index 1a4eac72..e0ac566c 100644 --- a/rlib-fx/build.gradle +++ b/rlib-fx/build.gradle @@ -6,10 +6,6 @@ dependencies { api projects.rlibCommon } -jar { - archiveBaseName.set('rlib.fx') -} - javafx { modules = ['javafx.controls'] version = '17' diff --git a/rlib-logger-api/build.gradle b/rlib-logger-api/build.gradle index fe93df1d..e69de29b 100644 --- a/rlib-logger-api/build.gradle +++ b/rlib-logger-api/build.gradle @@ -1,3 +0,0 @@ -jar { - archiveBaseName.set('rlib.logger.api') -} \ No newline at end of file diff --git a/rlib-logger-impl/build.gradle b/rlib-logger-impl/build.gradle index cb9caf10..05c70c97 100644 --- a/rlib-logger-impl/build.gradle +++ b/rlib-logger-impl/build.gradle @@ -1,7 +1,3 @@ dependencies { api projects.rlibCommon } - -jar { - archiveBaseName.set('rlib.logger.impl') -} \ No newline at end of file diff --git a/rlib-logger-slf4j/build.gradle b/rlib-logger-slf4j/build.gradle index c0979892..1fc24540 100644 --- a/rlib-logger-slf4j/build.gradle +++ b/rlib-logger-slf4j/build.gradle @@ -4,7 +4,3 @@ dependencies { testRuntime libs.slf4j.simple } - -jar { - archiveBaseName.set('rlib.logger.slf4j') -} \ No newline at end of file diff --git a/rlib-mail/build.gradle b/rlib-mail/build.gradle index 7fb8e2db..3f6a80e5 100644 --- a/rlib-mail/build.gradle +++ b/rlib-mail/build.gradle @@ -4,7 +4,3 @@ dependencies { testImplementation projects.rlibTestcontainers } - -jar { - archiveBaseName.set('rlib.mail') -} \ No newline at end of file diff --git a/rlib-network/build.gradle b/rlib-network/build.gradle index e36374dd..bc28de0e 100644 --- a/rlib-network/build.gradle +++ b/rlib-network/build.gradle @@ -3,8 +3,3 @@ dependencies { api libs.project.reactor.core testRuntimeOnly projects.rlibLoggerImpl } - -jar { - archiveBaseName.set('rlib.network') -} - diff --git a/rlib-testcontainers/build.gradle b/rlib-testcontainers/build.gradle index b93be804..c143c6a5 100644 --- a/rlib-testcontainers/build.gradle +++ b/rlib-testcontainers/build.gradle @@ -10,7 +10,3 @@ dependencies { testImplementation projects.rlibMail } - -jar { - archiveBaseName.set('rlib.testcontainers') -} \ No newline at end of file