I want to build a GraalVM native image (CLI app) that uses/calls the Gradle Tooling API.
In order to do that, a Gradle daemon must exist. So far it seems as though a native image cannot start a Gradle daemon. I suspect it is due to reflection and/or a lot of classes (like, a lot!) that I'm not providing to the config of native image.
Does anybody know if it's even remotely possible to do this? If so, how? Note, that it is important to me that the native image is able to create the daemon directly, if possible.
So far, I've resorted to "delegate" the Gradle Tooling API (and daemon creation) parts of the CLI app to a sub-process that is started by the native image, and the sub-process handles the API calls and feeds the IO back to the native image using inheritIO()
. So I've resorted to create a native image and a (shadow)Jar, where the native image calls the Jar using the JDK of my choosing.