diff --git a/build.gradle.kts b/build.gradle.kts index e548f64..ee30dc6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -31,7 +31,7 @@ subprojects { } extensions.configure { - toolVersion = "1.23.7" + toolVersion = "1.23.8" // :samples is illustrative protocol code, not library code; relax // size/complexity rules there while keeping naming + forbidden // patterns enforced. See config/detekt/detekt-samples.yml. diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index a845a90..b2e2465 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,22 +1,22 @@ [versions] -kotlin = "2.0.21" -coroutines = "1.9.0" -serialization = "1.7.3" -datetime = "0.6.1" -ktor = "2.3.12" -sqlite = "3.46.1.3" -jose-jwt = "9.40" -kotlin-logging = "7.0.0" -slf4j = "2.0.16" -logback = "1.5.8" -json-schema-validator = "1.5.2" -clikt = "5.0.1" -kotest = "5.9.1" -ktlint = "12.1.1" -detekt = "1.23.7" -kover = "0.8.3" -dokka = "1.9.20" -binary-compatibility-validator = "0.16.3" +kotlin = "2.3.21" +coroutines = "1.11.0" +serialization = "1.11.0" +datetime = "0.6.2" +ktor = "3.5.0" +sqlite = "3.53.1.0" +jose-jwt = "10.9" +kotlin-logging = "8.0.03" +slf4j = "2.0.18" +logback = "1.5.32" +json-schema-validator = "3.0.2" +clikt = "5.1.0" +kotest = "6.1.11" +ktlint = "14.2.0" +detekt = "1.23.8" +kover = "0.9.8" +dokka = "2.2.0" +binary-compatibility-validator = "0.18.1" nexus-publish = "2.0.0" [libraries] diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 74a4ead..df6a6ad 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.10.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip networkTimeout=10000 retries=0 retryBackOffMs=500 diff --git a/gradlew.bat b/gradlew.bat index 24c62d5..aa5f10b 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,82 +1,82 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@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 -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables, and ensure extensions are enabled -setlocal EnableExtensions - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -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 - -"%COMSPEC%" /c exit 1 - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -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 - -"%COMSPEC%" /c exit 1 - -:execute -@rem Setup the command line - - - -@rem Execute Gradle -@rem endlocal doesn't take effect until after the line is parsed and variables are expanded -@rem which allows us to clear the local environment before executing the java command -endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel - -:exitWithErrorLevel -@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts -"%COMSPEC%" /c exit %ERRORLEVEL% +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@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 +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables, and ensure extensions are enabled +setlocal EnableExtensions + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +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 + +"%COMSPEC%" /c exit 1 + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +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 + +"%COMSPEC%" /c exit 1 + +:execute +@rem Setup the command line + + + +@rem Execute Gradle +@rem endlocal doesn't take effect until after the line is parsed and variables are expanded +@rem which allows us to clear the local environment before executing the java command +endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel + +:exitWithErrorLevel +@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts +"%COMSPEC%" /c exit %ERRORLEVEL% diff --git a/lib/build.gradle.kts b/lib/build.gradle.kts index dbc6b31..555a034 100644 --- a/lib/build.gradle.kts +++ b/lib/build.gradle.kts @@ -16,7 +16,7 @@ kotlin { allWarningsAsErrors = true freeCompilerArgs.addAll( "-Xjsr305=strict", - "-Xjvm-default=all", + "-jvm-default=enable", ) } } diff --git a/lib/src/main/kotlin/dev/arcp/store/EventLog.kt b/lib/src/main/kotlin/dev/arcp/store/EventLog.kt index 24330e2..372d53d 100644 --- a/lib/src/main/kotlin/dev/arcp/store/EventLog.kt +++ b/lib/src/main/kotlin/dev/arcp/store/EventLog.kt @@ -14,9 +14,8 @@ import kotlinx.serialization.json.JsonElement import java.nio.file.Path import java.sql.Connection import java.sql.DriverManager -import java.sql.ResultSet import java.sql.SQLException -import java.util.concurrent.atomic.AtomicReference +import java.util.concurrent.atomic.AtomicBoolean private val log = KotlinLogging.logger {} @@ -249,7 +248,7 @@ public class EventLog private constructor( /** Opens an event log backed by a file. */ public fun openFile(path: Path): EventLog = open("jdbc:sqlite:${path.toAbsolutePath()}") - private val driverLoaded = AtomicReference(false) + private val driverLoaded = AtomicBoolean(false) private fun open(jdbcUrl: String): EventLog { ensureDriver() @@ -276,8 +275,5 @@ public class EventLog private constructor( .forEach { stmt -> st.execute(stmt) } } } - - @Suppress("UnusedPrivateMember", "unused") - private fun ResultSet.first(): Boolean = next() } } diff --git a/settings.gradle.kts b/settings.gradle.kts index 9823b41..bbbdb49 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -8,7 +8,7 @@ pluginManagement { } plugins { - id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0" + id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0" } dependencyResolutionManagement {