Skip to content

Commit 68797b5

Browse files
committed
Update to Kotlin 2.2
1 parent 8fd2401 commit 68797b5

File tree

6 files changed

+16
-23
lines changed

6 files changed

+16
-23
lines changed

buildSrc/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ dependencies {
7676
implementation libs.com.github.spullara.mustache.java.compiler
7777
implementation libs.io.spring.javaformat.spring.javaformat.gradle.plugin
7878
implementation libs.io.spring.nohttp.nohttp.gradle
79+
implementation libs.org.jetbrains.kotlin.kotlin.gradle.plugin
7980
implementation (libs.net.sourceforge.htmlunit) {
8081
exclude group: 'org.eclipse.jetty.websocket', module: 'websocket-client'
8182
}

buildSrc/src/main/groovy/io/spring/gradle/convention/SpringModulePlugin.groovy

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package io.spring.gradle.convention;
1919
import org.gradle.api.Project
2020
import org.gradle.api.plugins.JavaLibraryPlugin;
2121
import org.gradle.api.plugins.PluginManager
22+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2223
import org.springframework.gradle.classpath.CheckClasspathForProhibitedDependenciesPlugin;
2324
import org.springframework.gradle.maven.SpringMavenPlugin;
2425

@@ -41,6 +42,17 @@ class SpringModulePlugin extends AbstractSpringJavaPlugin {
4142
if (!Utils.isRelease(project)) {
4243
deployArtifacts.dependsOn project.tasks.artifactoryPublish
4344
}
45+
project.plugins.withId("org.jetbrains.kotlin.jvm", (kotlinProject) -> {
46+
project.tasks.withType(KotlinCompile).configureEach {
47+
kotlinOptions {
48+
languageVersion = '2.2'
49+
apiVersion = '2.2'
50+
freeCompilerArgs = ["-Xjsr305=strict", "-Xsuppress-version-warnings"]
51+
jvmTarget = '17'
52+
53+
}
54+
}
55+
})
4456
}
4557

4658
}

config/spring-security-config.gradle

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,6 @@ tasks.named('sourcesJar', Jar).configure {
153153
}
154154
}
155155

156-
tasks.withType(KotlinCompile).configureEach {
157-
kotlinOptions {
158-
languageVersion = "1.7"
159-
apiVersion = "1.7"
160-
freeCompilerArgs = ["-Xjsr305=strict", "-Xsuppress-version-warnings"]
161-
jvmTarget = "17"
162-
}
163-
}
164-
165156
configure(project.tasks.withType(Test)) {
166157
doFirst {
167158
systemProperties['springSecurityVersion'] = version

config/src/test/kotlin/org/springframework/security/config/web/server/ServerX509DslTests.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ class ServerX509DslTests {
205205
@Nullable httpHandlerBuilder: WebHttpHandlerBuilder?,
206206
@Nullable connector: ClientHttpConnector?) {
207207
val filter = SetSslInfoWebFilter(certificate)
208-
httpHandlerBuilder!!.filters { filters: MutableList<WebFilter?> -> filters.add(0, filter) }
208+
httpHandlerBuilder!!.filters { filters: MutableList<WebFilter> -> filters.add(0, filter) }
209209
}
210210
}
211211

core/spring-security-core.gradle

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2-
31
import java.util.concurrent.Callable
42

53
apply plugin: 'io.spring.convention.spring-module'
@@ -66,12 +64,3 @@ Callable<String> springVersion() {
6664
return (Callable<String>) { project.configurations.compileClasspath.resolvedConfiguration.resolvedArtifacts
6765
.find { it.name == 'spring-core' }.moduleVersion.id.version }
6866
}
69-
70-
tasks.withType(KotlinCompile).configureEach {
71-
kotlinOptions {
72-
languageVersion = "1.7"
73-
apiVersion = "1.7"
74-
freeCompilerArgs = ["-Xjsr305=strict", "-Xsuppress-version-warnings"]
75-
jvmTarget = "17"
76-
}
77-
}

gradle/libs.versions.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ org-apache-maven-resolver = "1.9.23"
88
org-aspectj = "1.9.24"
99
org-bouncycastle = "1.80"
1010
org-eclipse-jetty = "11.0.25"
11-
org-jetbrains-kotlin = "1.9.25"
11+
org-jetbrains-kotlin = "2.2.0"
1212
org-jetbrains-kotlinx = "1.10.2"
1313
org-mockito = "5.17.0"
1414
org-opensaml = "4.3.2"
@@ -67,7 +67,7 @@ org-hamcrest = "org.hamcrest:hamcrest:2.2"
6767
org-hibernate-orm-hibernate-core = "org.hibernate.orm:hibernate-core:7.0.1.Final"
6868
org-hsqldb = "org.hsqldb:hsqldb:2.7.4"
6969
org-jetbrains-kotlin-kotlin-bom = { module = "org.jetbrains.kotlin:kotlin-bom", version.ref = "org-jetbrains-kotlin" }
70-
org-jetbrains-kotlin-kotlin-gradle-plugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.25"
70+
org-jetbrains-kotlin-kotlin-gradle-plugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:2.2.0"
7171
org-jetbrains-kotlinx-kotlinx-coroutines-bom = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-bom", version.ref = "org-jetbrains-kotlinx" }
7272
org-junit-junit-bom = "org.junit:junit-bom:5.12.2"
7373
org-mockito-mockito-bom = { module = "org.mockito:mockito-bom", version.ref = "org-mockito" }

0 commit comments

Comments
 (0)