Skip to content

Commit

Permalink
update stardoc
Browse files Browse the repository at this point in the history
  • Loading branch information
keith committed Dec 12, 2024
1 parent 09c60f9 commit 0257fb1
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 5 deletions.
23 changes: 19 additions & 4 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,30 @@ bazel_dep(name = "bazel_skylib", version = "1.3.0")
bazel_dep(name = "platforms", version = "0.0.9")
bazel_dep(name = "rules_cc", version = "0.0.8")

apple_cc_configure = use_extension("//crosstool:setup.bzl", "apple_cc_configure_extension")
use_repo(apple_cc_configure, "local_config_apple_cc", "local_config_apple_cc_toolchains")

register_toolchains("@local_config_apple_cc_toolchains//:all")

bazel_dep(name = "rules_shell", version = "0.3.0", dev_dependency = True)
bazel_dep(
name = "stardoc",
version = "0.6.2",
version = "0.7.2",
dev_dependency = True,
repo_name = "io_bazel_stardoc",
)

apple_cc_configure = use_extension("//crosstool:setup.bzl", "apple_cc_configure_extension")
use_repo(apple_cc_configure, "local_config_apple_cc", "local_config_apple_cc_toolchains")
# TODO: Remove when https://github.com/bazelbuild/stardoc/pull/269 is in a release
bazel_dep(name = "rules_jvm_external", version = "6.6", dev_dependency = True)
bazel_dep(name = "protobuf", version = "29.1", dev_dependency = True)

register_toolchains("@local_config_apple_cc_toolchains//:all")
# bazel_dep(name = "rules_java", version = "8.6.2")

# TODO: Remove override when a protobuf release is available that supports
# Bazel 8
archive_override(
module_name = "protobuf",
integrity = "sha256-YhxaemCfJrKK2is5/vAitBuM4dosZZ2aT01UxfppMJg=",
strip_prefix = "protobuf-bb287be772454d63b411b73d60b1d92daa879f2e",
urls = ["https://github.com/protocolbuffers/protobuf/archive/bb287be772454d63b411b73d60b1d92daa879f2e.zip"],
)
12 changes: 11 additions & 1 deletion doc/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ write_file(
[
stardoc(
name = file + "_doc",
out = file + ".md_",
out = file + ".md_pre",
header_template = file + "_header.vm",
input = "//rules:rules.doc.bzl",
symbol_names = symbols,
Expand All @@ -41,6 +41,16 @@ write_file(
] in _DOC_SRCS.items()
]

[
genrule(
name = "fix_stardoc_" + file,
srcs = [file + ".md_pre"],
outs = [file + ".md_"],
cmd = "sed '/rules.doc.bzl/d' $(SRCS) > $(OUTS)",
)
for file in _DOC_SRCS.keys()
]

[
diff_test(
name = "test_" + file,
Expand Down
3 changes: 3 additions & 0 deletions doc/rules.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ On this page:
## apple_genrule

<pre>

apple_genrule(<a href="#apple_genrule-name">name</a>, <a href="#apple_genrule-srcs">srcs</a>, <a href="#apple_genrule-outs">outs</a>, <a href="#apple_genrule-cmd">cmd</a>, <a href="#apple_genrule-executable">executable</a>, <a href="#apple_genrule-message">message</a>, <a href="#apple_genrule-no_sandbox">no_sandbox</a>, <a href="#apple_genrule-tools">tools</a>)
</pre>

Expand Down Expand Up @@ -83,6 +84,7 @@ NOTE: `DEVELOPER_DIR` and `SDKROOT` are environment variables and *not* make
## toolchain_substitution

<pre>

toolchain_substitution(<a href="#toolchain_substitution-name">name</a>, <a href="#toolchain_substitution-src">src</a>, <a href="#toolchain_substitution-var_name">var_name</a>)
</pre>

Expand Down Expand Up @@ -123,6 +125,7 @@ ios_application(
## universal_binary

<pre>

universal_binary(<a href="#universal_binary-name">name</a>, <a href="#universal_binary-binary">binary</a>)
</pre>

Expand Down

0 comments on commit 0257fb1

Please sign in to comment.