diff --git a/build.gradle.kts b/build.gradle.kts index 75ca30bc..c76e253e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,6 +3,8 @@ import com.adarshr.gradle.testlogger.theme.ThemeType.MOCHA_PARALLEL import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask import io.codearte.gradle.nexus.NexusStagingExtension import org.gradle.api.JavaVersion.VERSION_17 +import org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17 +import org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import org.jmailen.gradle.kotlinter.KotlinterExtension import kotlin.text.RegexOption.IGNORE_CASE @@ -10,11 +12,11 @@ import kotlin.text.RegexOption.IGNORE_CASE plugins { kotlin("jvm") apply false id("io.codearte.nexus-staging") version "0.30.0" - id("org.jmailen.kotlinter") version "4.4.0" apply false + id("org.jmailen.kotlinter") version "4.4.1" apply false id("com.adarshr.test-logger") version "4.0.0" apply false id("com.github.ben-manes.versions") version "0.51.0" id("org.jetbrains.dokka") - id("org.jetbrains.kotlinx.kover") version "0.8.1" + id("org.jetbrains.kotlinx.kover") version "0.8.3" } repositories { @@ -53,9 +55,9 @@ subprojects { } tasks.withType { - kotlinOptions { - jvmTarget = VERSION_17.toString() - languageVersion = "1.9" + compilerOptions { + jvmTarget.set(JVM_17) + languageVersion.set(KOTLIN_2_0) javaParameters = true freeCompilerArgs = listOf("-Xjvm-default=all") allWarningsAsErrors = true diff --git a/gradle.properties b/gradle.properties index 8716819b..a2e0dcf4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,12 +5,12 @@ org.gradle.jvmargs=-XX:MaxMetaspaceSize=1024m versions.arrow=1.2.4 versions.failgood=0.9.1 versions.filepeek=0.1.3 -versions.jackson=2.17.1 -versions.junit=5.10.2 -versions.kotlin=1.9.20 +versions.jackson=2.17.2 +versions.junit=5.10.3 +versions.kotlin=2.0.10 versions.kotlinx-coroutines=1.8.1 versions.minutest=1.13.0 -versions.mockk=1.13.11 -versions.protobuf=4.27.1 +versions.mockk=1.13.12 +versions.protobuf=4.27.3 versions.opentest4j=1.3.0 -versions.spring-boot=3.3.1 +versions.spring-boot=3.3.2 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7f93135c..e6441136 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 a4413138..09523c0e 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.8-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 1aa94a42..b740cf13 100755 --- a/gradlew +++ b/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/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/. diff --git a/gradlew.bat b/gradlew.bat index 93e3f59f..25da30db 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 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 @@ -57,11 +57,11 @@ 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 diff --git a/strikt-core/src/test/kotlin/strikt/Chained.kt b/strikt-core/src/test/kotlin/strikt/Chained.kt index d4b5441a..e2732cbe 100644 --- a/strikt-core/src/test/kotlin/strikt/Chained.kt +++ b/strikt-core/src/test/kotlin/strikt/Chained.kt @@ -75,6 +75,7 @@ internal class Chained { .isEqualTo(expected) } + @Suppress("RedundantNullableReturnType") @Test fun `can connect a block to a chain with and`() { val error = diff --git a/strikt-core/src/test/kotlin/strikt/docs/Homepage.kt b/strikt-core/src/test/kotlin/strikt/docs/Homepage.kt index cd24cb28..7af1bcf9 100644 --- a/strikt-core/src/test/kotlin/strikt/docs/Homepage.kt +++ b/strikt-core/src/test/kotlin/strikt/docs/Homepage.kt @@ -56,7 +56,7 @@ internal class Homepage { @Test fun `homepage four`() { // START homepage_four - val subject = Deity.values().map { it.toString() } + val subject = Deity.entries.map { it.toString() } expectThat(subject) .isNotEmpty() .any { startsWith("E") } @@ -104,7 +104,7 @@ internal class Homepage { // END homepage_seven } - @Suppress("ktlint:standard:no-multi-spaces") + @Suppress("ktlint:standard:no-multi-spaces", "RedundantNullableReturnType") @Test fun `homepage eight`() { // START homepage_eight diff --git a/strikt-protobuf/strikt-protobuf.gradle.kts b/strikt-protobuf/strikt-protobuf.gradle.kts index bd9f31b1..5f681c73 100644 --- a/strikt-protobuf/strikt-protobuf.gradle.kts +++ b/strikt-protobuf/strikt-protobuf.gradle.kts @@ -1,7 +1,6 @@ @file:Suppress("KDocMissingDocumentation") import org.jetbrains.dokka.gradle.DokkaTaskPartial -import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet import java.net.URL plugins { @@ -41,18 +40,11 @@ protobuf { } } -// This seems to be necessary just to get IntelliJ to notice the proto sources. -// It works fine from the terminal without this. Also IntelliJ picks up main -// protos just fine. - -val SourceSet.kotlin - get() = withConvention(KotlinSourceSet::class) { kotlin } - sourceSets { getByName("test") { kotlin.srcDirs( "src/test/kotlin", - "$buildDir/generated/source/proto/test/java" + "$buildFile/generated/source/proto/test/java" ) } }