Add BazelizeElement
This plugin facilitates the limited integration of buildstream artifacts into bazel projects. It serves as tooling providing bazel BUILD metadata (specifying buildstream artifacts) as part of the buildstream build output.
The intended use is as the kind of a dummy element with a build-depends field declaring elements required by a bazel project. The execution of the buildstream build action will produce a single BUILD file specifying the consumption of the relevant artifacts of those dependencies. In this way the artifacts will be immediately useful to a bazel project without additional development effort.
Elements of this kind permit the following configurations:
- 'buildfile-dir': the absolute path in the sandbox of the output
- 'copts': a sequence of strings to pass to the
coptsrule argument - 'bazel-rule': the bazel rule to write for this element
- 'BST.BAZEL_NONE_RULE' is a reserved rule which specifies the "empty" rule. Elements with this rule value will not appear in the output.
- the default rule for elements in the tree not of this kind or otherwise not specifying the rule will be 'cc_library'
As an example:
kind: bazelize
depends:
- foo
config:
buildfile-dir: /
copts: []
bazel-rule: "BST.BAZEL_NONE_RULE"
will produce:
cc_library(
name = "foo",
srcs = [],
hdrs = [],
deps = []
)
Edited by Darius Makovsky