Robert Elliot
02/11/2025, 11:46 AMnativeCompile 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.ephemient
02/11/2025, 3:31 PMnativeCompile,
graalvmNative {
binaries {
getByName("main") {
classpath(generated)
and then it should just all workRobert Elliot
02/11/2025, 3:41 PM