Skip to content

Commit

Permalink
Kotlin 2.0 + various other upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
robfletcher committed Aug 8, 2024
1 parent 98ed21b commit 6a76b28
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 34 deletions.
12 changes: 7 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@ 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

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 {
Expand Down Expand Up @@ -53,9 +55,9 @@ subprojects {
}

tasks.withType<KotlinCompile> {
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
Expand Down
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -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/.
Expand Down
20 changes: 10 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
1 change: 1 addition & 0 deletions strikt-core/src/test/kotlin/strikt/Chained.kt
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ internal class Chained {
.isEqualTo(expected)
}

@Suppress("RedundantNullableReturnType")
@Test
fun `can connect a block to a chain with and`() {
val error =
Expand Down
4 changes: 2 additions & 2 deletions strikt-core/src/test/kotlin/strikt/docs/Homepage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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") }
Expand Down Expand Up @@ -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
Expand Down
10 changes: 1 addition & 9 deletions strikt-protobuf/strikt-protobuf.gradle.kts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -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"
)
}
}

0 comments on commit 6a76b28

Please sign in to comment.