Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions .generator/parse_googleapis_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,15 @@
"proto_library",
"java_proto_library",
"genrule",
"gapic_yaml_from_disco",
"grpc_service_config_from_disco",
"proto_from_disco",
)

_GLOB_CALLABLES = (
"exports_files",
"glob",
)

def parse_content(content: str) -> dict:
"""Parses content from BUILD.bazel and returns a dictionary
Expand All @@ -119,11 +126,20 @@ def bazel_target(**args):
def noop_bazel_rule(**args):
pass

for noop_callable in _NOOP_CALLABLES:
mod.add_callable(noop_callable, noop_bazel_rule)
def fake_glob(paths=[], **args):
return []

mod.add_callable("package", noop_bazel_rule)

for glob_callable in _GLOB_CALLABLES:
mod.add_callable(glob_callable, fake_glob)

def load(name):
mod = sl.Module()

for noop_callable in _NOOP_CALLABLES:
mod.add_callable(noop_callable, noop_bazel_rule)

for callable_name in _CALLABLE_MAP.get(name, []):
mod.add_callable(callable_name, bazel_target)
return mod.freeze()
Expand Down
1 change: 1 addition & 0 deletions .generator/test-resources/librarian/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

package(default_visibility = ["//visibility:public"])
exports_files(glob(["*.yaml"]))
load("@rules_proto//proto:defs.bzl", "proto_library")
load(
"@com_google_googleapis_imports//:imports.bzl",
Expand Down
Loading