You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
448 B
19 lines
448 B
2 years ago
|
load("@bazel_skylib//rules:write_file.bzl", "write_file")
|
||
|
|
||
|
def json_data(
|
||
|
name,
|
||
|
data,
|
||
|
visibility = ["//visibility:public"],
|
||
|
**kwargs):
|
||
|
"""Write a bazel object to a file
|
||
|
|
||
|
The provided `data` object should be json serializable.
|
||
|
"""
|
||
|
write_file(
|
||
|
name = name,
|
||
|
out = "%s.json" % name,
|
||
|
content = json.encode(data).split("\n"),
|
||
|
visibility = visibility,
|
||
|
**kwargs
|
||
|
)
|