forked from sourcegraph/sourcegraph-public-snapshot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproto.bzl
More file actions
27 lines (23 loc) · 853 Bytes
/
proto.bzl
File metadata and controls
27 lines (23 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""This module contains definitions for dealing with stubs in the source tree.
"""
load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_files")
load("@aspect_bazel_lib//lib:copy_to_directory.bzl", "copy_to_directory")
load("@aspect_bazel_lib//lib:directory_path.bzl", "make_directory_path")
def write_proto_stubs_to_source(name, target, output_files):
native.filegroup(
name = name,
srcs = [target],
output_group = "go_generated_srcs",
)
copy_to_directory(
name = name + "_flattened",
srcs = [name],
root_paths = ["**"],
)
write_source_files(
name = "write_" + name,
files = {
output_file: make_directory_path(output_file + "_directory_path", name + "_flattened", output_file)
for output_file in output_files
},
)