Carmelo Cascone | 81fcfbe | 2019-03-13 15:54:16 -0700 | [diff] [blame] | 1 | # Prefix string to remove from proto import statements |
| 2 | IMPORT_PREFIX = "github.com/openconfig/gnmi/proto/" |
| 3 | |
Yi Tseng | e671fc9 | 2018-10-31 15:34:30 -0700 | [diff] [blame] | 4 | proto_library( |
| 5 | name = "gnmi_proto", |
Carmelo Cascone | 81fcfbe | 2019-03-13 15:54:16 -0700 | [diff] [blame] | 6 | srcs = [":gnmi_proto_sed"], |
Yi Tseng | e671fc9 | 2018-10-31 15:34:30 -0700 | [diff] [blame] | 7 | 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 Tseng | e671fc9 | 2018-10-31 15:34:30 -0700 | [diff] [blame] | 15 | proto_library( |
| 16 | name = "gnmi_ext_proto", |
| 17 | srcs = ["gnmi_ext/gnmi_ext.proto"], |
| 18 | visibility = ["//visibility:public"], |
| 19 | ) |
Carmelo Cascone | 81fcfbe | 2019-03-13 15:54:16 -0700 | [diff] [blame] | 20 | |
| 21 | |
| 22 | genrule( |
| 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 | ) |