Skip to content

Conversation

@bitrunner
Copy link

This pull request adds support for working with meson build projects. Meson is cross platform build system used mostly for C/C++ but can build other things (D, rust, java, vala, etc).

This feature allows netbeans to directly open existing meson build based projects as netbeans projects. It provides a minimal configuration UI and compile, run, and test actions through the standard netbeans facilities. It has syntax highlighting for meson.build and meson.options files.

Here are some screenshots:
open_project
project_properties
syntax_highlighting

It works and has been useful for me as is, but I'd like some feedback from the community on how best to integrate this into netbeans:

  • Is this quest worthwhile?
  • Does it make sense to add this to core or would it be better as a separate plugin?
  • If the feature is best in core, should it be part of CND or somewhere else? (Even though I put it in CND, it doesn't currently use any CND capabilities. I would like to add debugging support which will probably use CND if I can manage to comprehend how to make that happen. I would also like to add support for the remote development capabilities provided by CND.)
  • All constructive feedback is welcome.

Copy link
Contributor

@vieiro vieiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi there! Thanks @bitrunner for the contribution. Looks great.

Here're some mandatory requirements to merge the contribution. The following files have no license headers:

  • cnd/cnd.meson/src/org/netbeans/modules/cnd/meson/project/ui/ConfigurationPanel.form
  • cnd/cnd.meson/nbproject/project.xml
  • cnd/cnd.meson/src/org/netbeans/modules/cnd/meson/project/ui/Bundle.properties
  • cnd/cnd.meson/nbproject/project.properties
  • cnd/cnd.meson/src/org/netbeans/modules/cnd/meson/project/Bundle.properties

If you take a look at the NetBeans source code you can find examples on how to add the licenses to the files.

We verify these license files with the "ant -Dcluster.config=cnd rat" command.

I'll add some other non-mandatory suggestions in separate comments.

@vieiro
Copy link
Contributor

vieiro commented Dec 19, 2023

Suggestion I:

When I extend the "Meson project/Configuration" panel horizontally some controls do not occupy the whole space (see red lines in the screenshot below). It would be great if these could expand horizontally.

imagen

@vieiro
Copy link
Contributor

vieiro commented Dec 19, 2023

Suggestion II / clarification:

The lexer looks superb! Little people know how to write these properly. Congratulations!

When I try to "Clean & Build" the project I get this error message, and I'm afraid I'm confused. Maybe the "working" directory to execute the command is wrong or something?

imagen

My current configuration (generated automatically) is the one in the previous screenshot.

@bitrunner
Copy link
Author

bitrunner commented Jan 7, 2024

Thanks for spending time reviewing and providing such helpful feedback on this @vieiro!

I believe this thing has all the appropriate license headers now. (rat seems satisfied)

I also managed to trick the meson project configuration dialog into doing more reasonable things when resized horizontally. I didn't even think to try that.

I also added support for project aware new files. Right-click on something in the project explorer and selecting New should now present meson file options as well as options appropriate for whatever netbeans aware languages the meson project is configured for (C, C++, fortran, java, rust).

As for the error shown in "Suggestion II/clarification" above, I'm curious as to how the project got into that state. The .netbeans/build/default directory exists but appears to have .gitignore and .hgignore files in it but not a complete meson build directory. I would guess that happened due to a previous failure of the "meson setup" command. Manually re-running the "Setup" action from right-clicking on the project should have fixed the situation.

I added detection of invalid/incomplete meson build directories which should result in automatic running of "meson setup" when necessary even when the build directory exists. I tested the condition above and it now seems to work for me.

Thanks for pointing that problem out as I failed to imagine it. The module should behave much more robustly now.

@vieiro
Copy link
Contributor

vieiro commented Jan 13, 2024

Thanks, @bitrunner . Cool to have meson-build support added. Merging.

@vieiro vieiro merged commit f04505c into apache:cnd Jan 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants