Skip to content

Commit d442071

Browse files
committed
Suppress Kotlin 1.5.20 deprecation warning
See gh-27086
1 parent 8f9652c commit d442071

File tree

1 file changed

+6
-1
lines changed
  • spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin

1 file changed

+6
-1
lines changed

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/KotlinPluginAction.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,17 @@ class KotlinPluginAction implements PluginApplicationAction {
3535
public void execute(Project project) {
3636
ExtraPropertiesExtension extraProperties = project.getExtensions().getExtraProperties();
3737
if (!extraProperties.has("kotlin.version")) {
38-
String kotlinVersion = project.getPlugins().getPlugin(KotlinPluginWrapper.class).getKotlinPluginVersion();
38+
String kotlinVersion = getKotlinVersion(project);
3939
extraProperties.set("kotlin.version", kotlinVersion);
4040
}
4141
enableJavaParametersOption(project);
4242
}
4343

44+
@SuppressWarnings("deprecation")
45+
private String getKotlinVersion(Project project) {
46+
return project.getPlugins().getPlugin(KotlinPluginWrapper.class).getKotlinPluginVersion();
47+
}
48+
4449
private void enableJavaParametersOption(Project project) {
4550
project.getTasks().withType(KotlinCompile.class,
4651
(compile) -> compile.getKotlinOptions().setJavaParameters(true));

0 commit comments

Comments
 (0)