blob: c9dd1c34966acf4872bc3d9cd0c0125868248769 [file] [log] [blame]
oleksandr.yashchuk@plvision.eu3dbcaaf2019-03-13 14:44:46 +02001# Prefix string to remove from proto import statements
2IMPORT_PREFIX_COMMON = "github.com/openconfig/gnoi/common/"
3IMPORT_PREFIX = "github.com/openconfig/gnoi/"
4
5proto_library(
6 name = "gnoi_system_proto",
7 srcs = [":gnoi_system_sed"],
8 deps = [
9 ":gnoi_types_proto",
10 ":gnoi_common_proto",
11 "@com_google_protobuf//:any_proto",
12 ],
13 visibility = ["//visibility:public"],
14)
15
16proto_library(
17 name = "gnoi_types_proto",
18 srcs = ["types/types.proto"],
19 deps = [
20 "@com_google_protobuf//:descriptor_proto",
21 "@com_google_protobuf//:any_proto",
22 ],
23 visibility = ["//visibility:public"],
24)
25
26proto_library(
27 name = "gnoi_common_proto",
28 srcs = [":gnoi_common_sed"],
29 deps = [":gnoi_types_proto"],
30 visibility = ["//visibility:public"],
31)
32
33genrule(
34 name = "gnoi_common_sed",
35 srcs = ["common/common.proto"],
36 outs = ["common.proto"],
37 cmd = "sed -e 's:import \"%s:import \":g' $(location common/common.proto) > \"$@\""
38 % IMPORT_PREFIX,
39)
40
41genrule(
42 name = "gnoi_system_sed",
43 srcs = ["system/system.proto"],
44 outs = ["system.proto"],
45 cmd = "sed -e 's:import \"%s:import \":g' -e 's:import \"%s:import \":g' $(location system/system.proto) > \"$@\""
46 % (IMPORT_PREFIX_COMMON, IMPORT_PREFIX),
47)