-
Notifications
You must be signed in to change notification settings - Fork 691
/
Copy pathBUILD
41 lines (36 loc) · 996 Bytes
/
BUILD
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
load("@bazel_skylib//rules:write_file.bzl", "write_file")
load("@bazel_skylib//rules:diff_test.bzl", "diff_test")
load("@io_bazel_stardoc//stardoc:stardoc.bzl", "stardoc")
# Workaround https://github.com/bazelbuild/stardoc/issues/25
write_file(
name = "gen_header",
out = "header.vm",
content = ["${moduleDocstring}"],
)
stardoc(
name = "container_doc",
out = "container.md_",
header_template = ":header.vm",
input = "//container:container.docs.bzl",
deps = ["//container:container.docs"],
)
# If these fail, run `bazel run //docs:update`
diff_test(
name = "check_container",
file1 = "container.md",
file2 = ":container_doc",
)
write_file(
name = "gen_update",
out = "gen_update.sh",
content = [
"#!/usr/bin/env bash",
"cd $BUILD_WORKSPACE_DIRECTORY",
"cp -fv bazel-bin/docs/container.md_ docs/container.md",
],
)
sh_binary(
name = "update",
srcs = [":gen_update"],
data = [":container_doc"],
)