Using Akka in Plugin


(levi yourchuck) #1

I am trying to use Akka in a gradle plugin.

To create an akka ActorSystem, it will attempt to read a resource “reference.conf”.

This fails in the gradle plugin because it appears that the classpath which is specified in the build.gradle file is not what the plugin class actually runs with.

There seems to be some kind of custom classloader going on because in all cases the classpath for the plugin class has only the gradle-launcher.jar.

I have looked at all the documentation and searched this forum, I do not see a clear picture of if it is possible to load a resource file from a plugin.

Is it prohibited to load in resource files within a plugin?

It looks like in order to get an ActorSystem running in a gradle build, I will need to use JavaExec, but then I wonder how much of the gradle incremental build stuff I would miss out on as it is no longer dealing with inputs and outputs.

Perhaps I can wrap the usage of JavaExec inside a plugin…

Any thoughts?

https://docs.gradle.org/current/dsl/org.gradle.api.tasks.JavaExec.html