8260976: investigate ways to filter jextract output #469
This patch adds new filtering capabilities to jextract, along the lines of what discussed in  (thanks Duncan for all the insightful comments on the topic!).
The patch adds some new options:
When one (or more) options like these are specified, jextract goes into some kind of avdanced filtering mode, and will only emit bindings for the specified symbols. Note: when no
To help the user with the filtering process, another option has been added:
When this option is used, jextract will not emit any bindings - instead, it will dump all the included symbol on the specified file. The file is a simple text file, organized as follows (the following has been obtained extracting OpenGL):
In other words, the generated file contains all the symbols that have been inclided, in the form of "options". In fact, the generated file can be played back into jextract - assuming
The output file should be stable - e.g. all entries are grouped by header file (and header files are sorted alphabetially); whithin each header, entries are sorted by category (e.g. variable vs. function) and then also alphabetically within same category. This should help users finding things quickly.
In addition, each line has a comment which states from which header is the symbol coming from. I found this super helpful to define custom header-based filtering scheme using
The implementation is relatively straightforward - other than adding support for the new option, it was mostly matter of making sure that OutputFactory does notgenerate the filtered out symbols.
The text was updated successfully, but these errors were encountered:
@mcimadamore This change now passes all automated pre-integration checks.
After integration, the commit message for the final commit will be:
At the time when this comment was updated there had been 88 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.
This works very well and I've abandoned my local jextract edits as I can
As you mentioned in JDK-8260976, point #7 will help to warn if there are
On 12/03/2021 14:14, Maurizio Cimadamore wrote:
@mcimadamore Since your change was applied there have been 467 commits pushed to the
Your commit was automatically rebased without conflicts.
Pushed as commit 04160de.