RFR: 7903633: Make source mode the default, and drop compiled mode [v3]
Jorn Vernee
jvernee at openjdk.org
Fri Jan 19 13:13:08 UTC 2024
> 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 three additional commits since the last revision:
- Fix rendering of -D option help text
- review comments
- update readme
-------------
Changes:
- all: https://git.openjdk.org/jextract/pull/186/files
- new: https://git.openjdk.org/jextract/pull/186/files/2ccae1ca..11cb2431
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jextract&pr=186&range=02
- incr: https://webrevs.openjdk.org/?repo=jextract&pr=186&range=01-02
Stats: 365 lines in 49 files changed: 87 ins; 196 del; 82 mod
Patch: https://git.openjdk.org/jextract/pull/186.diff
Fetch: git fetch https://git.openjdk.org/jextract.git pull/186/head:pull/186
PR: https://git.openjdk.org/jextract/pull/186
More information about the jextract-dev
mailing list