Get WorkerProcessFactory from custom plugin


(Stefan Wolf) #1

Hi,

is it possible to get a Factory (which can be injected in the core) in a custom plugin? I want to fork my own JVM and therefore access this WorkerProcessBuilderFactory without building my own. Is this possible?


(Luke Daley) #2

There’s no public implementation, but there is an internal one. If you want to use it (accepting all of the obligations that come with using internal code), you can get an instance like the internal code does. You can study the FindBugs plugin as an example.


(Stefan Wolf) #3

Thanks, this works! Is it also possible to get stuff injected with creating a new Task? Right now I use tasks.create(‘captureProcessBuilder’, CaptureProcessBuilderTask) to create a Task just to get the injected properties from this Task afterwards (see https://github.com/TNG/remote-executor-gradle-plugin/blob/master/build.gradle).


(Luke Daley) #4

Plugins are also dependency injected.


(Stefan Wolf) #5

Thanks! Is this already documented somewhere?