Hi, I'm working on a Gradle plug-in that's written...
# community-support
j
Hi, I'm working on a Gradle plug-in that's written in kotlin using micronaut and it currently isn't using bean injection for configuration files and I was wondering does Gradle plugins support bean injection? Is there a good project I can look at that could put me in the right direction?
v
I have no idea about Micronaut. But typically IoC requires that the IoC container manages the lifecycle of objects. But while you can give instances to Gradle you usually should not, but let Gradle create them which then also adds some capabilities like extension awareness. If Micronaut can inject into already built instances, you could surely do that. But Gradle will not find Micronaut beans and inject them.
j
Gotcha. Thanks for getting back to me. I'm basically trying to write some tests and a nice way to specify that my http client should call my mock server. Currently my http client is pulling in a test address via system properties that I pass to Gradle. It defaults to the prod host.