diff options
author | Adrian Freihofer <adrian.freihofer@gmail.com> | 2024-02-15 23:53:33 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-02-19 11:34:09 +0000 |
commit | 48829be7ab2edcbc2e4473f81cdaf35889d63f9c (patch) | |
tree | a3f8ca209bd6ddc77ad063fe414ca11f7b804a79 /oe-init-build-env | |
parent | f36771e155b9e0cf24a885bf3340d59036aa42c5 (diff) | |
download | openembedded-core-48829be7ab2edcbc2e4473f81cdaf35889d63f9c.tar.gz |
oe-init-build-env: generate .vscode from template
Provide a reasonable default configuration for VSCode and the
yocto.bitbake extension.
The generated default configuration is generic and minimal. It's mostly
supposed to prevent VSCode from OOM exceptions if the build directory is
in the scope of the indexer plugins of VSCode.
But it also configures the yocto-bitbake plugin to just work without
manual user interaction.
The configuration is only generated if VSCode is installed. Currently,
VSCode is one of many popular editors for Yocto/OE. Removing the check
would mean that the configuration would be generated by e.g. oe-selftest
or for users not using VSCode. If it should prove useful, the check can
be removed later.
Customization for other layers is possible. A layer might provide it's
own oe-setup-build-env script which calls the oe-setup-vscode script
from poky with different folders. But it's also possible to override the
oe-setup-vscode script by another layer with a custom implementation.
Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'oe-init-build-env')
-rwxr-xr-x | oe-init-build-env | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/oe-init-build-env b/oe-init-build-env index 38333ab858..82382f2707 100755 --- a/oe-init-build-env +++ b/oe-init-build-env @@ -47,6 +47,12 @@ export OEROOT unset OEROOT return 1 } + +# Generate an initial configuration for VSCode and the yocto-bitbake plugin. +if command -v code > /dev/null && [ ! -d "$OEROOT/.vscode" ]; then + oe-setup-vscode "$OEROOT" "$BUILDDIR" +fi + unset OEROOT [ -z "$BUILDDIR" ] || cd "$BUILDDIR" |