lvgl / lvgl

Embedded graphics library to create beautiful UIs for any MCU, MPU and display type.
https://lvgl.io
MIT License
15.68k stars 3.09k forks source link

JSON generator missing data #6474

Closed liamHowatt closed 1 week ago

liamHowatt commented 1 week ago

LVGL version

v9.1.1

What happened?

All fields except "macros" are empty in the generated JSON file.

{
    "enums": [],
    "functions": [],
    "function_pointers": [],
    "structures": [],
    "unions": [],
    "variables": [],
    "typedefs": [],
    "forward_decls": [],
    "macros": [
        {
            [...]

How to reproduce?

python3 scripts/gen_json scripts/gen_json/gen_json.py > lvgl.json
liamHowatt commented 1 week ago

cc @kdschlosser

kdschlosser commented 1 week ago

OK, i'll go over it and see what got goofed up with it.

kdschlosser commented 1 week ago

OK I am making a PR for the fix now.

I did want to note you can also use this to specify the folder to output to. You do not specify the file name only the folder where to save it to. The benefit of doing this is processing output will then be output to stdout so you can see what is going on. If you don't specify the output path then all processing messages get suppressed and the json data gets output to stdout.

The name of the output file is the name of the header file used as the input with .json as the extension. So if you have a custom header file you are passing to the script it will use that filename as the output file name. In the cause where you don't supply a custom header file lvgl.h is what gets used so the output filename is going to be lvgl.json

python3 scripts/gen_json scripts/gen_json/gen_json.py --output-path={absolute_path}

The reason why I did it this way is so it doesn't look like it has gotten stuck if launching the script from a sub process. The output can be monitored for activity to know it is still doing something.

liamHowatt commented 1 week ago

I just realized the command I put in "how to reproduce" is flawed. It should be

python3 scripts/gen_json/gen_json.py > lvgl.json

That's not why it failed though, just a typo for the issue.

kdschlosser commented 1 week ago

is it still failing?

liamHowatt commented 1 week ago

No, it works since the PR, thanks. Just clarifying the typo

kdschlosser commented 1 week ago

Yeah I saw that you said it was working in the PR but after I had already asked here.