60 Commits

Author SHA1 Message Date
Yanming Zhou
ac18e3015c Use .isEmpty() where feasible
See gh-38739
2023-12-19 22:38:05 -08:00
Andy Wilkinson
931584f8af Merge branch '2.7.x' into 3.0.x
Closes gh-37659
2023-10-03 10:28:51 +01:00
Phillip Webb
c4de86c244 Merge branch '2.7.x' into 3.0.x 2023-02-21 23:17:57 -08:00
Phillip Webb
df5898a146 Reformat code following spring-javaformat upgrade 2023-02-21 22:53:27 -08:00
Andy Wilkinson
99edda735e Polish 2022-10-25 12:57:58 +01:00
Scott Frederick
d25a99692f Replace Spring Boot TestCompiler with Spring Framework's version
See gh-31266
2022-09-30 15:58:11 -05:00
Scott Frederick
f9c341c75a Revert "Generate the AutoConfiguration.imports file from annotations"
This reverts commit da4de7d67d442771704fba268f33fbc90aaaf1aa.
2022-09-21 14:50:15 -05:00
Scott Frederick
d62d7ca75d Revert "Generate ManagementContextConfiguration.imports file from annotations"
This reverts commit 6b3b0dd3a6ac4818388e97e121de69a91e21657d.
2022-09-21 14:50:15 -05:00
Scott Frederick
1f53eb7df9 Revert "Sort the contents of generated imports files"
This reverts commit 95e62b7ff822d0179850b3eb9baf6f0e0d89eb2e.
2022-09-21 14:50:15 -05:00
Scott Frederick
910e9c9fcc Revert "Fix windows build"
This reverts commit 9fe24fe6929099243ab8aecceeed88ed48b24860.
2022-09-21 14:50:15 -05:00
Stephane Nicoll
9fe24fe692 Fix windows build
This commit makes sure that files that are generated in a temporary
directory are closed once the related test completes.
2022-09-10 16:24:29 +02:00
Scott Frederick
95e62b7ff8 Sort the contents of generated imports files
The list of class names generated by annotation processors should be
sorted before being written to `AutoConfiguration.imports` and
`ManagementContextConfiguration.imports` files to make the build more
deterministic.

See gh-31228
2022-09-02 17:26:15 -05:00
Scott Frederick
6b3b0dd3a6 Generate ManagementContextConfiguration.imports file from annotations
This commit adds the
`ManagementContextConfigurationImportsAnnotationProcessor` to
the `spring-boot-autoconfigure-processor` annotation processor
module.

Closes gh-32222
2022-09-02 16:27:59 -05:00
Scott Frederick
da4de7d67d Generate the AutoConfiguration.imports file from annotations
This commit adds the `AutoConfigurationImportsAnnotationProcessor` to
the `spring-boot-autoconfigure-processor` annotation processor
module. When added to a project build, the annotation processor will
generate the
`org.springframework.boot.autoconfigure.AutoConfiguration.imports`
file automatically from `@AutoConfiguration`-annotated classes. It
also applies the annotation processor to the Spring Boot build.

Closes gh-31228
2022-09-02 15:10:22 -05:00
dreis2211
5db04da275 Use pattern matching for instanceof where appropriate
See gh-31475
2022-06-20 17:55:36 +01:00
Phillip Webb
9f00c3acf5 Polish 2022-02-23 21:44:43 -08:00
Moritz Halbritter
fd36215d72 Omit empty values for AutoConfigureAfter and AutoConfigureBefore
As @AutoConfiguration is now meta-annotated with @AutoConfigureAfter
and @AutoConfigureBefore, the generated property files have a lot of
superfluous lines in the format <class>.AutoConfigureAfter= and
<class>.AutoConfigureBefore=.

One can now configure in the annotation processor for each property key
if empty values should be omitted. This is currently only activated for
AutoConfigureAfter and AutoConfigureBefore

See gh-29907
2022-02-23 15:39:46 +01:00
Moritz Halbritter
7872f61bfc Add @AutoConfiguration annotation support to the autoconfigure-processor
See gh-29907
2022-02-23 15:39:46 +01:00
Andy Wilkinson
62aa8ce107 Support incremental annotation processing with Gradle
Closes gh-22150
2020-06-30 11:27:32 +01:00
Phillip Webb
038ae93406 Update copyright year of changed files 2020-05-13 16:48:51 -07:00
Stephane Nicoll
6921fdacac Expand configuration class eager filtering to imports
Previously, only root auto-configuration classes could be excluded
eagerly via an AutoConfigurationImportFilter. Any configuration class
loaded as a result of processing a particular auto-configuration were
parsed and checked as usual.

This commit makes use of the `getExclusionFilter` callback to expand
this filter to all candidates that are considered. The annotation
processor has also be expanded to generate metadata for non-root
configuration classes.

