[foreign] RFR 8223185: Consolidate jextract output logic in Writer

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Thu May 2 10:34:59 UTC 2019


Overall I like it. The only thing I don't like much is that Main seems 
to be in control of whether classes are being compiled (see call to 
Writer::compileClasses). I think it would be better if that was hidden 
inside Writer itself - e.g. in order to write classfiles, jars or jmod, 
first the internals will have to call 'compileClasses'. That way, Main 
would be free from any ordering issue.

Maurizio

On 01/05/2019 14:06, Jorn Vernee wrote:
> Hi,
>
> I have been experimenting with a plugin based on jextract's new source 
> code generation, for my earlier idea to generate LayoutType constants 
> in various generated classes [1].
>
> I ran into a problem using --src-dump-dir. Since the dumping is done 
> inline in the JavaSourceFactory* classes this meant the the changes 
> from the plugin were not being shown in the output.
>
> It seems good to move the source output logic to Writer, since then we 
> can do the source output once and for all in Main, after the jextract 
> run. I've also moved the JModWriter and JarWriter calls into Writer, 
> so that we have 1 main interface for doing output (Writer).
>
> Please review the following:
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8223185
> Webrev: 
> http://cr.openjdk.java.net/~jvernee/panama/webrevs/8223185/webrev.00/
>
> Thanks,
> Jorn
>
> [1] : https://bugs.openjdk.java.net/browse/JDK-8220063


More information about the panama-dev mailing list