From: Adrian Freihofer <[email protected]>

Remove the VSCode setup from oe-init-build-env.

Since poky as a combo-layer repository is no longer available, using the
oe-init-build-env script from openembedded-core is no longer
straightforward. There are too many ways to set up a build environment,
with different directory structures, with containers involved or not,
etc. Each of these setups may have its own way to provide IDE support.
A simple shell script like oe-init-vscode cannot address all these use
cases. Rather than trying to make oe-init-build-env smart enough to
cover all these cases, it is better to delegate the responsibility to
whatever tool or repository is used to set up the build environment.

If no tool such as bitbake-setup is used, it is still possible to use
a variant of the oe-setup-vscode script from a custom layer. One way
which works well is to create a custom oe-init-build-env script in the
custom layer repository which calls the custom oe-setup-vscode script
from the custom layer repository. Example directory structure:

  my-project/
  ├── .vscode     # generated by oe-setup-vscode
  |               # when oe-init-build-env is called
  ├── layers/
  │   └── openembedded-core/
  |   └── bitbake/
  ├── scripts/
  │   └── oe-setup-vscode
  ├── build/
  │   └── conf
  └── oe-init-build-env

Signed-off-by: Adrian Freihofer <[email protected]>
---
 oe-init-build-env       |  5 ---
 scripts/oe-setup-vscode | 93 -----------------------------------------
 2 files changed, 98 deletions(-)
 delete mode 100755 scripts/oe-setup-vscode

diff --git a/oe-init-build-env b/oe-init-build-env
index 82382f2707..5a2bd0f4d9 100755
--- a/oe-init-build-env
+++ b/oe-init-build-env
@@ -48,11 +48,6 @@ export 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"
diff --git a/scripts/oe-setup-vscode b/scripts/oe-setup-vscode
deleted file mode 100755
index b8642780d5..0000000000
--- a/scripts/oe-setup-vscode
+++ /dev/null
@@ -1,93 +0,0 @@
-#!/bin/sh
-
-usage() {
-    echo "$0 <OEINIT> <BUILDDIR>"
-    echo "  OEINIT:   path to directory where the .vscode folder is"
-    echo "  BUILDDIR: directory passed to the oe-init-setup-env script"
-}
-
-if [ "$#" -ne 2 ]; then
-    usage
-    exit 1
-fi
-
-OEINIT=$(readlink -f "$1")
-BUILDDIR=$(readlink -f "$2")
-VSCODEDIR=$OEINIT/.vscode
-
-if [ ! -d "$OEINIT" ] || [ ! -d "$BUILDDIR" ]; then
-    echo "$OEINIT and/or $BUILDDIR directories are not present."
-    exit 1
-fi
-
-VSCODE_SETTINGS=$VSCODEDIR/settings.json
-ws_builddir="$(echo "$BUILDDIR" | sed -e "s|$OEINIT|\${workspaceFolder}|g")"
-
-# If BUILDDIR is in scope of VSCode ensure VSCode does not try to index the 
build folder.
-# This would lead to a busy CPU and finally to an OOM exception.
-mkdir -p "$VSCODEDIR"
-cat <<EOMsettings > "$VSCODE_SETTINGS"
-{
-    "bitbake.pathToBitbakeFolder": "\${workspaceFolder}/bitbake",
-    "bitbake.pathToEnvScript": "\${workspaceFolder}/oe-init-build-env",
-    "bitbake.pathToBuildFolder": "$ws_builddir",
-    "bitbake.commandWrapper": "",
-    "bitbake.workingDirectory": "\${workspaceFolder}",
-    "files.exclude": {
-        "**/.git/**": true,
-        "**/_build/**": true,
-        "**/buildhistory/**": true,
-        "**/cache/**": true,
-        "**/downloads/**": true,
-        "**/node_modules/**": true,
-        "**/oe-logs/**": true,
-        "**/oe-workdir/**": true,
-        "**/sstate-cache/**": true,
-        "**/tmp*/**": true,
-        "**/workspace/attic/**": true,
-        "**/workspace/sources/**": true
-    },
-    "files.watcherExclude": {
-        "**/.git/**": true,
-        "**/_build/**": true,
-        "**/buildhistory/**": true,
-        "**/cache/**": true,
-        "**/downloads/**": true,
-        "**/node_modules/**": true,
-        "**/oe-logs/**": true,
-        "**/oe-workdir/**": true,
-        "**/sstate-cache/**": true,
-        "**/tmp*/**": true,
-        "**/workspace/attic/**": true,
-        "**/workspace/sources/**": true
-    },
-    "python.analysis.exclude": [
-        "**/_build/**",
-        "**/.git/**",
-        "**/buildhistory/**",
-        "**/cache/**",
-        "**/downloads/**",
-        "**/node_modules/**",
-        "**/oe-logs/**",
-        "**/oe-workdir/**",
-        "**/sstate-cache/**",
-        "**/tmp*/**",
-        "**/workspace/attic/**",
-        "**/workspace/sources/**"
-    ]
-}
-EOMsettings
-
-
-# Ask the user if the yocto-bitbake extension should be installed
-VSCODE_EXTENSIONS=$VSCODEDIR/extensions.json
-cat <<EOMextensions > "$VSCODE_EXTENSIONS"
-{
-    "recommendations": [
-        "yocto-project.yocto-bitbake"
-    ]
-}
-EOMextensions
-
-echo "You had no $VSCODEDIR configuration."
-echo "These configuration files have therefore been created for you."
-- 
2.53.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#232061): 
https://lists.openembedded.org/g/openembedded-core/message/232061
Mute This Topic: https://lists.openembedded.org/mt/118019220/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to