RFR: 7903633: Make source mode the default, and drop compiled mode [v2]
Nir Lisker
nlisker at openjdk.org
Fri Jan 19 11:56:51 UTC 2024
On Thu, 18 Jan 2024 15:06:58 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:
>> Make the source output mode the default, and drop the class output mode. (See JBS issue for motivation).
>>
>> This is fairly straightforward. I've touched up the `Options` class a bit as well, as I noticed there were some unused elements. For the tests:
>> - Merged `JtregJextractSources` and `JtregJextract`. Updated generator tests to only call the merged runner
>> - `JextractToolRunner::run` is now also responsible for compiling generated source files. Renamed it to `runAndCompile`, and made the output directory an explicit argument, so that the util method can pick it up and compile the generated sources. Note that this method is now also responsible for checking that jextract runs successfully (which is required if we want to compile the output).
>> - Added a `JextractToolRunner::runNoOutput` method which just runs jextract without trying to look at the generated files (e.g. for negative tests that look for CLI errors).
>> - Added a `JextractToolRunner::run` method again, for the 2 tests that ran jextract with `--source`.
>>
>> Furthermore, now that we only generate source files, `Writer` can be simplified a lot. I've removed our dependency on `JavaFileObject`, and replaced it with a new `JavaSourceFile` record. Unfortunately, I could not remove the module dependency on java.compiler, since the `NameMangler` also uses `SourceVersion`. Does replacing JavaFileObject seem like the right move? It reduces our dependency on java.compiler (maybe we could remove it completely at some point), and replaces `JavaFileObject` with a simpler API.
>
> Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision:
>
> Simplify Writer + Remove JavaFileObject dependency
The README should also be updated to remove the `--source` option. The places I found are:
* `jextract --source -t org.jextract point.h`
* Command line options table (there's also a problem with the macro description entry)
* `jextract -t org.jextract --source @includes.txt point.h`
-------------
Changes requested by nlisker (no project role).
PR Review: https://git.openjdk.org/jextract/pull/186#pullrequestreview-1832300749
More information about the jextract-dev
mailing list