Commit Graph

210 Commits

Author SHA1 Message Date
Phillip Webb 47b00c086c Polish 2017-02-27 13:56:17 -08:00
Spring Buildmaster 5c12500366 Next Development Version 2017-01-30 20:10:13 +00:00
Andy Wilkinson 20c1370107 Correct the scope of the spring-boot-test-support dependency
Closes gh-8136
2017-01-30 13:15:49 +00:00
Spring Buildmaster a2696bf873 Next Development Version 2017-01-30 11:40:24 +00:00
Spring Buildmaster ed1ce140c0 Next Development Version 2017-01-26 14:20:39 +00:00
Madhura Bhave ca435512c0 Introduce spring-boot-autoconfigure-processor
Add an annotation processor that generates properties files for certain
auto-configuration class annotations. Currently attribute values from
@AutoConfigureOrder, @AutoConfigureBefore, @AutoConfigureAfter and
@ConditionalOnClass annotations are stored.

The properties file will allow optimizations to be added in the
`spring-boot-autoconfigure` project. Primarily by removing the need
to ASM parse as many `.class` files.

See gh-7573
2017-01-23 22:14:56 -08:00
Phillip Webb 6bc37c0589 Drop annotation processor spring-core dependency
Remove the spring-core dependency from the annotation processor.
(cherry-picked from 4cb7d86aec)

Fixes gh-7882
2017-01-05 10:44:48 -08:00
Stephane Nicoll c06ff7061f Revert Shade annotation processor dependencies
This commit reverts 45d5b60

See gh-7883
2017-01-05 17:04:34 +01:00
Phillip Webb 45d5b60f6d Shade annotation processor dependencies
Update the annotation processor to be completely self contained. The
single required dependency is now "shaded" into the jar.

Fixes gh-7883
2017-01-04 23:02:24 -08:00
Phillip Webb cc7c2ebb87 Migrate to android-json
Migrate from `org.json:json` to the clean room Apache 2.0 licensed
version that was developed for Android.

Fixes gh-5929
2017-01-04 23:00:06 -08:00
Phillip Webb 4cb7d86aec Drop annotation processor spring-core dependency
Remove the spring-core dependency from the annotation processor.

Fixes gh-7882
2017-01-04 22:58:28 -08:00
Phillip Webb aacf5d660f Update copyright year for changed files 2016-12-30 11:53:51 -08:00
Spring Buildmaster 9057f9ae1f Next development version 2016-12-23 00:15:23 +00:00
Phillip Webb 6121208cbb Polish formatting 2016-12-19 12:47:03 -08:00
Phillip Webb 4b9cba351b Merge branch '1.4.x' into 1.5.x 2016-12-19 12:36:57 -08:00
Phillip Webb bd74c3d327 Polish formatting 2016-12-19 12:25:09 -08:00
Stephane Nicoll f84fd19eaa Polish contribution
Closes gh-7491
2016-11-29 15:20:53 +01:00
Hrishikesh Joshi b3220985bb Detect default values defined in the parent
Closes gh-5434
2016-11-29 15:20:10 +01:00
Andy Wilkinson 22e456a177 Merge branch '1.4.x' into 1.5.x 2016-11-15 13:14:30 +00:00
Andy Wilkinson c2730ac63f Polish formatting and address warnings 2016-11-15 11:48:35 +00:00
Spring Buildmaster e712a9ba8c Next Development Version 2016-11-08 16:55:37 +00:00
Phillip Webb 5b66ffbb4b Merge branch '1.4.x' into 1.5.x 2016-10-31 23:09:36 -07:00
Phillip Webb 57d5a2ebc6 Formatting 2016-10-31 11:41:45 -07:00
Stephane Nicoll f6959ccbcd Merge branch '1.4.x' into 1.5.x 2016-10-28 13:31:38 +02:00
Stephane Nicoll 7f8849c62b Merge branch '1.3.x' into 1.4.x 2016-10-28 13:31:19 +02:00
Stephane Nicoll 5863e6f78c Fix class name in generated meta-data
Previously, the algorithm that computes the String representation of a
class reference and a property type was shared. This lead to generic
information for group's `type` and `sourceType` property.

