diff --git a/gradle.properties b/gradle.properties index a8511d295..1c7aa280c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,8 +2,3 @@ systemProp.org.gradle.internal.publish.checksums.insecure=true systemProp.javax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl systemProp.javax.xml.transform.TransformerFactory=com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl systemProp.javax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl -quarkusPluginId=io.quarkus -quarkusPluginVersion=3.9.1 -quarkusPlatformGroupId=io.quarkus.platform -quarkusPlatformArtifactId=quarkus-bom -quarkusPlatformVersion=3.9.1 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index d097d6c60..977439c70 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,46 +1,48 @@ [versions] -junit = "5.10.1" +junit = "5.10.2" reactivestreams = "1.0.4" -checkerframework = "3.42.0" +checkerframework = "3.43.0" gson = "2.10.1" -jackson = "2.16.1" -protobuf = "3.21.12" # Looks like we're stuck with this version: https://github.com/protocolbuffers/protobuf/issues/12639 -errorprone = "2.24.1" +jackson = "2.17.1" +protobuf = "4.26.1" +errorprone = "2.27.1" brotli-dec = "0.1.2" okhttp = "5.0.0-alpha.7" jmh = "1.37" -reactor = "3.6.2" -nullaway-core = "0.10.21" +reactor = "3.6.5" +nullaway-core = "0.10.26" jaxb-api = "2.3.1" -jaxb-impl = "2.3.8" -jaxb-jakarta-api = "4.0.1" -jaxb-jakarta-impl = "4.0.3" +jaxb-impl = "2.3.9" +jaxb-jakarta-api = "4.0.2" +jaxb-jakarta-impl = "4.0.5" moxy = "2.7.14" jsoup = "1.17.2" -testng = "7.9.0" +testng = "7.10.2" jimfs = "1.3.0" -assertj = "3.25.2" -awaitility = "4.2.0" +assertj = "3.25.3" +awaitility = "4.2.1" hamcrest = "2.2" spring-boot = "2.7.18" autoservice = "1.1.1" -bson4jackson = "2.15.0" +bson4jackson = "2.15.1" jacoco = "0.8.8" -lettuce = "6.3.1.RELEASE" +lettuce = "6.3.2.RELEASE" javaparser = "3.25.3" -mockito = "5.10.0" +mockito = "5.11.0" javafx-platform = "17.0.10" +quarkus = "3.10.0" versions-plugin = "0.51.0" -nexus-publish = "2.0.0-rc-1" +nexus-publish = "2.0.0" coveralls-plugin = "2.12.2" protobuf-plugin = "0.9.4" -spring-dependency-management-plugin = "1.1.4" +spring-dependency-management-plugin = "1.1.5" shadow-plugin = "8.1.1" -extraJavaModuleInfo-plugin = "1.7" +extraJavaModuleInfo-plugin = "1.8" javafx-plugin = "0.1.0" checkerframework-plugin = "0.6.27" errorprone-plugin = "3.1.0" nullaway-plugin = "1.5.0" +graalvm-plugin = "0.10.1" [libraries] junit-bom = { module = "org.junit:junit-bom", version.ref = "junit" } @@ -86,6 +88,10 @@ bson4jackson = { module = "de.undercouch:bson4jackson", version.ref = "bson4jack lettuce = { module = "io.lettuce:lettuce-core", version.ref = "lettuce" } javaparser = { module = "com.github.javaparser:javaparser-symbol-solver-core", version.ref = "javaparser" } mockito = { module = "org.mockito:mockito-core", version.ref = "mockito" } +quarkus-rest-jackson = { module = "io.quarkus:quarkus-rest-jackson" } +quarkus-junit5 = { module = "io.quarkus:quarkus-junit5" } +rest-assured = { module = "io.rest-assured:rest-assured" } +quarkus-bom = { module = "io.quarkus.platform:quarkus-bom", version.ref = "quarkus" } checkerframework-plugin = { module = "org.checkerframework:checkerframework-gradle-plugin", version.ref = "checkerframework-plugin" } errorprone-plugin = { module = "net.ltgt.gradle:gradle-errorprone-plugin", version.ref = "errorprone-plugin" } nullaway-plugin = { module = "net.ltgt.gradle:gradle-nullaway-plugin", version.ref = "nullaway-plugin" } @@ -100,3 +106,5 @@ shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadow-plugin" extraJavaModuleInfo = { id = "org.gradlex.extra-java-module-info", version.ref = "extraJavaModuleInfo-plugin" } javafx = { id = "org.openjfx.javafxplugin", version.ref = "javafx-plugin" } nexus-publish = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "nexus-publish" } +quarkus = { id = "io.quarkus", version.ref = "quarkus" } +graalvm = { id = "org.graalvm.buildtools.native", version.ref = "graalvm-plugin" } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index c1962a79e..d64cd4917 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 829e1a5a9..e7646dead 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 5f23fddca..1aa94a426 100755 --- a/gradlew +++ b/gradlew @@ -1,25 +1,19 @@ #!/bin/sh # -# Copyright (c) 2023 Moataz Abdelnasser +# Copyright © 2015-2021 the original authors. # -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. +# https://www.apache.org/licenses/LICENSE-2.0 # -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # ############################################################################## @@ -89,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 @@ -136,10 +131,13 @@ 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. @@ -147,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 @@ -155,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 @@ -204,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/methanol-testing/src/main/java/com/github/mizosoft/methanol/testing/MockGzipStream.java b/methanol-testing/src/main/java/com/github/mizosoft/methanol/testing/MockGzipStream.java index acd3d1fd3..bcf86c475 100644 --- a/methanol-testing/src/main/java/com/github/mizosoft/methanol/testing/MockGzipStream.java +++ b/methanol-testing/src/main/java/com/github/mizosoft/methanol/testing/MockGzipStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Moataz Abdelnasser + * Copyright (c) 2024 Moataz Abdelnasser * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -47,7 +47,7 @@ import java.util.zip.DeflaterInputStream; import org.checkerframework.checker.nullness.qual.Nullable; -/** A mock gzip stream with configurable gzip stream fields & corruption modes. */ +/** A mock gzip stream with configurable gzip stream fields {@code &} corruption modes. */ public final class MockGzipStream { private static final int GZIP_MAGIC = 0x8B1F; private static final int CM_DEFLATE = 8; diff --git a/native-test/build.gradle.kts b/native-test/build.gradle.kts index 1d3826766..1cbf30b6e 100644 --- a/native-test/build.gradle.kts +++ b/native-test/build.gradle.kts @@ -3,7 +3,7 @@ plugins { id("conventions.static-analysis") id("conventions.testing") id("conventions.coverage") - id("org.graalvm.buildtools.native") version "0.10.1" + alias(libs.plugins.graalvm) } dependencies { diff --git a/quarkus-native-test/build.gradle.kts b/quarkus-native-test/build.gradle.kts index 370b96032..acd022c95 100644 --- a/quarkus-native-test/build.gradle.kts +++ b/quarkus-native-test/build.gradle.kts @@ -3,7 +3,7 @@ plugins { id("conventions.static-analysis") id("conventions.testing") id("conventions.coverage") - id("io.quarkus") + alias(libs.plugins.quarkus) } dependencies { @@ -14,15 +14,10 @@ dependencies { implementation(libs.mockwebserver) implementation(libs.autoservice.annotations) annotationProcessor(libs.autoservice.annprocess) - - val quarkusPlatformGroupId: String by project - val quarkusPlatformArtifactId: String by project - val quarkusPlatformVersion: String by project - implementation(enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}")) - - implementation("io.quarkus:quarkus-rest-jackson") - testImplementation("io.quarkus:quarkus-junit5") - testImplementation("io.rest-assured:rest-assured") + implementation(enforcedPlatform(libs.quarkus.bom)) + implementation(libs.quarkus.rest.jackson) + testImplementation(libs.quarkus.junit5) + testImplementation(libs.rest.assured) } tasks.withType { diff --git a/settings.gradle.kts b/settings.gradle.kts index 665672b66..51ba9c3ac 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,3 +1,4 @@ +import java.io.FileNotFoundException import java.util.* rootProject.name = "methanol-parent" @@ -21,33 +22,22 @@ include("spring-boot-test") include("methanol-redis") // Load local properties while giving precedence to properties defined through CLI. - -rootDir.resolve("local.properties") - .takeIf { it.exists() } - ?.inputStream() - ?.run { use { stream -> Properties().apply { load(stream) } } } - ?.filter { !gradle.startParameter.projectProperties.containsKey(it.key) } - ?.also { localProperties -> - localProperties.forEach { (name, value) -> settings.extra[name.toString()] = value } - gradle.rootProject { - localProperties.forEach { (name, value) -> project.extra[name.toString()] = value } +try { + rootDir.resolve("local.properties") + .inputStream() + .run { use { stream -> Properties().apply { load(stream) } } } + .filter { !gradle.startParameter.projectProperties.containsKey(it.key) } + .also { localProperties -> + localProperties.forEach { (name, value) -> settings.extra[name.toString()] = value } + gradle.rootProject { + localProperties.forEach { (name, value) -> project.extra[name.toString()] = value } + } } - } +} catch (_: FileNotFoundException) { +} val includeNativeTests: String? by settings if (includeNativeTests != null) { - pluginManagement { - val quarkusPluginVersion: String by settings - val quarkusPluginId: String by settings - repositories { - mavenCentral() - gradlePluginPortal() - } - plugins { - id(quarkusPluginId) version quarkusPluginVersion - } - } - include("quarkus-native-test") include("native-test") }