/bazel-example

Primary LanguageTypeScript

Bazel Example

Prerequisites

Install Bazel

Bazel is a build system built by Google.

Follow the instructions on the Bazel site.

Install Buildifier and Bulldozer

  • Buildifier is a bazel formatter.

  • Bulldozer is a command line tool for bazel files.

Create C:\Bazel folder and add it to the system PATH.

Download both latest version of buildifier and buildozer to C:\Bazel folder.

Install Bazel extension for VS Code.

Development

Run every command at the root of the project.

Install dependencies

$ yarn

Build docker

$ docker-compose build

Build all components

$ yarn build

Test all components

$ yarn test

Run individual components

$ npx bazel run //services/feedback

Watch and run individual components

$ npx ibazel run //services/feedback

Clean bazel cache

$ yarn clean

Clean bazel global cache

$ npx bazel clean --expunge

Worth to read

Known issues

  • Bazel on Windows can't build docker images. See #1926. A workaround is to use WSL or to add manual to tags property.

  • Bazel on Windows isn't sandboxed compared to other platforms, so there may be inconsistencies of behaviours. This can be seen how tests for TypeScript are created. Example also see #2939.

Bazel support for protobuff