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
dcb42c36
Commit
dcb42c36
authored
Oct 28, 2020
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure that additional metadata is available to annotation processor
Fixes gh-23934
parent
4f925744
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
ConfigurationPropertiesPlugin.java
...ild/context/properties/ConfigurationPropertiesPlugin.java
+6
-1
No files found.
buildSrc/src/main/java/org/springframework/boot/build/context/properties/ConfigurationPropertiesPlugin.java
View file @
dcb42c36
...
@@ -23,6 +23,7 @@ import java.util.stream.Collectors;
...
@@ -23,6 +23,7 @@ import java.util.stream.Collectors;
import
org.gradle.api.Plugin
;
import
org.gradle.api.Plugin
;
import
org.gradle.api.Project
;
import
org.gradle.api.Project
;
import
org.gradle.api.Task
;
import
org.gradle.api.artifacts.Configuration
;
import
org.gradle.api.artifacts.Configuration
;
import
org.gradle.api.plugins.JavaPlugin
;
import
org.gradle.api.plugins.JavaPlugin
;
import
org.gradle.api.plugins.JavaPluginConvention
;
import
org.gradle.api.plugins.JavaPluginConvention
;
...
@@ -37,7 +38,10 @@ import org.springframework.util.StringUtils;
...
@@ -37,7 +38,10 @@ import org.springframework.util.StringUtils;
*
*
* <ul>
* <ul>
* <li>Adding a dependency on the configuration properties annotation processor.
* <li>Adding a dependency on the configuration properties annotation processor.
* <li>Configure the additional metadata locations annotation processor compiler argument
* <li>Configuring the additional metadata locations annotation processor compiler
* argument.
* <li>Adding the outputs of the processResources task as inputs of the compileJava task
* to ensure that the additional metadata is available when the annotation processor runs.
* <li>Defining an artifact for the resulting configuration property metadata so that it
* <li>Defining an artifact for the resulting configuration property metadata so that it
* can be consumed by downstream projects.
* can be consumed by downstream projects.
* </ul>
* </ul>
...
@@ -83,6 +87,7 @@ public class ConfigurationPropertiesPlugin implements Plugin<Project> {
...
@@ -83,6 +87,7 @@ public class ConfigurationPropertiesPlugin implements Plugin<Project> {
private
void
configureAdditionalMetadataLocationsCompilerArgument
(
Project
project
)
{
private
void
configureAdditionalMetadataLocationsCompilerArgument
(
Project
project
)
{
JavaCompile
compileJava
=
project
.
getTasks
().
withType
(
JavaCompile
.
class
)
JavaCompile
compileJava
=
project
.
getTasks
().
withType
(
JavaCompile
.
class
)
.
getByName
(
JavaPlugin
.
COMPILE_JAVA_TASK_NAME
);
.
getByName
(
JavaPlugin
.
COMPILE_JAVA_TASK_NAME
);
((
Task
)
compileJava
).
getInputs
().
files
(
project
.
getTasks
().
getByName
(
JavaPlugin
.
PROCESS_RESOURCES_TASK_NAME
));
SourceSet
mainSourceSet
=
project
.
getConvention
().
getPlugin
(
JavaPluginConvention
.
class
).
getSourceSets
()
SourceSet
mainSourceSet
=
project
.
getConvention
().
getPlugin
(
JavaPluginConvention
.
class
).
getSourceSets
()
.
getByName
(
SourceSet
.
MAIN_SOURCE_SET_NAME
);
.
getByName
(
SourceSet
.
MAIN_SOURCE_SET_NAME
);
compileJava
.
getOptions
().
getCompilerArgs
()
compileJava
.
getOptions
().
getCompilerArgs
()
...
...
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