This commit separates that logic in two: `getQualifiedName` is now
responsible to generate a fully qualified class name while the existing
`getType` is solely responsible to generate a type representation for the
property. Only the latter has generic information.

Closes gh-7236
2016-10-28 13:23:47 +02:00
Phillip Webb d818a09ed8 Polish 2016-10-11 23:38:14 -07:00
Stephane Nicoll c06dc33bf6 Generate deprecated meta-data for deprecated @Bean methods
This commit makes sure that a meta-data group exposed via a deprecated
`@Bean` method is deprecated as well. This also works if the class
in which the bean method is defined is itself deprecated.

Closes gh-7100
2016-10-06 17:08:49 +02:00
Phillip Webb a2315378d4 Formatting 2016-10-03 22:44:36 -07:00
Stephane Nicoll 6bd670edbc Initiate 1.4.x branch 2016-09-21 11:11:24 +02:00
Spring Buildmaster 7e9ed5e1a7 Next Development Version 2016-09-21 07:58:07 +00:00
Spring Buildmaster 5f959b074f Next Development Version 2016-09-20 20:20:06 +00:00
Spring Buildmaster 334baaeffd Next development version 2016-07-28 19:54:01 +00:00
Spring Buildmaster a89ef5df6e Next Development Version 2016-07-28 09:18:40 +00:00
Spring Buildmaster 2216369348 Next Development Version 2016-07-04 14:15:02 +00:00
Phillip Webb 266445aaf0 Polish 2016-06-29 10:44:33 -07:00
Stephane Nicoll e9fb51bdd7 Fix test 2016-06-27 12:08:48 +02:00
Stephane Nicoll 6631136f91 Merge branch '1.3.x' 2016-06-27 12:08:04 +02:00
Stephane Nicoll 17f8a244de Fix property names with successive capital letters
Previously, if a property name had successive capital letters, the
generated meta-data would clean it in such a way it is defined as a
regular word. For instance a `myFOO` property would be written as
`my-foo` in the meta-data.

It turns out this decision is wrong as the binder has no way to compute
back the name of the property and therefore `my-foo` wouldn't bind to
`setMyFOO` as it should.

This commit updates the meta-data name generation algorithm to properly
identify such cases: `myFOO` now translates to `my-f-o-o`. While the
generated name is a bit ugly, it now provides a consistent binding
experience.

Closes gh-5330
2016-06-27 12:02:34 +02:00
Phillip Webb 7446235ff4 Polish 2016-06-20 20:13:13 -07:00
Stephane Nicoll 5407cf5f7a Prevent several registration of the same config pojo
This commit detects case where the same set of keys are exposed several
times and prevents the compilation to complete. Previously, duplicate
keys were silently added to the meta-data.

Closes gh-5939
2016-06-20 09:19:02 +02:00
Phillip Webb e27bc9ddea Merge branch '1.3.x' 2016-06-10 17:24:02 -07:00
Phillip Webb f27bdcb737 Prevent APT crashes on older Java versions
Update TypeUtils to guard against the use of older Java versions.
Both `Collection` and `Map` type lookups now fallback to generic free
versions of the classes.

Prior to this commit using `xmlbeans-maven-plugin` in combination with
Spring Boot's annotation processor could result in
`IllegalArgumentException: Incorrect number of type arguments`.

Fixes gh-6122
2016-06-10 17:06:45 -07:00
Phillip Webb 6575ca6ff8 Merge branch 1.3.x 2016-05-10 09:35:49 -07:00
Phillip Webb 7fb545d26c Polish 2016-05-10 09:35:10 -07:00
Spring Buildmaster 819a9574a6 Next Development Version 2016-05-10 05:28:34 +00:00
Spring Buildmaster 376bbe68d8 Next Development Version 2016-05-06 11:23:57 +00:00
Stephane Nicoll 6fe9177f0d Merge branch '1.3.x' 2016-05-02 10:40:27 +02:00
Stephane Nicoll 4ccc7dc554 Ignore invalid accessors
Previously, if a void method with a single argument was named "set", the
annotation processor wrongly considered it was a setter candidate. This
commit updates the condition to ignore it.

