-
Notifications
You must be signed in to change notification settings - Fork 80
Description
The goal of this ticket is to serve as a discussion point for supporting the conditional configuration generation mode of the native-image-agent.
Once oracle/graal#4270 is merged, the native-image agent will support automatically generating conditional native-image configuration. This mode will mostly be useful for library authors, as well as creators of component based applications (i.e. you can exclude an optional component from the app and automatically have all configuration from that component be excluded as well).
The intended way to generate conditional configuration automatically is through unit tests: users would run all of their tests with the agent attached and configured in this mode and as a result get a best-effort conditional configuration that can then be tweaked manually.
There are two different ways we could support this:
- Adding a new way of running tests (e.g. new task) that would execute all of the user's current tests with JVM options that enable the agent.
- As discussed with @melix, we could rework our current agent support and introduce the concept of agent modes: Do not add option "config-output-dir" when conflicting options are pr… #190 (comment).
Currently, there are only two different parameters the users can configure when using the agent in this mode:
- The packages on which the conditions will be generated - if the user specifies
org.acme, all conditions will be based on types fromorg.acme - A regex list that will be used to filter out classes from the configuration - any class in the configuration or condition that matches any of the specified regex expressions will be removed from the config.
Depending on user feedback, we may introduce additional parameters that will tune the config generation process.
We could possibly introduce default class filters (e.g. filter out all MockitoMock classes or classes that contain Test in the name) and a way to turn these off. These could either be always active or only included if certain dependencies are used.