ajalt / mordant

Multiplatform text styling for Kotlin command-line applications
https://ajalt.github.io/mordant/
Apache License 2.0
957 stars 34 forks source link

Add GraalVM native image metadata #106

Closed morki closed 1 year ago

morki commented 1 year ago

This PR adds GraalVM native image metadata to enable building Mordant and Clikt with native-image tool.

Fixes regression in Clikt 4 https://github.com/ajalt/clikt/issues/415

The only thing I have no experience in is adding those resources into library JAR, so please fix if java-library approach is not the right one.

ajalt commented 1 year ago

Awesome, thank you! It looks like only the linux metadata is included. Can you add the metadata for windows and macos, too? If not, I can do it after merge.

morki commented 1 year ago

@ajalt I applied your fix to remove java-library plugin. Sorry but I don't have access to Windows or MacOS stations to generate proper metadata by agent and test it extensively.

ajalt commented 1 year ago

Thanks! I'll create the configs for other OSes. Did you do anything to generate these other than running an app with the native-image-agent?

morki commented 1 year ago

After native agent metadata generation I always manually remove things that seemed to be unrelated in interations and tests if this still compiles, but I don't remember exactly what I removed, sorry.