wolfs commented on a change in pull request #1382:
URL: https://github.com/apache/groovy/pull/1382#discussion_r499184531
##########
File path:
buildSrc/src/main/groovy/org/apache/groovy/gradle/GroovyLibraryExtension.groovy
##########
@@ -64,16 +66,18 @@ class GroovyLibraryExtension {
final TaskContainer tasks
final ProjectLayout layout
+ @Inject
GroovyLibraryExtension(ObjectFactory factory,
+ ProjectLayout layout,
SharedConfiguration sharedConfiguration,
JavaPluginConvention javaPluginConvention,
JavaPluginExtension javaPluginExtension,
SoftwareComponentContainer components,
ConfigurationContainer configurations,
- TaskContainer tasks,
- ProjectLayout layout
+ TaskContainer tasks
) {
this.objects = factory
+ this.layout = layout
this.sharedConfiguration = sharedConfiguration
this.includeInGroovyAll = factory.property(Boolean).convention(true)
this.grooid = factory.property(Boolean).convention(false)
Review comment:
I think you should get away with declaring the `grooid` property
abstract and then calling the abstract getter in the constructor setting it to
a convention. This would allow you to get rid of using the `ObjectFactory`, if
you wouldn't need it to instantiate the attributes.
So something like this should work:
```
class GroovyLibraryExtension {
abstract Property<Boolean> getGrooid()
GroovyLibraryExtension(...) {
grooid.convention(false)
}
}
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]