Skip to content

Commit

Permalink
feat: add public filegroups containing bzl files to allow downstream …
Browse files Browse the repository at this point in the history
…rulesets to generate docs (#443)
  • Loading branch information
mattem authored Mar 29, 2021
1 parent 7aaf762 commit c7e573e
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
17 changes: 17 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,20 @@ filegroup(
],
visibility = ["//distro:__pkg__"],
)

# Reexport of all bzl files used to allow downstream rules to generate docs
# without shipping with a dependency on Skylib
filegroup(
name = "bzl",
srcs = [
"//python/pip_install:bzl",
"//python:bzl",
# Requires Bazel 0.29 onward for public visibility of these .bzl files.
"@bazel_tools//tools/python:private/defs.bzl",
"@bazel_tools//tools/python:python_version.bzl",
"@bazel_tools//tools/python:srcs_version.bzl",
"@bazel_tools//tools/python:toolchain.bzl",
"@bazel_tools//tools/python:utils.bzl",
],
visibility = ["//visibility:public"],
)
14 changes: 14 additions & 0 deletions python/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,20 @@ filegroup(
visibility = ["//:__pkg__"],
)

# Filegroup of bzl files that can be used by downstream rules for documentation generation
# Using a filegroup rather than bzl_library to not give a transitive dependency on Skylib
filegroup(
name = "bzl",
srcs = [
"defs.bzl",
"packaging.bzl",
"pip.bzl",
"whl.bzl",
"private/reexports.bzl",
],
visibility = ["//:__pkg__"],
)

# ========= Core rules =========

exports_files([
Expand Down
9 changes: 9 additions & 0 deletions python/pip_install/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ filegroup(
visibility = ["//:__pkg__"],
)

filegroup(
name = "bzl",
srcs = [
"pip_repository.bzl",
"repositories.bzl",
],
visibility = ["//:__pkg__"],
)

exports_files(
["pip_repository.bzl", "repositories.bzl"],
visibility = ["//docs:__pkg__"],
Expand Down

0 comments on commit c7e573e

Please sign in to comment.