Hi - I'm trying to improve on the GraalVM plugins ...
# community-support
r
Hi - I'm trying to improve on the GraalVM plugins setup. Unfortunately I'm running into a circular dependency problem. At a high level: •
nativeCompile
needs the jar file to include a
META-INF/native-image/<project_name>/reachability-metadata.json
file, so
nativeCompile
transitively depends on
classes
• This can be generated with a test run using an agent - I've registered a new task of type
Test
called
agentTest
for this • A test run obviously has to depend on
classes
So I end up with:
nativeCompile
->
agentTest
(output
build/generated/sources/main/resources/META-INF/native-image/<project_name>/reachability-metadata.json
) ->
classes
But I need to run
classes
again between
nativeCompile
and
agentTest
so that
META-INF/native-image/<project_name>/reachability-metadata.json
is part of the jar file that
nativeCompile
works on... Perhaps I need a whole parallel flow of
nativeJar
->
nativeClasses
that can know about the output of `agentTest`; but then I'm not sure how to make
nativeCompile
use the output of my
nativeJar
rather than the
jar
task it presumably knows about.
e
I don't think it needs to be in the jar. you can set an extended classpath for
nativeCompile
,
Copy code
graalvmNative {
    binaries {
        getByName("main") {
            classpath(generated)
and then it should just all work
r
Ah! Cool, thanks.