devtool IDE plugin
Hi
On
https://www.yoctoproject.org/community/yocto-project-engineering-request-for-quotation/
there are some proposed areas of development for the Yocto Project. I think I have a first draft implementation available for "VSCode IDE Integration – New developer tooling".
It's available on my branch in poky-contrib:
https://git.yoctoproject.org/poky-contrib/log/?h=adrianf/devtool-ide.
Just let me know if patches are preferred over this link.
A brief summary how it works:
Prepare the eSDK (not the installer, just the bitbake environment)
$ . oe-init-build-env
Add this to the local.conf
IMAGE_CLASSES += "image-combined-dbg" IMAGE_GEN_DEBUGFS = "1"IMAGE_FEATURES += "ssh-server-dropbear bash-completion-pkgs" IMAGE_INSTALL:append = "\
cmake-example-ptest meson-example-ptest gdbserver"
$ devtool modify cmake-example $ devtool ide cmake-example core-image-minimal $ runqemu
Start VSCode
$ code "$BUILDDIR/workspace/sources/cmake-example"
Work in VSCode, after installing the proposed plugins Ctrl + Shift + p, cmake Select Configure Preset Ctrl + Shift + p, cmake Build
Ctrl + Shift + p, cmake Test
...
Remote debugging with GDB
Ctrl + Shift + p, Run Task --> install && deploy-target cmake-example F5 (Debug configuration might be selected before)
The same should work for meson.
The design goal is to generate a configuration for VSCode (or other IDEs) that allows to develop the code of a recipe completely independent from bitbake. bitbake is only needed to generate the configuration and update the SDK. But bitbake should not be called while working in the IDE. This has two major advantages over calling devtool build, for example:
* The IDE offers plugins e.g. for integration with cmake. These features are usable, which would not be the case if bitbake or devtool were called from the IDE.
* It is much faster.
If devtool ide is called for a recipe like none, meta-ide-support a cmake-kit
https://vector-of-bool.github.io/docs/vscode-cmake-tools/kits.html is added to the User-Local Kits.
There is still a lot of room for improvement and TODOs in the code. But I would like to share my current status with you now. Who knows, maybe someone is interested in trying it out or even contributing in some way so that we can get it into poky before the next LTS release.
Regards,
Adrian