Skip to content

Support the conditional configuration mode of the native-image-agent #206

@gradinac

Description

@gradinac

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:

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 from org.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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions