-
Notifications
You must be signed in to change notification settings - Fork 100
fix: convert missed AnalyzerExtension to the property API #476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Note that this PR also adds the |
|
I believe there's a much less boilerplatey (and possibly less error-prone) way to make these changes by just defining property fields by their accessor, making them abstract, and then just configuring the convention in constructor Something like abstract class AnalyzerExtension {
@Input @Optional abstract Property<Boolean> getExperimentalEnabled()
// ...
AnalyzerExtension() {
experimentalEnabled.convention(false)
// ...
}Like the example at https://docs.gradle.org/current/userguide/lazy_configuration.html#where_to_apply_conventions_from Which also avoids you needed to create getters and setters, except for any "non-standard" signatures you want to add on. |
|
For now, I think I'll leave it with all the boilerplate code. To use the method suggested, we would need to convert several classes to interfaces and update more of the implementation. |
Signed-off-by: Chad Wilson <[email protected]>
|
Additional manual testing with @chadlwilson PR merged appears to work as expected. |
|
@chadlwilson I have to take off for a few hours. Unless you object or find something else wrong - I plan on merging this later today (US East Coast time) and releasing 12.1.8. |
I think with the magic of Groovy you just need to mark classes as abstract and change some extensions to be created via the extension creation API rather than |
One extension was missed in #473. This PR should complete the transition to the property API.