Daniel Stephens
Daniel Stephens

Reputation: 3249

Include directive in bazels BUILD file

I am using Bazel and have many BUILD files and would like to auto-generate parts. There are two options.

1) I create a BUILD.template file and replace the corresponding elements in the file and rename it back to BUILD after the generation is done.

.. or ..

2) I use an additional file like BUILD.ext and use an include directive inside the BUILD file which includes that given file. But I can't find any include support.

Any help is highly appreciated!

Upvotes: 0

Views: 160

Answers (1)

immars
immars

Reputation: 166

One possibility is that you can define your templates as bazel macros in .bzl files, and load those macros in your BUILD files.

Upvotes: 1

Related Questions