generated from bazel-contrib/rules-template
-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
110ce47
commit 11cc5e0
Showing
22 changed files
with
269 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
# This file contains Bazel settings to apply on CI only. | ||
# It is referenced with a --bazelrc option in the call to bazel in ci.yaml | ||
# Directories caches by GitHub actions | ||
common --disk_cache=~/.cache/bazel-disk-cache | ||
common --repository_cache=~/.cache/bazel-repository-cache | ||
|
||
# Bazel version specific settings | ||
common:bazel6 --build_tag_filters=-skip-on-bazel6 | ||
common:bazel6 --test_tag_filters=-skip-on-bazel6 | ||
common:bazel7 --build_tag_filters=-skip-on-bazel7 | ||
common:bazel7 --test_tag_filters=-skip-on-bazel7 | ||
|
||
# Debug where options came from | ||
build --announce_rc | ||
# This directory is configured in GitHub actions to be persisted between runs. | ||
build --disk_cache=~/.cache/bazel | ||
build --repository_cache=~/.cache/bazel-repo | ||
# Don't rely on test logs being easily accessible from the test runner, | ||
# though it makes the log noisier. | ||
test --test_output=errors | ||
# Allows tests to run bazelisk-in-bazel, since this is the cache folder used | ||
test --test_env=XDG_CACHE_HOME | ||
|
||
# Required by rules_js | ||
build --enable_runfiles | ||
build --enable_runfiles |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
"Fork of aspect_bazel_lib stardoc_with_diff_test" | ||
|
||
load("@io_bazel_stardoc//stardoc:stardoc.bzl", _stardoc = "stardoc") | ||
|
||
# Fork of stardoc_with_diff_test that allows for additional tags | ||
# TODO: upstream this to aspect_bazel_lib | ||
def stardoc_with_diff_test( | ||
name, | ||
bzl_library_target, | ||
**kwargs): | ||
"""Creates a stardoc target that can be auto-detected by update_docs to write the generated doc to the source tree and test that it's up to date. | ||
This is helpful for minimizing boilerplate in repos wih lots of stardoc targets. | ||
Args: | ||
name: the name of the stardoc file to be written to the current source directory (.md will be appended to the name). Call bazel run on this target to update the file. | ||
bzl_library_target: the label of the `bzl_library` target to generate documentation for | ||
**kwargs: additional attributes passed to the stardoc() rule, such as for overriding the templates | ||
""" | ||
|
||
target_compatible_with = kwargs.pop("target_compatible_with", select({ | ||
# stardoc produces different line endings on Windows | ||
# which makes the diff_test fail | ||
"@platforms//os:windows": ["@platforms//:incompatible"], | ||
"//conditions:default": [], | ||
})) | ||
|
||
# Generate MD from .bzl | ||
_stardoc( | ||
name = name, | ||
out = name + "-docgen.md", | ||
input = bzl_library_target + ".bzl", | ||
deps = [bzl_library_target], | ||
tags = kwargs.pop("tags", []) + ["package:" + native.package_name()], # Tag the package name which will help us reconstruct the write_source_files label in update_docs | ||
target_compatible_with = target_compatible_with, | ||
**kwargs | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Disable lockfile for now. It is unstable. | ||
# https://github.com/bazelbuild/bazel/issues/19026 | ||
# https://github.com/bazelbuild/bazel/issues/19621 | ||
# https://github.com/bazelbuild/bazel/issues/19971 | ||
# https://github.com/bazelbuild/bazel/issues/20272 | ||
# https://github.com/bazelbuild/bazel/issues/20369 | ||
common --lockfile_mode=off |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../.bazelversion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../.bazelversion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.