2

As described in this guide I am using ./gradlew buildNativeLambda command to generate zip file containing graalvm native image. I am facing a problem described in this thread so wanted to include resource by passing -H:IncludeResources to my command like below:

./gradlew buildNativeLambda -H:IncludeResources="com/amazonaws/partitions/endpoints.json"

Unfortunately, its failing with Unknown command-line option '-H'. How can I pass this to gradle task?

Ayush Shukla
  • 419
  • 1
  • 4
  • 10

1 Answers1

1

Seems like the right way to do it is though build.gradle file like below:

graalvmNative {
    binaries {
        main {
            buildArgs "-H:IncludeResources=\"com/amazonaws/partitions/endpoints.json\""
        }
    }
}
Ayush Shukla
  • 419
  • 1
  • 4
  • 10
  • This is correct! Where did you find documentation about that? – Bruno Negrão Zica Aug 29 '22 at 13:19
  • This does not work - the lambda for main is definitely wrong. The current implementation takes an `Array` and when I assume these to be CLI args, it tells me `error: source file or directory not found` for every arg and doesn't tell me where or what it's looking for – Christian Bongiorno Nov 21 '22 at 03:30