Polish “Configure Kotlin compiler to use -java-parameters by default”
Closes gh-12641
This commit is contained in:
@@ -24,7 +24,7 @@ plugin:
|
||||
the `bootJar` task.
|
||||
6. Configures any `JavaCompile` tasks with no configured encoding to use `UTF-8`.
|
||||
7. Configures any `JavaCompile` tasks to use the `-parameters` compiler argument.
|
||||
8. Configures any `KotlinCompile` tasks to use the `-java-parameters` compiler argument.
|
||||
|
||||
|
||||
|
||||
[[reacting-to-other-plugins-kotlin]]
|
||||
@@ -36,6 +36,7 @@ plugin:
|
||||
1. Aligns the Kotlin version used in Spring Boot's dependency management with the version
|
||||
of the plugin. This is achieved by setting the `kotlin.version` property with a value
|
||||
that matches the version of the Kotlin plugin.
|
||||
2. Configures any `KotlinCompile` tasks to use the `-java-parameters` compiler argument.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -44,9 +44,8 @@ class KotlinPluginAction implements PluginApplicationAction {
|
||||
}
|
||||
|
||||
private void enableJavaParametersOption(Project project) {
|
||||
project.getTasks().withType(KotlinCompile.class, (compile) -> {
|
||||
compile.getKotlinOptions().setJavaParameters(true);
|
||||
});
|
||||
project.getTasks().withType(KotlinCompile.class,
|
||||
(compile) -> compile.getKotlinOptions().setJavaParameters(true));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -65,4 +65,5 @@ public class KotlinPluginActionIntegrationTests {
|
||||
.contains("compileKotlin java parameters: false")
|
||||
.contains("compileTestKotlin java parameters: false");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user