Integrated: 7903633: Make source mode the default, and drop compiled mode
Jorn Vernee
jvernee at openjdk.org
Fri Jan 19 13:44:54 UTC 2024
On Thu, 18 Jan 2024 14:15:14 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.
This pull request has now been integrated.
Changeset: ecc77d63
Author: Jorn Vernee <jvernee at openjdk.org>
URL: https://git.openjdk.org/jextract/commit/ecc77d63926a15b8c8d372b0d2ac155dc37f599d
Stats: 1258 lines in 102 files changed: 213 ins; 798 del; 247 mod
7903633: Make source mode the default, and drop compiled mode
Reviewed-by: mcimadamore
-------------
PR: https://git.openjdk.org/jextract/pull/186
More information about the jextract-dev
mailing list