9
9
Definition of ProtoInfo provider.
10
10
"""
11
11
12
- _warning = """ Don't use this field. It's intended for internal use and will be changed or removed
13
- without warning."""
14
-
15
12
def _uniq (iterable ):
16
13
unique_elements = {element : None for element in iterable }
17
14
return list (unique_elements .keys ())
@@ -74,12 +71,6 @@ def _create_proto_info(*, srcs, deps, descriptor_set, proto_path = "", workspace
74
71
if not bin_dir :
75
72
fail ("bin_dir parameter should be set when _virtual_imports are used" )
76
73
77
- direct_proto_sources = srcs
78
- transitive_proto_sources = depset (
79
- direct = direct_proto_sources ,
80
- transitive = [dep ._transitive_proto_sources for dep in deps ],
81
- order = "preorder" ,
82
- )
83
74
transitive_sources = depset (
84
75
direct = srcs ,
85
76
transitive = [dep .transitive_sources for dep in deps ],
@@ -104,12 +95,6 @@ def _create_proto_info(*, srcs, deps, descriptor_set, proto_path = "", workspace
104
95
transitive = [dep .transitive_descriptor_sets for dep in deps ],
105
96
)
106
97
107
- # Layering checks.
108
- if srcs :
109
- exported_sources = depset (direct = direct_proto_sources )
110
- else :
111
- exported_sources = depset (transitive = [dep ._exported_sources for dep in deps ])
112
-
113
98
if "_virtual_imports/" in proto_path :
114
99
#TODO: remove bin_dir from proto_source_root (when users assuming it's there are migrated)
115
100
proto_source_root = _empty_to_dot (_from_root (bin_dir , workspace_root , proto_path ))
@@ -127,9 +112,6 @@ def _create_proto_info(*, srcs, deps, descriptor_set, proto_path = "", workspace
127
112
transitive_proto_path = transitive_proto_path ,
128
113
check_deps_sources = check_deps_sources ,
129
114
transitive_imports = transitive_sources ,
130
- _direct_proto_sources = direct_proto_sources ,
131
- _transitive_proto_sources = transitive_proto_sources ,
132
- _exported_sources = exported_sources ,
133
115
)
134
116
if allow_exports :
135
117
proto_info ["allow_exports" ] = allow_exports
@@ -173,14 +155,6 @@ ProtoInfo, _ = provider(
173
155
174
156
# Deprecated fields:
175
157
"transitive_imports" : """(depset[File]) Deprecated: use `transitive_sources` instead.""" ,
176
-
177
- # Internal fields:
178
- "_direct_proto_sources" : """(list[File]) The `ProtoSourceInfo`s from the `srcs`
179
- attribute.""" + _warning ,
180
- "_transitive_proto_sources" : """(depset[File]) The `ProtoSourceInfo`s from this
181
- rule and all its dependent protocol buffer rules.""" + _warning ,
182
- "_exported_sources" : """(depset[File]) A set of `ProtoSourceInfo`s that may be
183
- imported by another `proto_library` depending on this one.""" + _warning ,
184
158
},
185
159
init = _create_proto_info ,
186
160
)
0 commit comments