From 19f647ab8ce1c17778ab5493b5e9ed2c6ecd1312 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deleuze?= Date: Mon, 13 Jan 2025 21:02:28 +0100 Subject: [PATCH] Set -Xjdk-release=17 for Kotlin build Needed due to https://youtrack.jetbrains.com/issue/KT-49746. See gh-34220 --- .../org/springframework/build/KotlinConventions.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/java/org/springframework/build/KotlinConventions.java b/buildSrc/src/main/java/org/springframework/build/KotlinConventions.java index 8e381a3b77..388c324ffc 100644 --- a/buildSrc/src/main/java/org/springframework/build/KotlinConventions.java +++ b/buildSrc/src/main/java/org/springframework/build/KotlinConventions.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2024 the original author or authors. + * Copyright 2002-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,12 @@ public class KotlinConventions { options.getJvmTarget().set(JvmTarget.JVM_17); options.getJavaParameters().set(true); options.getAllWarningsAsErrors().set(true); - options.getFreeCompilerArgs().addAll("-Xsuppress-version-warnings", "-Xjsr305=strict", "-opt-in=kotlin.RequiresOptIn"); + options.getFreeCompilerArgs().addAll( + "-Xsuppress-version-warnings", + "-Xjsr305=strict", // For dependencies using JSR 305 + "-opt-in=kotlin.RequiresOptIn", + "-Xjdk-release=17" // Needed due to https://youtrack.jetbrains.com/issue/KT-49746 + ); }); }