jextract on JavaFx

Johan Vos johan.vos at gluonhq.com
Mon Nov 18 07:55:53 UTC 2024


The latter (have the bindings generated at build time) is more in line with
other parts of OpenJFX (e.g. decora).
Also, the generated files can be large, and depend on what version of
jextract one is using.
I think it's better not to have them in the src section of the code, but to
generate them at runtime.

- Johan

On Mon, Nov 18, 2024 at 12:50 AM Thiago Milczarek Sayão <
thiago.sayao at gmail.com> wrote:

> I would have a system lib that would be compatible forever (theoretically)
> and some C code,
> but I just want to bind specific functions, structs, typedefs, vars and
> constants (it's a big jextract command)
>
> So in the need of new functions from C to java, some might need to
> re-generate the bindings and it
> would be useful to have a gradle task for that, or any other way of
> re-generating it.
>
> Less important, but I need clearance to push it to javafx sandbox if I
> touch any new API, but I think (but not sure) it would be easier (to get
> clearance) if
> I don't include the actual binding to the API, but the binding generation
> (so the user of the branch generates it on his own machine).
>
>
>
> Em dom., 17 de nov. de 2024 às 19:23, Nir Lisker <nlisker at gmail.com>
> escreveu:
>
>> The question is: what are you binding to? If it's a library on the OS
>> that gets updated from time to time and JavaFX relies on it being there
>> (not bundled), then the generated bindings in a task could change and break
>> compilation if the Java code wasn't changed. If it's a library created by
>> JavaFX, like the bindings to graphic pipelines, then you won't want to
>> re-run the task until you actually change the native side yourself.
>>
>> On Sun, Nov 17, 2024 at 6:44 PM Thiago Milczarek Sayão <
>> thiago.sayao at gmail.com> wrote:
>>
>>> I was thinking about including a generation task as part of the build.
>>> But you're right, I can make a simpler task that generates it by running
>>> jextract only on demand rather than being part of the build.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Em dom., 17 de nov. de 2024 às 13:18, Nir Lisker <nlisker at gmail.com>
>>> escreveu:
>>>
>>>> jextract is something you run once to produce the FFM bindings that you
>>>> then add to your code base, there's no need to make it part of the build
>>>> (although I guess you can). I would think that If you're creating a PR that
>>>> needs FFM, use jextract to produce the java files and submit them as part
>>>> of the PR. Not sure what package arrangement is suitable.
>>>>
>>>> On Sun, Nov 17, 2024 at 4:29 PM Thiago Milczarek Sayão <
>>>> thiago.sayao at gmail.com> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> Are there any plans to make a default way to use jextract (or any
>>>>> other way to use ffm) on the gradle build system?
>>>>>
>>>>> -- Thiago
>>>>>
>>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20241118/4e9b08dc/attachment.htm>


More information about the openjfx-dev mailing list