Skip to content

Commit

Permalink
Set up docs
Browse files Browse the repository at this point in the history
  • Loading branch information
fmeum committed May 24, 2024
1 parent 68745c6 commit dc6d1a4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ bzl_library(

exports_files(
["bazel_env.bzl"],
visibility = ["//visibility:public"],
visibility = ["//docs:__pkg__"],
)

exports_files(
Expand Down
5 changes: 2 additions & 3 deletions bazel_env.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ _bazel_env_rule = rule(
executable = True,
)

def bazel_env(name, *, tools = {}, toolchains = {}, tags = [], visibility = ["//visibility:private"]):
def bazel_env(name, *, tools = {}, toolchains = {}, **kwargs):
# type: (string, dict[string, string | Label], dict[string, string | Label]) -> None
tool_targets = []
toolchain_targets = []
Expand Down Expand Up @@ -400,6 +400,5 @@ def bazel_env(name, *, tools = {}, toolchains = {}, tags = [], visibility = ["//
unique_name_tool = unique_name_tool,
tool_targets = tool_targets,
toolchain_targets = toolchain_targets,
tags = tags,
visibility = visibility,
**kwargs,
)
17 changes: 17 additions & 0 deletions docs/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@bazel_skylib//rules:diff_test.bzl", "diff_test")
load("@rules_proto//proto:proto_lang_toolchain.bzl", "proto_lang_toolchain")
load("@stardoc//stardoc:stardoc.bzl", "stardoc")

Expand All @@ -8,6 +9,22 @@ stardoc(
deps = ["//:bazel_env"],
)

diff_test(
name = "bazel_env_test",
failure_message = "Please run:\n bazel run //docs:update",
file1 = "bazel_env.md",
file2 = "//docs-gen:bazel_env.md",
)

sh_binary(
name = "update",
srcs = ["update.sh"],
data = [
":bazel_env",
],
)

# Precompiled proto toolchain for stardoc
proto_lang_toolchain(
name = "protoc_java_toolchain",
command_line = "--java_out=$(OUT)",
Expand Down

0 comments on commit dc6d1a4

Please sign in to comment.