-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: use jsonc config file for gvm class init config
Signed-off-by: Sam Gammon <sam@elide.dev>
- Loading branch information
Showing
4 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import kotlinx.serialization.Serializable | ||
|
||
/** | ||
* Models the structure of a simple JSON config file for classes and packages which should be | ||
* initialized at build time or run time by the GraalVM Native Image compiler. | ||
* | ||
* @property initializeAtBuildTime A list of fully qualified class names or package names which | ||
* should be initialized at build time. | ||
* @property initializeAtRunTime A list of fully qualified class names or package names which | ||
* should be initialized at run time. | ||
*/ | ||
@JvmRecord | ||
@Serializable | ||
data class GraalVmInitializationConfig( | ||
val initializeAtBuildTime: List<String> = emptyList(), | ||
val initializeAtRunTime: List<String> = emptyList(), | ||
) { | ||
/** | ||
* Return as a serialized list of string arguments that can be supplied to the Native Image | ||
* compiler. | ||
*/ | ||
val asArgs: List<String> get() = | ||
buildList { | ||
addAll(initializeAtBuildTime.map { "--initialize-at-build-time=$it" }) | ||
addAll(initializeAtRunTime.map { "--initialize-at-run-time=$it" }) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters