diff --git a/client/README.md b/client/README.md index aa8c0d22..50531cc8 100644 --- a/client/README.md +++ b/client/README.md @@ -1,9 +1,15 @@ # BitBake recipe language support in Visual Studio Code -## Set BitBake's path -Some features require to know where your BitBake's folder is located. The extension will by default assume it is located at the root of the project in a folder named `bitbake`. If your BitBake folder is located somewhere else, set its path in the settings in order to have full features. +## Setup the extension +In order to work properly, the extension needs to know your Bitbake's location and build folder. It will make the following assumptions: +- Bitbake's folder is located in `sources/poky/bitbake`, relative to the root of the project. +- Your build folder is located at the root of the project in a folder named `build` -To access BitBake's settings: Files -> Preferences -> Settings [Ctrl+,]. The BitBake's settings are under Extensions. +Ideally, the path to an environment script to configure the BitBake project should also be specified. If it is not specified, the extension will try to configure the environment variables by itself. + +These can be configured into the VS Code's settings. More options are available. + +To access the settings, you can navigate to **Files -> Preferences -> Settings** (or use the shortcut [**Ctrl+,**]). BitBake's settings are under **Extensions** ## Features diff --git a/client/package.json b/client/package.json index e5bd9280..a986905f 100644 --- a/client/package.json +++ b/client/package.json @@ -62,37 +62,27 @@ "debug" ], "default": "error", - "description": "Adjust the logging level. error: only errors; info: only information that is useful for the user; debug: the same like info, but with additional debug informations" + "description": "Adjust the logging level: 'error' for reporting only errors, 'info' for displaying information useful to the user, and 'debug' for the same information as 'info,' but with additional debugging details." }, - "bitbake.deepExamine": { + "bitbake.shouldDeepExamine": { "type": "boolean", "default": false, - "description": "Activates an deeply examine. If a recipe export an extra package that have not the same name like the recipe file the normal scan will not find this packages. If you like to find the packages you have to activate this option." + "description": "Activate deep examination. If a recipe exports an additional package with a different name than the recipe file, the normal scan will not detect these packages. To find these packages, you need to activate this option." }, - "bitbake.workingFolder": { + "bitbake.pathToEnvScript": { "type": "string", - "default": "vscode-bitbake-build", - "description": "Use this setting to specify the build folder. Use other folder than for your regular 'build' to avoid collisions." + "default": "oe-init-build-env", + "description": "Set the path to the environment script to configure the BitBake project. If the file does not exist, the extension will attempt to configure the environment variables by itself." }, - "bitbake.generateWorkingFolder": { - "type": "boolean", - "default": true, - "description": "Use this setting to specify whether or not to generate a build folder. Can help prevent git repo headaches." - }, - "bitbake.pathToBashScriptInterpreter": { - "type": "string", - "default": "/bin/bash", - "description": "This interpreter is used to run bash scripts" - }, - "bitbake.machine": { + "bitbake.pathToBuildFolder": { "type": "string", - "default": "", - "description": "This setting is used to forward the machine name to bitbake." + "default": "build", + "description": "Set the build folder for the BitBake project." }, "bitbake.pathToBitbakeFolder": { "type": "string", - "default": "./bitbake", - "description": "This setting is used to specify the path to the bitbake folder." + "default": "sources/poky/bitbake", + "description": "Set the path to the BitBake folder." } } }, @@ -100,7 +90,7 @@ { "command": "bitbake.rescan-project", "title": "BitBake: Rescan Project", - "description": "This command rescans the bitbake project." + "description": "This command rescans the BitBake project." } ] }, diff --git a/package-lock.json b/package-lock.json index 0874376a..b5999f1a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1112,16 +1112,6 @@ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", "dev": true }, - "node_modules/cross-spawn": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==", - "dependencies": { - "lru-cache": "^4.0.1", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, "node_modules/cycle": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/cycle/-/cycle-1.0.3.tgz", @@ -1848,23 +1838,6 @@ "node": ">=0.10.0" } }, - "node_modules/execa": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/execa/-/execa-0.6.3.tgz", - "integrity": "sha512-/teX3MDLFBdYUhRk8WCBYboIMUmqeizu0m9Z3YF3JWrbEh/SlZg00vLJSaAGWw3wrZ9tE0buNw79eaAPYhUuvg==", - "dependencies": { - "cross-spawn": "^5.0.1", - "get-stream": "^3.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/eyes": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", @@ -2096,14 +2069,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/get-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha512-GlhdIUuVakc8SJ6kK0zAFbiGzRFzNnY4jUuEbV9UROo4Y+0Ny4fjvcZFVTeDA4odpFyOQzaw6hXukJSq/f28sQ==", - "engines": { - "node": ">=4" - } - }, "node_modules/get-symbol-description": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", @@ -2645,14 +2610,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/is-string": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", @@ -2731,7 +2688,8 @@ "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true }, "node_modules/isstream": { "version": "0.1.2", @@ -2869,15 +2827,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "dependencies": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -3032,17 +2981,6 @@ "node": ">=0.10.0" } }, - "node_modules/npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw==", - "dependencies": { - "path-key": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/object-inspect": { "version": "1.12.3", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", @@ -3151,14 +3089,6 @@ "node": ">= 0.8.0" } }, - "node_modules/p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==", - "engines": { - "node": ">=4" - } - }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -3234,14 +3164,6 @@ "node": ">=0.10.0" } }, - "node_modules/path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", - "engines": { - "node": ">=4" - } - }, "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", @@ -3292,11 +3214,6 @@ "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "dev": true }, - "node_modules/pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==" - }, "node_modules/punycode": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", @@ -3594,25 +3511,6 @@ "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", "dev": true }, - "node_modules/shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", - "dependencies": { - "shebang-regex": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/side-channel": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", @@ -3627,11 +3525,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" - }, "node_modules/slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", @@ -3744,14 +3637,6 @@ "node": ">=4" } }, - "node_modules/strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q==", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -4047,17 +3932,6 @@ "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3.tgz", "integrity": "sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA==" }, - "node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "which": "bin/which" - } - }, "node_modules/which-boxed-primitive": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", @@ -4147,11 +4021,6 @@ "node": ">=10" } }, - "node_modules/yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==" - }, "node_modules/yargs": { "version": "16.2.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", @@ -4211,7 +4080,6 @@ "version": "1.1.2", "license": "MIT", "dependencies": { - "execa": "^0.6.3", "find": "^0.2.7", "fs": "0.0.1-security", "path": "^0.12.7", @@ -5175,16 +5043,6 @@ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", "dev": true }, - "cross-spawn": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==", - "requires": { - "lru-cache": "^4.0.1", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, "cycle": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/cycle/-/cycle-1.0.3.tgz", @@ -5723,20 +5581,6 @@ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true }, - "execa": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/execa/-/execa-0.6.3.tgz", - "integrity": "sha512-/teX3MDLFBdYUhRk8WCBYboIMUmqeizu0m9Z3YF3JWrbEh/SlZg00vLJSaAGWw3wrZ9tE0buNw79eaAPYhUuvg==", - "requires": { - "cross-spawn": "^5.0.1", - "get-stream": "^3.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - } - }, "eyes": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", @@ -5921,11 +5765,6 @@ "has-symbols": "^1.0.3" } }, - "get-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha512-GlhdIUuVakc8SJ6kK0zAFbiGzRFzNnY4jUuEbV9UROo4Y+0Ny4fjvcZFVTeDA4odpFyOQzaw6hXukJSq/f28sQ==" - }, "get-symbol-description": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", @@ -6304,11 +6143,6 @@ "call-bind": "^1.0.2" } }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==" - }, "is-string": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", @@ -6360,7 +6194,8 @@ "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true }, "isstream": { "version": "0.1.2", @@ -6434,7 +6269,6 @@ "eslint-plugin-import": "^2.28.1", "eslint-plugin-n": "^16.1.0", "eslint-plugin-promise": "^6.1.1", - "execa": "^0.6.3", "find": "^0.2.7", "fs": "0.0.1-security", "path": "^0.12.7", @@ -6605,15 +6439,6 @@ "is-unicode-supported": "^0.1.0" } }, - "lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, "merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -6729,14 +6554,6 @@ "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true }, - "npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw==", - "requires": { - "path-key": "^2.0.0" - } - }, "object-inspect": { "version": "1.12.3", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", @@ -6818,11 +6635,6 @@ "type-check": "^0.4.0" } }, - "p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==" - }, "p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -6877,11 +6689,6 @@ "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true }, - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==" - }, "path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", @@ -6917,11 +6724,6 @@ "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "dev": true }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==" - }, "punycode": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", @@ -7125,19 +6927,6 @@ "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", "dev": true }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==" - }, "side-channel": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", @@ -7149,11 +6938,6 @@ "object-inspect": "^1.9.0" } }, - "signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" - }, "slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", @@ -7241,11 +7025,6 @@ "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", "dev": true }, - "strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q==" - }, "strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -7466,14 +7245,6 @@ "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3.tgz", "integrity": "sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA==" }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "requires": { - "isexe": "^2.0.0" - } - }, "which-boxed-primitive": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", @@ -7542,11 +7313,6 @@ "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "dev": true }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==" - }, "yargs": { "version": "16.2.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", diff --git a/server/package.json b/server/package.json index 2ef2cfa0..2c16d9c2 100644 --- a/server/package.json +++ b/server/package.json @@ -22,7 +22,6 @@ "lint": "eslint ." }, "dependencies": { - "execa": "^0.6.3", "find": "^0.2.7", "fs": "0.0.1-security", "path": "^0.12.7", diff --git a/server/src/BitBakeProjectScanner.ts b/server/src/BitBakeProjectScanner.ts index 4a6105e8..dab06ace 100644 --- a/server/src/BitBakeProjectScanner.ts +++ b/server/src/BitBakeProjectScanner.ts @@ -3,8 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information.Diagnstic * ------------------------------------------------------------------------------------------ */ -// @ts-expect-error -- execa has no declaration file -import execa from 'execa' +import childProcess from 'child_process' import find from 'find' import path from 'path' import fs from 'fs' @@ -42,14 +41,11 @@ export class BitBakeProjectScanner { private _classes: ElementInfo[] = new Array < ElementInfo >() private _includes: ElementInfo[] = new Array < ElementInfo >() private _recipes: ElementInfo[] = new Array < ElementInfo >() - private _deepExamine: boolean = false - private _settingsScriptInterpreter: string = '/bin/bash' - private _settingsWorkingFolder: string = 'vscode-bitbake-build' - private _settingsGenerateWorkingFolder: boolean = true - private readonly _settingsBitbakeSourceCmd: string = '.' - private _settingsMachine: string | undefined = undefined private readonly _outputParser: OutputParser - private readonly _oeEnvScript: string = 'oe-init-build-env' + private _shouldDeepExamine: boolean = false + private _pathToBuildFolder: string = 'build' + private _pathToEnvScript: string = 'oe-init-build-env' + private _pathToBitbakeFolder: string = 'bitbake' constructor (connection: Connection) { this._outputParser = new OutputParser(connection) @@ -80,48 +76,36 @@ export class BitBakeProjectScanner { return this._recipes } - get deepExamine (): boolean { - return this._deepExamine + get shouldDeepExamine (): boolean { + return this._shouldDeepExamine } - set deepExamine (deepExamine: boolean) { - this._deepExamine = deepExamine + set shouldDeepExamine (shouldDeepExamine: boolean) { + this._shouldDeepExamine = shouldDeepExamine } - get scriptInterpreter (): string { - return this._settingsScriptInterpreter + get pathToBuildFolder (): string { + return this._pathToBuildFolder } - set scriptInterpreter (scriptInterpreter: string) { - this._settingsScriptInterpreter = scriptInterpreter + set pathToBuildFolder (pathToBuildFolder: string) { + this._pathToBuildFolder = pathToBuildFolder } - get workingPath (): string { - return this._settingsWorkingFolder + get pathToEnvScript (): string { + return this._pathToEnvScript } - set workingPath (workingPath: string) { - this._settingsWorkingFolder = workingPath + set pathToEnvScript (pathToEnvScript: string) { + this._pathToEnvScript = pathToEnvScript } - get generateWorkingPath (): boolean { - return this._settingsGenerateWorkingFolder + get pathToBitbakeFolder (): string { + return this._pathToBitbakeFolder } - set generateWorkingPath (generateWorkingPath: boolean) { - this._settingsGenerateWorkingFolder = generateWorkingPath - } - - get machineName (): string | undefined { - return this._settingsMachine - } - - set machineName (machine: string) { - if (machine === '') { - this._settingsMachine = undefined - } else { - this._settingsMachine = machine - } + set pathToBitbakeFolder (pathToBitbakeFolder: string) { + this._pathToBitbakeFolder = pathToBitbakeFolder } setProjectPath (projectPath: string): void { @@ -147,10 +131,7 @@ export class BitBakeProjectScanner { this.printScanStatistic() } } catch (error) { - if (typeof error === 'string') { - logger.error(`scanning of project is abborted: ${error}`) - } - throw error + logger.error(`scanning of project is abborted: ${error as any}`) } this._scanStatus.scanIsRunning = false @@ -185,7 +166,7 @@ export class BitBakeProjectScanner { private scanAvailableLayers (): void { this._layers = new Array < LayerInfo >() - const output: string = this.executeCommandInBitBakeEnvironment('bitbake-layers show-layers') + const output: string = this.executeBitBakeCommand('bitbake-layers show-layers') if (output.length > 0) { try { @@ -244,7 +225,7 @@ export class BitBakeProjectScanner { scanForRecipes (): void { this._recipes = new Array < ElementInfo >() - const output: string = this.executeCommandInBitBakeEnvironment('bitbake-layers show-recipes') + const output: string = this.executeBitBakeCommand('bitbake-layers show-recipes') if (output.length > 0) { const outerReg: RegExp = /(.+):\n((?:\s+\S+\s+\S+(?:\s+\(skipped\))?\n)+)/g @@ -299,7 +280,7 @@ export class BitBakeProjectScanner { let parsingSuccess: boolean = true try { - parsingOutput = this.executeCommandInBitBakeEnvironment('bitbake -p', this._settingsMachine) + parsingOutput = this.executeBitBakeCommand('bitbake -p') } catch (error) { if (typeof error !== 'string') { throw error @@ -333,7 +314,7 @@ export class BitBakeProjectScanner { } } - if (this._deepExamine) { + if (this._shouldDeepExamine) { const recipesWithOutPath: ElementInfo[] = this._recipes.filter((obj: ElementInfo): boolean => { return obj.path === undefined }) @@ -341,7 +322,7 @@ export class BitBakeProjectScanner { logger.info(`${recipesWithOutPath.length} recipes must be examined more deeply.`) for (const recipeWithOutPath of recipesWithOutPath) { - const output: string = this.executeCommandInBitBakeEnvironment(`bitbake-layers show-recipes -f ${recipeWithOutPath.name}`) + const output: string = this.executeBitBakeCommand(`bitbake-layers show-recipes -f ${recipeWithOutPath.name}`) const regExp: RegExp = /(\s.*\.bb)/g let match: RegExpExecArray | null @@ -359,7 +340,7 @@ export class BitBakeProjectScanner { } private scanRecipesAppends (): void { - const output: string = this.executeCommandInBitBakeEnvironment('bitbake-layers show-appends') + const output: string = this.executeBitBakeCommand('bitbake-layers show-appends') if (output.length > 0) { const outerReg: RegExp = /(\S.*\.bb):(?:\s*\/\S*.bbappend)+/g @@ -400,68 +381,32 @@ export class BitBakeProjectScanner { } } - private executeCommandInBitBakeEnvironment (command: string, machine: string | undefined = undefined): string { - let returnValue: string = '' - - if (this.isBitbakeAvailable()) { - const scriptContent: string = this.generateBitBakeCommandScriptFileContent(command, machine) - const pathToScriptFile: string = this._projectPath + '/' + this._settingsWorkingFolder - const scriptFileName: string = pathToScriptFile + '/executeBitBakeCmd.sh' - - if (!fs.existsSync(pathToScriptFile)) { - fs.mkdirSync(pathToScriptFile) - } - fs.writeFileSync(scriptFileName, scriptContent) - fs.chmodSync(scriptFileName, '0755') - - returnValue = this.executeCommand(scriptFileName) - } - - return returnValue + private executeBitBakeCommand (command: string): string { + const scriptContent: string = this.generateBitBakeCommand(command) + return this.executeCommand(scriptContent) } private executeCommand (command: string): string { - let stdOutput: string = '' - - if (this._projectPath !== null) { - const returnObject = execa.shellSync(command) - - if (returnObject.status === 0) { - stdOutput = returnObject.stdout - } else { - const data: Buffer = fs.readFileSync(command) - logger.error('error on executing command: ' + data.toString()) - } - } - - return stdOutput + return childProcess.execSync(command).toString() } - private generateBitBakeCommandScriptFileContent (bitbakeCommand: string, machine: string | undefined = undefined): string { + private generateBitBakeCommand (bitbakeCommand: string): string { const scriptFileBuffer: string[] = [] - let scriptBitbakeCommand: string = bitbakeCommand - - scriptFileBuffer.push('#!' + this._settingsScriptInterpreter) - scriptFileBuffer.push(this._settingsBitbakeSourceCmd + ' ./' + this._oeEnvScript + ' ' + this._settingsWorkingFolder + ' > /dev/null') - if (machine !== undefined) { - scriptBitbakeCommand = `MACHINE=${machine} ` + scriptBitbakeCommand + if (fs.existsSync(this._pathToEnvScript)) { + logger.info('using env script') + scriptFileBuffer.push('source ./' + this._pathToEnvScript + ' ' + this._pathToBuildFolder + ' > /dev/null') + } else { + logger.info('not using env script') + scriptFileBuffer.push( + `export PYTHONPATH=${this._pathToBitbakeFolder}/lib:$PYTHONPATH`, + `export PATH=${this._pathToBitbakeFolder}/bin:$PATH`, + `cd ${this.pathToBuildFolder}` + ) } - scriptFileBuffer.push(scriptBitbakeCommand) + scriptFileBuffer.push(bitbakeCommand) return scriptFileBuffer.join('\n') } - - private isBitbakeAvailable (): boolean { - const settingActive: boolean = this._settingsGenerateWorkingFolder - const oeEnvScriptExists: boolean = fs.existsSync(this._oeEnvScript) - let bitbakeAvailable: boolean = false - - if (settingActive && oeEnvScriptExists) { - bitbakeAvailable = true - } - - return bitbakeAvailable - } } diff --git a/server/src/server.ts b/server/src/server.ts index d7922bb0..4dcec777 100644 --- a/server/src/server.ts +++ b/server/src/server.ts @@ -62,11 +62,9 @@ interface Settings { interface BitbakeSettings { loggingLevel: string - deepExamine: boolean - workingFolder: string - pathToBashScriptInterpreter: string - machine: string - generateWorkingFolder: boolean + shouldDeepExamine: boolean + pathToEnvScript: string + pathToBuildFolder: string pathToBitbakeFolder: string } @@ -77,14 +75,11 @@ function setSymbolScanner (newSymbolScanner: SymbolScanner | null): void { connection.onDidChangeConfiguration((change) => { const settings = change.settings as Settings - bitBakeProjectScanner.deepExamine = settings.bitbake.deepExamine + bitBakeProjectScanner.shouldDeepExamine = settings.bitbake.shouldDeepExamine logger.level = settings.bitbake.loggingLevel - bitBakeProjectScanner.workingPath = settings.bitbake.workingFolder - bitBakeProjectScanner.generateWorkingPath = settings.bitbake.generateWorkingFolder - bitBakeProjectScanner.scriptInterpreter = settings.bitbake.pathToBashScriptInterpreter - bitBakeProjectScanner.machineName = settings.bitbake.machine - const bitBakeFolder = settings.bitbake.pathToBitbakeFolder - bitBakeDocScanner.parse(bitBakeFolder) + bitBakeProjectScanner.pathToBuildFolder = settings.bitbake.pathToBuildFolder + bitBakeProjectScanner.pathToBitbakeFolder = settings.bitbake.pathToBitbakeFolder + bitBakeDocScanner.parse(settings.bitbake.pathToBitbakeFolder) }) connection.onDidChangeWatchedFiles((change) => {