-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19806 from Sanne/GraalExclusions2Cleanup
Add the ability for extensions to exclude GraalVM config from jars [Revisited]
- Loading branch information
Showing
2 changed files
with
64 additions
and
3 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
...ent/src/main/java/io/quarkus/deployment/builditem/nativeimage/ExcludeConfigBuildItem.java
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,41 @@ | ||
package io.quarkus.deployment.builditem.nativeimage; | ||
|
||
import io.quarkus.builder.item.MultiBuildItem; | ||
|
||
/** | ||
* A build item that allows extension to configure the native-image compiler to effectively | ||
* ignore certain configuration files in specific jars. | ||
* | ||
* The {@code jarFile} property specifies the name of the jar file or a regular expression that can be used to | ||
* match multiple jar files. | ||
* Matching jar files using regular expressions should be done as a last resort. | ||
* | ||
* The {@code resourceName} property specifies the name of the resource file or a regular expression that can be used to | ||
* match multiple resource files. | ||
* For the match to work, the resources need to be part of the matched jar file(s) (see {@code jarFile}). | ||
* Matching resource files using regular expressions should be done as a last resort. | ||
* | ||
* See https://github.com/oracle/graal/pull/3179 for more details. | ||
*/ | ||
public final class ExcludeConfigBuildItem extends MultiBuildItem { | ||
|
||
private final String jarFile; | ||
private final String resourceName; | ||
|
||
public ExcludeConfigBuildItem(String jarFile, String resourceName) { | ||
this.jarFile = jarFile; | ||
this.resourceName = resourceName; | ||
} | ||
|
||
public ExcludeConfigBuildItem(String jarFile) { | ||
this(jarFile, "/META-INF/native-image/native-image\\.properties"); | ||
} | ||
|
||
public String getJarFile() { | ||
return jarFile; | ||
} | ||
|
||
public String getResourceName() { | ||
return resourceName; | ||
} | ||
} |
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