xref: /aosp_15_r20/external/bazelbuild-rules_python/sphinxdocs/private/BUILD.bazel (revision 60517a1edbc8ecf509223e9af94a7adec7d736b8)
1# Copyright 2023 The Bazel Authors. All rights reserved.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#    http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
16load("//python:proto.bzl", "py_proto_library")
17load("//python:py_binary.bzl", "py_binary")
18load("//python:py_library.bzl", "py_library")
19
20package(
21    default_visibility = ["//sphinxdocs:__subpackages__"],
22)
23
24# These are only exported because they're passed as files to the //sphinxdocs
25# macros, and thus must be visible to other packages. They should only be
26# referenced by the //sphinxdocs macros.
27exports_files(
28    [
29        "readthedocs_install.py",
30        "sphinx_build.py",
31        "sphinx_server.py",
32        "sphinx_run_template.sh",
33    ],
34    visibility = ["//visibility:public"],
35)
36
37bzl_library(
38    name = "sphinx_docs_library_macro_bzl",
39    srcs = ["sphinx_docs_library_macro.bzl"],
40    deps = [
41        ":sphinx_docs_library_bzl",
42        "//python/private:util_bzl",
43    ],
44)
45
46bzl_library(
47    name = "sphinx_docs_library_bzl",
48    srcs = ["sphinx_docs_library.bzl"],
49    deps = [":sphinx_docs_library_info_bzl"],
50)
51
52bzl_library(
53    name = "sphinx_docs_library_info_bzl",
54    srcs = ["sphinx_docs_library_info.bzl"],
55)
56
57bzl_library(
58    name = "sphinx_bzl",
59    srcs = ["sphinx.bzl"],
60    deps = [
61        ":sphinx_docs_library_info_bzl",
62        "//python:py_binary_bzl",
63        "@bazel_skylib//:bzl_library",
64        "@bazel_skylib//lib:paths",
65        "@bazel_skylib//lib:types",
66        "@bazel_skylib//rules:build_test",
67        "@bazel_skylib//rules:common_settings",
68        "@io_bazel_stardoc//stardoc:stardoc_lib",
69    ],
70)
71
72bzl_library(
73    name = "sphinx_stardoc_bzl",
74    srcs = ["sphinx_stardoc.bzl"],
75    deps = [
76        ":sphinx_docs_library_macro_bzl",
77        "//python/private:util_bzl",
78        "//sphinxdocs:sphinx_bzl",
79        "@bazel_skylib//:bzl_library",
80        "@bazel_skylib//lib:paths",
81        "@bazel_skylib//lib:types",
82        "@bazel_skylib//rules:build_test",
83        "@io_bazel_stardoc//stardoc:stardoc_lib",
84    ],
85)
86
87bzl_library(
88    name = "readthedocs_bzl",
89    srcs = ["readthedocs.bzl"],
90    deps = ["//python:py_binary_bzl"],
91)
92
93py_binary(
94    name = "inventory_builder",
95    srcs = ["inventory_builder.py"],
96    # Only public because it's an implicit attribute
97    visibility = ["//visibility:public"],
98)
99
100py_binary(
101    name = "proto_to_markdown",
102    srcs = ["proto_to_markdown.py"],
103    # Only public because it's an implicit attribute
104    visibility = ["//visibility:public"],
105    deps = [":proto_to_markdown_lib"],
106)
107
108py_library(
109    name = "proto_to_markdown_lib",
110    srcs = ["proto_to_markdown.py"],
111    # Only public because it's an implicit attribute
112    visibility = ["//visibility:public"],
113    deps = [
114        ":stardoc_output_proto_py_pb2",
115    ],
116)
117
118py_proto_library(
119    name = "stardoc_output_proto_py_pb2",
120    deps = [
121        "@io_bazel_stardoc//stardoc/proto:stardoc_output_proto",
122    ],
123)
124