Skip to content

Commit

Permalink
Handle Enable-Native-Access manifest attribute if present
Browse files Browse the repository at this point in the history
  • Loading branch information
zakkak committed Nov 1, 2024
1 parent 8a88c44 commit 1924173
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1053,6 +1053,7 @@ static boolean processJarManifestMainAttributes(Path jarFilePath, BiConsumer<Pat
void handleManifestFileAttributes(Path jarFilePath, Attributes mainAttributes) {
handleMainClassAttribute(jarFilePath, mainAttributes);
handleModuleAttributes(mainAttributes);
handleEnableNativeAccessAttribute(mainAttributes);
}

void handleMainClassAttribute(Path jarFilePath, Attributes mainAttributes) {
Expand All @@ -1076,6 +1077,13 @@ void handleModuleAttributes(Attributes mainAttributes) {
}
}

void handleEnableNativeAccessAttribute(Attributes mainAttributes) {
String enableNativeAccess = mainAttributes.getValue("Enable-Native-Access");
if (enableNativeAccess != null) {
addImageBuilderJavaArgs("--enable-native-access=" + enableNativeAccess);
}
}

void handleClassPathAttribute(LinkedHashSet<Path> destination, Path jarFilePath, Attributes mainAttributes) {
String classPathValue = mainAttributes.getValue("Class-Path");
/* Missing Class-Path Attribute is tolerable */
Expand Down

0 comments on commit 1924173

Please sign in to comment.