Closes gh-5826
2016-05-02 10:38:19 +02:00
Johnny Lim b914b4aa52 Remove the second parameter of substring() if possible
Closes gh-5720
2016-04-20 09:18:35 +02:00
Spring Buildmaster 225d877ab9 Next Development Version 2016-02-26 01:06:16 -08:00
Andy Wilkinson 44ddfcc7fa Upgrade copyright headers of all files changed in 2016 2016-02-25 12:09:42 +00:00
Phillip Webb 00cfe1d054 Use AssertJ in spring-boot-tools
See gh-5083
2016-02-06 15:51:26 -08:00
Phillip Webb fbaf209240 Move master to 1.4.0.BUILD-SNAPSHOT 2016-01-24 10:45:24 -08:00
Spring Buildmaster 504d3e97ba Next development version 2016-01-21 18:41:30 -08:00
Spring Buildmaster 8db59059a5 Next Development Version 2015-12-18 05:43:02 -08:00
Phillip Webb 2d2e4eea82 Merge branch '1.2.x' 2015-12-10 15:01:29 +00:00
Phillip Webb 2694605a4d Polish 2015-12-10 14:43:00 +00:00
Stephane Nicoll 141907c65f Merge branch '1.2.x'
# Conflicts:
#	spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessor.java
#	spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessorTests.java
2015-11-26 20:25:00 +01:00
Stephane Nicoll ae13082e0d Generate meta-data for nested Lombok types
Closes gh-4397
2015-11-26 20:23:24 +01:00
Johnny Lim 8ec00c35bf Polish
Closes gh-4572
2015-11-21 08:12:21 +01:00
Spring Buildmaster 3f6f57a80e Next Development Version 2015-11-16 03:18:54 -08:00
Phillip Webb 6c2ea4648f Polish 2015-11-03 20:36:20 -08:00
Stephane Nicoll 0b326035b0 Fix detection of property setter
Previously, the meta-data annotation processor was taking the first
setter that match the property name it has to handle. Contrary to
getters that are enforced by a return type (no argument), multiple
setter candidates may exist.

If a property's type got narrowed over time, the original setter may
have been marked as Deprecated. As the annotation processor takes the
first setter that matches based on the name only, it may pick up the
deprecated one and therefore mark the property as being (wrongly)
deprecatede in the meta-data.

It turns out that checking for the actual type of the setter parameter
brought a side effect: some primitive properties may use the primitive
or the Wrapper counter part. This commit not only look at the proper
setter based on the type but also fallback on the wrapper (or) primitive
if necessary.

Closes gh-4338
2015-10-31 10:16:24 +01:00
Phillip Webb 90f7bc0321 Polish 2015-10-19 13:04:06 -07:00
Phillip Webb 634bb770b2 Organize imports with new settings
See gh-4234
2015-10-19 12:58:34 -07:00
Phillip Webb 1e4d974ec0 Merge remote-tracking branch 'local12x/1.2.x' 2015-10-19 12:56:55 -07:00
Phillip Webb a79131f8d2 Organize imports with new settings
See gh-4234
2015-10-19 12:55:44 -07:00
Spring Buildmaster 2b38a861e3 Next Development Version 2015-10-16 05:57:24 -07:00
Phillip Webb c9fb9916b8 Reformat code using Eclipse Mars 2015-10-07 23:37:10 -07:00
Phillip Webb e473364e4e Merge branch '1.2.x' 2015-10-07 23:34:08 -07:00
Phillip Webb 6ab376e2e8 Reformat code use Eclipse Mars 2015-10-07 23:32:31 -07:00
Andy Wilkinson 051ebf3fac Polishing: fix a number of compiler warnings reported by Eclipse 2015-09-22 13:30:07 +01:00
Spring Buildmaster 9409c49c10 Next development version 2015-09-16 09:00:17 -07:00
Phillip Webb e674d751de Polish Javadoc 2015-09-08 17:01:36 -07:00
Phillip Webb e07df7e4c6 Remove redundant modifiers 2015-09-08 17:01:30 -07:00
Phillip Webb d09805fd75 Polish license headers 2015-09-08 16:05:05 -07:00
Phillip Webb 6e29ee4557 Polish 2015-09-08 16:04:30 -07:00
Phillip Webb 67402405db Reformat code 2015-09-08 14:56:40 -07:00
Phillip Webb 0335053139 Merge branch '1.2.x' 2015-09-08 14:37:16 -07:00
Phillip Webb 15686ed4fd Reformat code 2015-09-08 14:07:06 -07:00
Phillip Webb 0f6b60d8c8 Organize imports 2015-09-08 14:05:00 -07:00
Stephane Nicoll 35875c7f08 Merge manual item meta-data
Previously, manual meta-data were added to the existing set of entries
which could lead to duplicates if a manual entry is meant to complement
a property that is detected via the processor.

We now match the name and type of the item against the auto-detected
entries. If no match is found, we add the extra entry as we did before.
If a match is found we override the description, default value and
deprecation information.

Closes gh-3562
2015-08-20 17:08:54 +02:00
Stephane Nicoll 3763eda64e Merge branch '1.2.x' 2015-08-10 16:36:11 +02:00
Stephane Nicoll 1ee31e73d3 Avoid NPE if @ConfigurationProperties is not present
The annotation processor detects `@ConfigurationProperties` bean or
method definition and merges manual meta-data. The former step will fail
with a NPE if the annotation is not present on the classpath. This could
happen if the annotation processor is added to a module that is not
actually using Spring Boot.

We now have a defensive check that skips that steps but still attempts to
merge manual meta-data if present.

Closes gh-3720
2015-08-10 16:34:30 +02:00
arghya88 64c6e5b403 Fix typo
Closes gh-3610
2015-07-28 10:39:10 +02:00
Stephane Nicoll 42e230192f Polish 2015-07-24 07:19:53 +02:00
Stephane Nicoll e9a6245a44 Remove unnecessary System.out 2015-07-22 16:59:53 +02:00
Stephane Nicoll 178c690d37 Fix meta-data root attributes ordering 2015-07-22 16:59:25 +02:00
Phillip Webb e9d252e05c Add @DeprecatedConfigurationProperties annotation
Add a new @DeprecatedConfigurationProperties annotation which can be
used by the `ConfigurationMetadataAnnotationProcessor` to generating
meta-data deprecated blocks.

Fixes gh-3543
2015-07-17 14:14:37 -07:00
Phillip Webb 728e64b929 Polish 2015-07-16 12:56:49 -07:00
izeye f4589e7cc3 Fix typos
Closes gh-3504
2015-07-15 15:45:02 +02:00
Stephane Nicoll f2d32d3e98 Add support for property deprecation
Previously, an item could only have a 'deprecated' boolean flag to
indicate that the property is deprecated. It is desirable to provide an
additional description for the deprecation as well as the name of the
property to use instead.

The `deprecated` boolean flag is now supported. Instead, a `deprecated`
object can be specified with two optional attributes: `reason` to provide
an explanation for the deprecation and `replacement` to refer to the
property that should be used instead. If none of them is present, an
empty deprecation object should be set.

For backward compatibility, the `deprecated` field is still set.

Deprecation information can only set via manual meta-data.

Closes gh-3449
2015-07-15 15:41:52 +02:00
izeye 019140c901 Remove redundant check
Closes gh-3497
2015-07-15 09:58:15 +02:00
Phillip Webb f0f5f78e25 Polish 2015-07-14 22:17:52 -07:00
Stephane Nicoll c4c24b1f44 Detect default value from factory method
If a field is initialized via a factory method taking a single argument,
we can relatively safely consider that said argument is a good
representation of its default value. This is typically the case for
Charset or MimeType instances.

We now make sure to detect such use case (i.e. method argument with a
single argument).

Closes gh-3482
2015-07-14 15:08:43 +02:00
Phillip Webb 9ebe15232e Polish 2015-07-13 11:05:46 -07:00
Stephane Nicoll cb5eccb5c1 Add missing handle-as meta-data
Liquibase has a `changeLog` property that is definitely used as a
`Resource` but cannot be defined as such as the original String value
should be kept against an API we don't control.

Update the tests also to make it more clear that if hints are added
against a property that is detected automatically, said property still
keeps all its auto-discovered capabilities.

Closes gh-3457
2015-07-13 13:45:23 +02:00
izeye f85f316873 Polish toString()
Closes gh-3465
2015-07-13 09:52:29 +02:00
Stephane Nicoll 3664895f04 Polish 2015-07-12 09:20:12 +02:00