-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathBUILD.bazel
More file actions
118 lines (104 loc) · 2.93 KB
/
Copy pathBUILD.bazel
File metadata and controls
118 lines (104 loc) · 2.93 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
load("@bazel_gazelle//:def.bzl", "gazelle", "gazelle_binary")
load("@buildifier_prebuilt//:rules.bzl", "buildifier")
load("@mkdocs//:defs.bzl", "mkdocs_build", "mkdocs_config", "mkdocs_serve")
load("@package_metadata//licenses/rules:license.bzl", "license")
load("@package_metadata//purl:purl.bzl", "purl")
load("@package_metadata//rules:package_metadata.bzl", "package_metadata")
load("@rules_python//python:pip.bzl", "compile_pip_requirements")
load("//docgen:defs.bzl", "docs", "docs_index", "git_last_updated_timestamps", "markdown_add_last_updated")
compile_pip_requirements(
name = "requirements",
src = "requirements.in",
requirements_txt = "requirements.txt",
)
buildifier(
name = "buildifier.fix",
exclude_patterns = ["./.git/*"],
lint_mode = "warn",
mode = "fix",
)
alias(
name = "format",
actual = ":buildifier.fix",
)
package_metadata(
name = "package_metadata",
purl = purl.bazel(
module_name(),
module_version(),
),
visibility = ["//visibility:public"],
)
license(
name = "license",
kind = "@package_metadata//licenses/spdx:Apache-2.0",
text = "LICENSE",
)
# gazelle:map_kind bzl_library bzl_library @bazel_lib//:bzl_library.bzl
gazelle_binary(
name = "gazelle_bin",
languages = ["@bazel_skylib_gazelle_plugin//bzl"],
)
gazelle(
name = "gazelle",
gazelle = "gazelle_bin",
)
git_last_updated_timestamps(
name = "git_last_updated_timestamps",
srcs = glob(
[".git/**"],
allow_empty = True,
),
out = "last_updated.json",
)
docs_index(
name = "examples_docs_index",
srcs = [
"@rules_docs_e2e_git_last_updated//:docs",
"@rules_docs_e2e_smoke//:docs",
"@rules_docs_examples_swagger//:docs",
"@rules_docs_examples_typescript//:index",
],
nav = {
"@rules_docs_e2e_smoke//:docs": "e2e/smoke",
"@rules_docs_e2e_git_last_updated//:docs": "e2e/git_last_updated",
"@rules_docs_examples_swagger//:docs": "examples/swagger",
"@rules_docs_examples_typescript//:index": "examples/typescript",
},
title = "examples",
)
docs(
name = "docs",
srcs = [
"requirements.txt",
":examples_docs_index",
"//docgen:docs",
],
nav = {
"README.md": "README",
"//docgen:docs": "rules",
":examples_docs_index": "examples",
},
)
markdown_add_last_updated(
name = "docs_last_updated",
docs = ":docs",
last_updated_json = ":git_last_updated_timestamps",
out_dir = "last_updated_docs",
)
mkdocs_config(
name = "mkdocs_config",
docs = ":docs_last_updated",
mkdocs_base = "mkdocs.tpl.yaml",
)
mkdocs_build(
name = "mkdocs",
config = ":mkdocs_config",
docs = [":docs_last_updated"],
)
# Serve the docs locally for development. Recommended to run with ibazel to auto-reload on changes.
mkdocs_serve(
name = "mkdocs.serve",
config = ":mkdocs_config",
docs = [":docs_last_updated"],
)