Bazel plugin

The Bazel plugin can be used with projects that use Bazel.

After a successful build, this plugin copies bazel-bin artifacts into $CRAFT_PART_INSTALL.

Keys

This plugin provides the following unique keys.

bazel-parameters

Type: list of strings

Options to pass to bazel build.

bazel-targets

Type: list of strings

Default: ["//..."]

Targets to pass to bazel build. By default, all targets are built.

Dependencies

The plugin requires Bazel. By default, the plugin installs Bazel through build-packages, via the bazel-bootstrap package.

You can provide your own Bazel installation by adding a part called bazel-deps with the installation path and adding after: [bazel-deps] to the Bazel plugin part. Doing this will cause the plugin to skip the installation of bazel-bootstrap.

The project must also have a BUILD file that defines the targets to be built. This file is a configuration for Bazel that tells it what to build and how.

How