blob: 8ce0ac8169189613589b766bc8d041668d73594f [file] [log] [blame]
Carmelo Cascone81fcfbe2019-03-13 15:54:16 -07001# Prefix string to remove from proto import statements
2IMPORT_PREFIX = "github.com/openconfig/gnmi/proto/"
3
Yi Tsenge671fc92018-10-31 15:34:30 -07004proto_library(
5 name = "gnmi_proto",
Carmelo Cascone81fcfbe2019-03-13 15:54:16 -07006 srcs = [":gnmi_proto_sed"],
Yi Tsenge671fc92018-10-31 15:34:30 -07007 deps = [
8 ":gnmi_ext_proto",
9 "@com_google_protobuf//:descriptor_proto",
10 "@com_google_protobuf//:any_proto",
11 ],
12 visibility = ["//visibility:public"],
13)
14
Yi Tsenge671fc92018-10-31 15:34:30 -070015proto_library(
16 name = "gnmi_ext_proto",
17 srcs = ["gnmi_ext/gnmi_ext.proto"],
18 visibility = ["//visibility:public"],
19)
Carmelo Cascone81fcfbe2019-03-13 15:54:16 -070020
21
22genrule(
23 name = "gnmi_proto_sed",
24 srcs = [":gnmi/gnmi.proto"],
25 outs = ["new/gnmi/gnmi.proto"],
26 cmd = "sed -e 's:import \"%s:import \":g' $(location :gnmi/gnmi.proto) > \"$@\""
27 % IMPORT_PREFIX,
28)