Closes gh-12157
2020-04-29 10:45:28 +02:00
Phillip Webb
1b1c61a2ed Make processor output fully reproducible
Update `AutoConfigureAnnotationProcessor` to ensure that the generated
properties file is fully repeatable. Properties are now sorted and
written out directly to ensure that the timestamp comment is not
present.

Closes gh-19370
2019-12-13 13:04:49 -08:00
Phillip Webb
61873fbf42 Don't generate @Configuration metadata
Update `AutoConfigureAnnotationProcessor` to no longer store
`@Configuration.value` in the meta-data JSON since we never actually
read it.

Closes gh-16608
2019-10-02 21:41:31 -07:00
thelproad
9c1f503e46 Simplify if statements
See gh-17884
2019-08-17 06:50:32 +02:00
Phillip Webb
8bc780762a Merge branch '2.1.x' 2019-07-24 11:42:48 +01:00
Phillip Webb
fb1dd8fe93 Merge branch '2.0.x' into 2.1.x 2019-07-24 11:41:32 +01:00
Phillip Webb
913e831f4e Merge '1.5.x' into 2.0.x 2019-07-24 11:39:58 +01:00
Phillip Webb
01933f9b06 Merge previously split strings
Merge some string lines that were previously split because of the
90 chars wide formatting.
2019-07-15 00:24:19 +01:00
Phillip Webb
a66c4d3096 Unify method visibility of private classes
Apply checkstyle rule to ensure that private and package private
classes do not have unnecessary public methods. Test classes have
also been unified as much as possible to use default scoped
inner-classes.

Closes gh-7316
2019-07-03 11:39:47 -07:00
Phillip Webb
605599138e Merge branch '2.1.x' 2019-06-28 23:56:02 -07:00
Phillip Webb
92bff3c328 Merge branch '2.0.x' into 2.1.x 2019-06-28 23:42:28 -07:00
Phillip Webb
cfeb0239b7 Merge branch '1.5.x' into 2.0.x 2019-06-28 23:28:34 -07:00
Stephane Nicoll
e560b7f6ba Remove public modifier on JUnit5 lifecycle methods
See gh-17292
2019-06-21 18:09:05 +02:00
Andy Wilkinson
b18fffaf14 Move tests to JUnit 5 wherever possible 2019-06-07 12:25:54 +01:00
Andy Wilkinson
aef92b9295 Merge branch '2.1.x'
Closes gh-17079
2019-06-07 11:00:44 +01:00
Andy Wilkinson
24925c3dae Merge branch '2.0.x' into 2.1.x
Closes gh-17078
2019-06-07 10:50:34 +01:00
Andy Wilkinson
c6c139d980 Merge branch '1.5.x' into 2.0.x 2019-06-07 10:46:31 +01:00
Phillip Webb
2376f973f4 Merge branch '2.1.x' 2019-04-02 13:46:36 -07:00
Phillip Webb
47c6bf741d Merge branch '2.0.x' into 2.1.x 2019-04-02 13:40:21 -07:00
Phillip Webb
07c000c5b7 Merge branch '1.5.x' into 2.0.x 2019-04-02 13:34:28 -07:00
Andy Wilkinson
36c1c051b8 Merge branch '2.1.x' 2019-03-20 16:55:10 +00:00
Andy Wilkinson
e23f72c8b0 Merge branch '2.0.x' into 2.1.x 2019-03-20 16:53:48 +00:00
Andy Wilkinson
9fbd38ab3c Merge branch '1.5.x' into 2.0.x 2019-03-20 16:45:26 +00:00
igor-suhorukov
3eb2f5e476 Replace Collections sort with list sort() method
Closes gh-15585
2018-12-30 09:52:05 +01:00
Johnny Lim
fd5aa3ebf1 Polish
See gh-15134
2018-11-11 11:03:13 +01:00
Phillip Webb
85f86243c9 Order class filter checks and exit early
Update the logic in `OnClassCondition` so that filtering exits on the
first missing class. Also refactor the implementation to save
unnecessary `Set` creation when there is just a single class to check.

The `AutoConfigureAnnotationProcessor` has also been updated to order
classes so that any starting `org.springframework` are considered last.
The assumption being that other classes are more likely to be missing.

Closes gh-12131
2018-10-10 22:02:05 -07:00
Johnny Lim
698bbd6a9e Polish
Closes gh-14597
2018-09-26 11:45:21 -04:00
Phillip Webb
75bde00334 Generate auto-configuration OnWebApplication data
Update the auto-configuration annotation processor to generate
properties for `@OnWebApplication`.

See gh-13328
2018-09-24 09:46:26 -04:00
Phillip Webb
586507c49a Generate auto-configuration OnBean data
Update the auto-configuration annotation processor to generate
properties for `@ConditionalOnBean` and `@ConditionalOnSingleCandidate`.

See gh-13328
2018-09-24 09:45:46 -04:00
Phillip Webb
7fc455654a Fix checkstyle ternary issues
Fix checkstyle issues with ternary expressions following the
spring-javaformat upgrade.

See gh-13932
2018-07-28 01:11:52 +01:00