Skip to content

Latest commit

 

History

History
128 lines (93 loc) · 6.18 KB

README-DEVELOPER.md

File metadata and controls

128 lines (93 loc) · 6.18 KB

BitBake recipe language support plugin for Visual Studio Code

vscode-bitbake CI/CD

For a description of the extension itself, please see the README.

It is also possible to use some features of the language server on other editors (Vim, ...). Follow the server's README.

The changelog for the extension can be found here.

To install this extension from the VS Code Extension Marketplace, please follow this guide. For more information regarding the Extension Marketplace, please see the official documentation.

Manual installation

Once compiled, the extension can either be launched in VS Code's debug mode or built into a VSIX file and installed.

Compile

  1. Install the dependencies:
npm install
npm run fetch:wasm # Download and build Wasm dependencies
npm run fetch:docs # Download Yocto's doc. Required for hints on hover
  1. Compile the Typescript files:
npm run compile

Debug

Press F5 or navigate to the debug section on the left of the VS Code and select the client or server to to launch the debug client.

Install

  1. Build the VSIX file:
npm run package
  1. Install the VSIX file. See VS Code's documentation.

Clean up

This deletes the Wasm files, the Yocto's doc, Poky, node_modules, and the compiled files:

npm run clean

Testing

To run all the tests:

  1. See compilation steps.
  2. Fetch Poky (required for the integration tests):
npm run fetch:poky
  1. Run all the tests:
# Note the integration tests require 'npm run compile' to be executed every time the Typescript files are modified.
npm test

All the tests mentionned are run in our GitHub CI.

Linter tests

One can check coding style using

npm run lint

Install the recommended extensions to automatically fix linting errors when possible.

Unit tests

Unit tests are powered by Jest. They allow mocking the behavior of VSCode and other external libraries. They can individually be run with:

npm run jest

Unit tests are defined in the __tests__ folders.

If you have installed the recommended extensions, you'll find launch and debug tasks for the unit tests in the debug section of VSCode.

Grammar tests

See the individual grammar tests README.

Integration tests

These tests allow running the BitBake extension in a live VSCode environment. See the individual integration tests README.

Tree-sitter

This extension uses tree-sitter-bitbake and tree-sitter-bash to parse the BitBake documents. They are installed with npm run fetch:wasm. The versions of tree-sitter-bitbake and tree-sitter-bash are documented in server/tree-sitter-bitbake.info and server/tree-sitter-bash.info respectively, along with the versions of the tree-sitter-cli that have to be used.

To update the .info files with the latest versions of tree-sitter-bitbake and tree-sitter-bash, it is recommended to use the scripts scripts/update-tree-sitter-bitbake.sh and scripts/update-tree-sitter-bash.sh. The GitHub workflow update-tree-sitter-parser-info-file.yml is already responsible for doing it automatically.

After updating the .info files, it is required to call npm run fetch:wasm in order to rebuild the Wasm files.

For more information about the tree-sitter and its CLI, Check out the official site and npm page

Publishing

Publishing is automated via GitHub Actions and reserved to project maintainers. To publish a new version:

  • Update all the package.json files with the new version number X.Y.Z.
  • Document new changes in the client/CHANGELOG.md file.
  • Make sure the VSCE_PAT secret is valid in the GitHub repository settings.
  • Make sure the NODE_AUTH_TOKEN secret is valid in the GitHub repository settings.
  • Update the main branch with the latest staging branch.
  • Create a new release on GitHub with a tag in the format vX.Y.Z.
  • Admin approval is required to run the GitHub Action.

The release will be published to the VS Code Marketplace automatically by the GitHub Action. Admin approval is required to run the GitHub Action, and the VSCE_PAT must be updated to match a valid token for the yocto-project Azure DevOps publisher. See:

Contributing

Development of this extension happens on GitHub. Issues and pull requests are welcome.

Acknowledgements