-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding the experimental option -H:Preserve
The `-H:Preserve` flag preserves all metadata from module, class-path entry, or a package in the image. This will allow users to more easily support third-party libraries and get more user-friendly experience with Native Image. The flag can be used in following ways: 1. -H:Preserve=all preserves all elements from the JDK and from the classpath 2. -H:Preserve=module=<module> preserves all elements from a given module 3. -H:Preserve=module=ALL-UNNAMED preserves all elements from the classpath 4. -H:Preserve=package=<package> preserves all elements from a given package 5. -H:Preserve=package=<package-wildcard> preserves all elements from packages captured by the wildcard. For example, -H:Preserve=package=my.app.*. 6. -H:Preserve=path=<cp-entry> preserves all elements from a given class-path entry 7. A combination of any of the previous uses, for example, -H:Preserve=path=<cp-entry>,module<module>
- Loading branch information
Showing
25 changed files
with
744 additions
and
250 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
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
17 changes: 17 additions & 0 deletions
17
substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/doc-files/PreserveHelp.txt
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,17 @@ | ||
Makes the program work correctly without providing reachability metadata. | ||
This is achieved by preserving all class elements, resources, and reflection metadata in the image. | ||
Usage of this options can cause a large increase in image size, and a small decrease in overall performance. | ||
|
||
Usage: -H:Preserve=[all|none|module=<module>|package=<package>|package=<package-wildcard>|path=<cp-entry>][,...] | ||
|
||
The flag can be used in following ways: | ||
1. -H:Preserve=all preserves all elements from the JDK, the classpath, and the module path | ||
2. -H:Preserve=module=<module> preserves all elements from a given module | ||
3. -H:Preserve=module=ALL-UNNAMED preserves all elements from all class-path entries | ||
4. -H:Preserve=package=<package> preserves all elements from a given package | ||
5. -H:Preserve=package=<package-wildcard> preserves all elements from packages captured by the wildcard. For example, -H:Preserve=package=my.app.* | ||
6. -H:Preserve=path=<cp-entry> preserves all elements from a given class-path entry | ||
7. -H:Preserve=none disables all previous selections for preservation | ||
8. A comma-separated list of the previous cases. For example, -H:Preserve=path=<cp-entry>,module=<module>,package=<package> | ||
|
||
-H:Preserve is only allowed on the native-image command line and cannot be embedded in the native-image.properties files. |
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
Oops, something went wrong.