-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: introduce strict bzlmod by adding
WORKSPACE.bzlmod
(#238)
- Add `WORKSPACE.bzlmod` to all workspaces to ensure that the strict bzlmod support was enabled. - Disable all documentation generation and tests until bazelbuild/bazel#14140 is fixed. - Update CI to execute tidy and test with and without bzlmod. - Fix warning in `sorted_genquery.bzl`. Related to #195.
- Loading branch information
Showing
22 changed files
with
828 additions
and
726 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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# workspace(name = "cgrindel_bazel_starlib") | ||
|
||
# MARK: - Integration Testing | ||
|
||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
|
||
http_archive( | ||
name = "contrib_rules_bazel_integration_test", | ||
sha256 = "6263b8d85a125e1877c463bf4d692bebc2b6479c924f64a3d45c81fbfbc495df", | ||
strip_prefix = "rules_bazel_integration_test-0.10.3", | ||
urls = [ | ||
"http://github.com/bazel-contrib/rules_bazel_integration_test/archive/v0.10.3.tar.gz", | ||
], | ||
) | ||
|
||
load("@contrib_rules_bazel_integration_test//bazel_integration_test:deps.bzl", "bazel_integration_test_rules_dependencies") | ||
|
||
bazel_integration_test_rules_dependencies() | ||
|
||
load("@contrib_rules_bazel_integration_test//bazel_integration_test:defs.bzl", "bazel_binaries") | ||
load("//:bazel_versions.bzl", "SUPPORTED_BAZEL_VERSIONS") | ||
|
||
bazel_binaries(versions = SUPPORTED_BAZEL_VERSIONS) |
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,115 +1,117 @@ | ||
load( | ||
"//bazeldoc:defs.bzl", | ||
"doc_for_provs", | ||
"write_file_list", | ||
"write_header", | ||
doc_providers = "providers", | ||
) | ||
load("//bzlformat:defs.bzl", "bzlformat_pkg") | ||
|
||
bzlformat_pkg(name = "bzlformat") | ||
|
||
filegroup( | ||
name = "doc_files", | ||
srcs = glob(["*.md"]) + [ | ||
# A doc file has a reference to this file. | ||
"BUILD.bazel", | ||
], | ||
visibility = ["//:markdown_test_visibility"], | ||
) | ||
|
||
# Lovingly inspired by | ||
# https://github.com/bazelbuild/rules_swift/blob/021c11b1d578ffba547140eb24854cdfe74c794f/doc/BUILD.bazel#L3 | ||
|
||
# MARK: - Documentation Declarations | ||
|
||
_API_SRCS = [ | ||
"doc_utilities", | ||
"providers", | ||
] | ||
|
||
_STARDOC_INPUT = "//bazeldoc:defs.bzl" | ||
|
||
_DOC_DEPS = [ | ||
"//bazeldoc:defs", | ||
] | ||
|
||
_API_DOC_PROVIDERS = [ | ||
doc_providers.create( | ||
name = name, | ||
stardoc_input = _STARDOC_INPUT, | ||
symbols = [name], | ||
deps = _DOC_DEPS, | ||
) | ||
for name in _API_SRCS | ||
] | ||
|
||
_BUILD_RULES_PROV = doc_providers.create( | ||
name = "build_rules_overview", | ||
stardoc_input = _STARDOC_INPUT, | ||
symbols = [ | ||
"doc_for_provs", | ||
"stardoc_for_prov", | ||
"stardoc_for_provs", | ||
"write_doc", | ||
"write_file_list", | ||
"write_header", | ||
], | ||
deps = _DOC_DEPS, | ||
) | ||
|
||
_ALL_DOC_PROVIDERS = [ | ||
_BUILD_RULES_PROV, | ||
doc_providers.create( | ||
name = "api", | ||
is_stardoc = False, | ||
stardoc_input = _STARDOC_INPUT, | ||
deps = _DOC_DEPS, | ||
), | ||
] + _API_DOC_PROVIDERS | ||
|
||
# MARK: - Special Case api.md | ||
|
||
write_file_list( | ||
name = "api_doc", | ||
out = "api.md_", | ||
doc_provs = _API_DOC_PROVIDERS, | ||
header_content = [ | ||
"# Documentation API", | ||
"", | ||
"The APIs described below are used by ", | ||
"[the build rules](build_rules_overview.md) to facilitate the ", | ||
"generation of the Starlark documentation.", | ||
"", | ||
], | ||
) | ||
|
||
# MARK: - Headers | ||
|
||
write_header( | ||
name = "build_rules_overview_header", | ||
header_content = [ | ||
"# Build Rules", | ||
"", | ||
"The macros described below are used to generate, test and copy ", | ||
"Starlark documentation.", | ||
], | ||
symbols = _BUILD_RULES_PROV.symbols, | ||
) | ||
|
||
# Write the API headers | ||
[ | ||
write_header( | ||
name = doc_prov.header_label, | ||
out = doc_prov.header_basename, | ||
header_content = [ | ||
"# `{name}` API".format(name = doc_prov.name), | ||
], | ||
) | ||
for doc_prov in _API_DOC_PROVIDERS | ||
if doc_prov.is_stardoc | ||
] | ||
|
||
doc_for_provs( | ||
doc_provs = _ALL_DOC_PROVIDERS, | ||
) | ||
# GH195: Enable once stardoc supports repo mapping. | ||
|
||
# load( | ||
# "//bazeldoc:defs.bzl", | ||
# "doc_for_provs", | ||
# "write_file_list", | ||
# "write_header", | ||
# doc_providers = "providers", | ||
# ) | ||
# load("//bzlformat:defs.bzl", "bzlformat_pkg") | ||
|
||
# bzlformat_pkg(name = "bzlformat") | ||
|
||
# filegroup( | ||
# name = "doc_files", | ||
# srcs = glob(["*.md"]) + [ | ||
# # A doc file has a reference to this file. | ||
# "BUILD.bazel", | ||
# ], | ||
# visibility = ["//:markdown_test_visibility"], | ||
# ) | ||
|
||
# # Lovingly inspired by | ||
# # https://github.com/bazelbuild/rules_swift/blob/021c11b1d578ffba547140eb24854cdfe74c794f/doc/BUILD.bazel#L3 | ||
|
||
# # MARK: - Documentation Declarations | ||
|
||
# _API_SRCS = [ | ||
# "doc_utilities", | ||
# "providers", | ||
# ] | ||
|
||
# _STARDOC_INPUT = "//bazeldoc:defs.bzl" | ||
|
||
# _DOC_DEPS = [ | ||
# "//bazeldoc:defs", | ||
# ] | ||
|
||
# _API_DOC_PROVIDERS = [ | ||
# doc_providers.create( | ||
# name = name, | ||
# stardoc_input = _STARDOC_INPUT, | ||
# symbols = [name], | ||
# deps = _DOC_DEPS, | ||
# ) | ||
# for name in _API_SRCS | ||
# ] | ||
|
||
# _BUILD_RULES_PROV = doc_providers.create( | ||
# name = "build_rules_overview", | ||
# stardoc_input = _STARDOC_INPUT, | ||
# symbols = [ | ||
# "doc_for_provs", | ||
# "stardoc_for_prov", | ||
# "stardoc_for_provs", | ||
# "write_doc", | ||
# "write_file_list", | ||
# "write_header", | ||
# ], | ||
# deps = _DOC_DEPS, | ||
# ) | ||
|
||
# _ALL_DOC_PROVIDERS = [ | ||
# _BUILD_RULES_PROV, | ||
# doc_providers.create( | ||
# name = "api", | ||
# is_stardoc = False, | ||
# stardoc_input = _STARDOC_INPUT, | ||
# deps = _DOC_DEPS, | ||
# ), | ||
# ] + _API_DOC_PROVIDERS | ||
|
||
# # MARK: - Special Case api.md | ||
|
||
# write_file_list( | ||
# name = "api_doc", | ||
# out = "api.md_", | ||
# doc_provs = _API_DOC_PROVIDERS, | ||
# header_content = [ | ||
# "# Documentation API", | ||
# "", | ||
# "The APIs described below are used by ", | ||
# "[the build rules](build_rules_overview.md) to facilitate the ", | ||
# "generation of the Starlark documentation.", | ||
# "", | ||
# ], | ||
# ) | ||
|
||
# # MARK: - Headers | ||
|
||
# write_header( | ||
# name = "build_rules_overview_header", | ||
# header_content = [ | ||
# "# Build Rules", | ||
# "", | ||
# "The macros described below are used to generate, test and copy ", | ||
# "Starlark documentation.", | ||
# ], | ||
# symbols = _BUILD_RULES_PROV.symbols, | ||
# ) | ||
|
||
# # Write the API headers | ||
# [ | ||
# write_header( | ||
# name = doc_prov.header_label, | ||
# out = doc_prov.header_basename, | ||
# header_content = [ | ||
# "# `{name}` API".format(name = doc_prov.name), | ||
# ], | ||
# ) | ||
# for doc_prov in _API_DOC_PROVIDERS | ||
# if doc_prov.is_stardoc | ||
# ] | ||
|
||
# doc_for_provs( | ||
# doc_provs = _ALL_DOC_PROVIDERS, | ||
# ) |
Oops, something went wrong.