eez-open / studio

Cross-platform low-code GUI and automation
https://www.envox.eu/studio/studio-introduction/
GNU General Public License v3.0
593 stars 97 forks source link

Support for code generation from command line #340

Open EricBourdin opened 7 months ago

EricBourdin commented 7 months ago

Hi It would be useful to add support for C code génération from command line. It would allow projects with eez studio to integrate nicely in Continous integration systems (Aka Jenkins).

My personal need is for lvgl projects.

Regards

mvladic commented 7 months ago

You can now start EEZ Studio executable from command line with --build-project parameter. For example:

eezstudio --build-project /path/to/my-project.eez-project

This feature will be available in the next version, 0.13.0, which will be released in about 4 weeks.

Another way is to clone studio repository right now and then:

npm install
npm run build
npm start -- --build-project /path/to/my-project.eez-project

I'm not sure how this is practical for your Continuous integration system since building studio from source takes some time which will add to your total building time.

Another way this could be done is to migrate the complete LVGL build support to another repository and make npm module out of it. But it's too much work for us right now.

fietser28 commented 7 months ago

Maybe publish a docker container with each release in the future? That might allow for faster CI runs on git

mvladic commented 7 months ago

Good idea. Is there anyone here who can help with this?

EricBourdin commented 6 months ago

Hello, I have tried this feature with latest version of EEZ Studio (0.13.0) The feature works. Thank you very much for implementing it.

But unfortunately when running from our Continuous Integration server, we encounter a problem related to $DISPLAY environment variable.

We have this error message: [48268:0516/140019.030212:ERROR:ozone_platform_x11.cc(240)] Missing X server or $DISPLAY

To reproduce this, you can use this steps on Linux:

$ unset DISPLAY $ eezstudio --build-project lvgl_user_widget_example.eez-project [48268:0516/140019.030212:ERROR:ozone_platform_x11.cc(240)] Missing X server or $DISPLAY [48268:0516/140019.030253:ERROR:env.cc(257)] The platform failed to initialize. Exiting.

Do you think it is possible to fix this ?

Regards, Eric Bourdin

mvladic commented 6 months ago

Although this feature does not require a GUI, EEZ Studio is a GUI application and requires GUI support on the system (DISPLAY environment variable and X server). I see that there are a lot of questions on the Internet about how to run Chromium in combination with Selenium under one of the CI systems, so I suggest that you try to find a solution yourself and please report the result here.

EricBourdin commented 6 months ago

I am using this : xvfb-run eezstudio

Xvfb is a tool to run X11 app without X11.

mvladic commented 6 months ago

Is it working with the xvfb-run?