Skip to content

bazel

An example workspace with bazel.

Installation

You'll need the following installed:

Usage

Open this directory in VS Code from the repository root:

code workspaces/bazel

When prompted, reopen the folder in the development container.

Set up your workspace

Run the get_code.sh script to fetch the example source.

./get_code.sh

This clones the Bazel examples repository into src/examples.

See the Bazel C++ tutorial.

Build

Tasks

Go to Terminal → Run Build Task or use the command palette.

Note

The checked-in task definitions currently use ${workspaceRoot}/examples/..., while get_code.sh checks the tutorial out under src/examples. Update each task's working directory to ${workspaceFolder}/src/examples/cpp-tutorial/stageN before using the tasks.

Command line

Follow the Bazel C++ tutorial.

cd src/examples/cpp-tutorial/stage1
bazel build :all