Allow configuration of AutoFactory to use custom instantiator instead of new
- Dominant language
- Java
- Stars
- 10.6k
- Forks
- 1.2k
- Avg merge
- 6h 32m
- Merged PRs (30d)
- 13
Description
Gradle recommends using [`ObjectFactory#newInstance`](https://github.com/gradle/gradle/blob/048958212baea839816c621f60db1975578e525a/subprojects/core-api/src/main/java/org/gradle/api/model/ObjectFactory.java#L91) to create new instances of classes as it performs a runtime decoration on the classes. It takes the class to instantiate as the first argument and all of the `@Inject` annotated constructor arguments as the following arguments.
Unfortunately, AutoFactory is opinionated to use `new` (with good reason). I'm wondering if we could accommodate cases such as this one where a custom instantiator could be used instead of using `new`. I would rather not have to maintain a fork of this processor.
Is this something this project would accept as a contribution? If so, which design should we go for? It would be nice to `@Provided` the instantiator class so it can be used automatically.
Contributor guide
Assessment
This issue has not been assessed yet.