diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 713e187..43813b9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,7 @@ jobs: - uses: actions/setup-java@v3 with: distribution: 'zulu' - java-version: '17' + java-version: '21' - uses: gradle/gradle-build-action@v2 with: gradle-home-cache-cleanup: true diff --git a/build.gradle.kts b/build.gradle.kts index bd70da9..4fb0f89 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,3 @@ -@file:Suppress("UnstableApiUsage", "DSL_SCOPE_VIOLATION") - import com.google.cloud.tools.jib.gradle.BuildImageTask import com.netflix.graphql.dgs.codegen.gradle.GenerateJavaTask import io.gitlab.arturbosch.detekt.Detekt @@ -57,22 +55,22 @@ dependencies { configurations.all { resolutionStrategy.eachDependency { - if (requested.group == "org.jetbrains.kotlinx" && requested.name.startsWith("kotlinx-coroutines")) { - useVersion(libs.versions.kotlinx.coroutines.get()) + if (this@all.name == "detekt" && requested.group == "org.jetbrains.kotlin") { + useVersion("1.9.0") } } } kotlin { jvmToolchain { - languageVersion.set(JavaLanguageVersion.of(17)) + languageVersion.set(JavaLanguageVersion.of(20)) } } allprojects { detekt { - source = files("src/") - config = files("${project.rootDir}/detekt.yml") + source.setFrom(files("src/")) + config.setFrom(files("${project.rootDir}/detekt.yml")) buildUponDefaultConfig = true allRules = true } @@ -84,7 +82,6 @@ allprojects { dependencies.add("detektPlugins", libs.detektFormatting) } - tasks.withType().configureEach { compilerOptions { languageVersion.set(KotlinVersion.KOTLIN_2_0) diff --git a/cloudbuild.yaml b/cloudbuild.yaml index 207ec52..130b9d9 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -1,7 +1,7 @@ steps: # build and push the container image -- name: gradle:jdk17-alpine +- name: gradle:jdk21-alpine entrypoint: gradle args: [ 'jib', '--image=${_CONTAINER_IMAGE}:$SHORT_SHA', '--no-configuration-cache' ] diff --git a/gradle.properties b/gradle.properties index ecbf122..6aa3e6d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,3 +7,4 @@ org.gradle.configuration-cache-problems=warn # Kotlin code style kotlin.code.style=official +kotlin.experimental.tryK2=true diff --git a/src/main/kotlin/io/github/reactivecircus/kstreamlined/backend/client/FeedClient.kt b/src/main/kotlin/io/github/reactivecircus/kstreamlined/backend/client/FeedClient.kt index 7092a6d..4d9fbd6 100644 --- a/src/main/kotlin/io/github/reactivecircus/kstreamlined/backend/client/FeedClient.kt +++ b/src/main/kotlin/io/github/reactivecircus/kstreamlined/backend/client/FeedClient.kt @@ -21,6 +21,7 @@ import io.ktor.serialization.kotlinx.xml.xml import kotlinx.serialization.decodeFromString import nl.adaptivity.xmlutil.ExperimentalXmlUtilApi import nl.adaptivity.xmlutil.serialization.DefaultXmlSerializationPolicy +import nl.adaptivity.xmlutil.serialization.XmlConfig import org.apache.commons.text.StringEscapeUtils interface FeedClient { @@ -54,7 +55,7 @@ class RealFeedClient( val format = DefaultXml.copy { policy = DefaultXmlSerializationPolicy( pedantic = false, - unknownChildHandler = { _, _, _, _, _ -> emptyList() } + unknownChildHandler = XmlConfig.IGNORING_UNKNOWN_CHILD_HANDLER ) }