Skip to content

Commit

Permalink
Java 21, K2.
Browse files Browse the repository at this point in the history
  • Loading branch information
ychescale9 committed Oct 28, 2023
1 parent e556429 commit 8f140d3
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 5 additions & 8 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
}
Expand All @@ -84,7 +82,6 @@ allprojects {
dependencies.add("detektPlugins", libs.detektFormatting)
}


tasks.withType<KotlinCompile>().configureEach {
compilerOptions {
languageVersion.set(KotlinVersion.KOTLIN_2_0)
Expand Down
2 changes: 1 addition & 1 deletion cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -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' ]

Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ org.gradle.configuration-cache-problems=warn

# Kotlin code style
kotlin.code.style=official
kotlin.experimental.tryK2=true
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -54,7 +55,7 @@ class RealFeedClient(
val format = DefaultXml.copy {
policy = DefaultXmlSerializationPolicy(
pedantic = false,
unknownChildHandler = { _, _, _, _, _ -> emptyList() }
unknownChildHandler = XmlConfig.IGNORING_UNKNOWN_CHILD_HANDLER
)
}

Expand Down

0 comments on commit 8f140d3

Please sign in to comment.