Skip to content

Commit 674f689

Browse files
authored
chore: don't compile protoc under docs/ either (#2156)
* chore: don't compile protoc under docs/ either * buildifier lint
1 parent aece0a3 commit 674f689

File tree

4 files changed

+24
-1
lines changed

4 files changed

+24
-1
lines changed

docs/.bazelrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Never Compile protoc Again
2+
# Don't build protoc from the cc_binary, it's slow and spammy when cache miss
3+
common --per_file_copt=external/.*protobuf.*@--PROTOBUF_WAS_NOT_SUPPOSED_TO_BE_BUILT
4+
common --host_per_file_copt=external/.*protobuf.*@--PROTOBUF_WAS_NOT_SUPPOSED_TO_BE_BUILT
5+
common --java_runtime_version=remotejdk_11

docs/MODULE.bazel

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,12 @@ local_path_override(
66
module_name = "aspect_rules_js",
77
path = "..",
88
)
9+
10+
http_jar = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_jar")
11+
12+
http_jar(
13+
name = "stardoc-prebuilt",
14+
integrity = "sha256-jDi5ITmziwwiHCsfd8v0UOoraWXIAfICIll+wbpg/vE=",
15+
# NB: version matches the stardoc load above
16+
urls = ["https://github.com/alexeagle/stardoc-prebuilt/releases/download/v0.6.2/renderer_deploy.jar"],
17+
)

docs/docs.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def stardoc_with_diff_test(name, **kwargs):
1010
Wrapper around stardoc_with_diff_test that only runs the test if Bazel 7 or greater is being used.
1111
"""
1212
if is_bazel_7_or_greater():
13-
_stardoc_with_diff_test(name, **kwargs)
13+
_stardoc_with_diff_test(name, renderer = "//tools:stardoc_renderer", **kwargs)
1414
else:
1515
# buildifier: disable=print
1616
print("WARNING: Skipping stardoc_with_diff_test for %s because it requires Bazel 7 or greater" % name)

docs/tools/BUILD.bazel

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
load("@rules_java//java:java_binary.bzl", "java_binary")
2+
3+
package(default_visibility = ["//visibility:public"])
4+
5+
java_binary(
6+
name = "stardoc_renderer",
7+
main_class = "com/google/devtools/build/stardoc/renderer/RendererMain",
8+
runtime_deps = ["@stardoc-prebuilt//jar"],
9+
)

0 commit comments

Comments
 (0)