Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
1f35abac
Commit
1f35abac
authored
Mar 28, 2018
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish “Configure Kotlin compiler to use -java-parameters by default”
Closes gh-12641
parent
5e2726f8
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
8 deletions
+11
-8
production-ready-features.adoc
...oot-docs/src/main/asciidoc/production-ready-features.adoc
+6
-4
reacting.adoc
...spring-boot-gradle-plugin/src/main/asciidoc/reacting.adoc
+2
-1
KotlinPluginAction.java
...pringframework/boot/gradle/plugin/KotlinPluginAction.java
+2
-3
KotlinPluginActionIntegrationTests.java
...oot/gradle/plugin/KotlinPluginActionIntegrationTests.java
+1
-0
No files found.
spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc
View file @
1f35abac
...
@@ -532,10 +532,12 @@ JSON request body. When exposed via JMX, the parameters are mapped to the parame
...
@@ -532,10 +532,12 @@ JSON request body. When exposed via JMX, the parameters are mapped to the parame
the MBean's operations. Parameters are required by default. They can be made optional
the MBean's operations. Parameters are required by default. They can be made optional
by annotating them with `@org.springframework.lang.Nullable`.
by annotating them with `@org.springframework.lang.Nullable`.
NOTE: To allow the input to be mapped to the operation method's parameters, java code
NOTE: To allow the input to be mapped to the operation method's parameters, Java code
implementing an endpoint should be compiled with `-parameters`, and kotlin code should
implementing an endpoint should be compiled with `-parameters`, and Kotlin code
be compiled with `-java-parameters`. This will happen automatically if you are using
implementing an endpoint should be compiled with `-java-parameters`. This will happen
Spring Boot's Gradle plugin or if you are using Maven and `spring-boot-starter-parent`.
automatically if you are using Spring Boot's Gradle plugin or if you are using Maven and
`spring-boot-starter-parent`.
[[production-ready-endpoints-custom-input-conversion]]
[[production-ready-endpoints-custom-input-conversion]]
...
...
spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/asciidoc/reacting.adoc
View file @
1f35abac
...
@@ -24,7 +24,7 @@ plugin:
...
@@ -24,7 +24,7 @@ plugin:
the `bootJar` task.
the `bootJar` task.
6. Configures any `JavaCompile` tasks with no configured encoding to use `UTF-8`.
6. Configures any `JavaCompile` tasks with no configured encoding to use `UTF-8`.
7. Configures any `JavaCompile` tasks to use the `-parameters` compiler argument.
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]]
[[reacting-to-other-plugins-kotlin]]
...
@@ -36,6 +36,7 @@ plugin:
...
@@ -36,6 +36,7 @@ plugin:
1. Aligns the Kotlin version used in Spring Boot's dependency management with the version
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
of the plugin. This is achieved by setting the `kotlin.version` property with a value
that matches the version of the Kotlin plugin.
that matches the version of the Kotlin plugin.
2. Configures any `KotlinCompile` tasks to use the `-java-parameters` compiler argument.
...
...
spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/KotlinPluginAction.java
View file @
1f35abac
...
@@ -44,9 +44,8 @@ class KotlinPluginAction implements PluginApplicationAction {
...
@@ -44,9 +44,8 @@ class KotlinPluginAction implements PluginApplicationAction {
}
}
private
void
enableJavaParametersOption
(
Project
project
)
{
private
void
enableJavaParametersOption
(
Project
project
)
{
project
.
getTasks
().
withType
(
KotlinCompile
.
class
,
(
compile
)
->
{
project
.
getTasks
().
withType
(
KotlinCompile
.
class
,
compile
.
getKotlinOptions
().
setJavaParameters
(
true
);
(
compile
)
->
compile
.
getKotlinOptions
().
setJavaParameters
(
true
));
});
}
}
@Override
@Override
...
...
spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/plugin/KotlinPluginActionIntegrationTests.java
View file @
1f35abac
...
@@ -65,4 +65,5 @@ public class KotlinPluginActionIntegrationTests {
...
@@ -65,4 +65,5 @@ public class KotlinPluginActionIntegrationTests {
.
contains
(
"compileKotlin java parameters: false"
)
.
contains
(
"compileKotlin java parameters: false"
)
.
contains
(
"compileTestKotlin java parameters: false"
);
.
contains
(
"compileTestKotlin java parameters: false"
);
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment