@@ -138,85 +138,80 @@ bazel_dep(name = "build_stack_rules_proto", version = "0.0.0")
138138# -------------------------------------------------------------------
139139
140140proto_repository = use_extension(" @build_stack_rules_proto//extensions:proto_repository.bzl" , " proto_repository" , dev_dependency = True )
141+ proto_repository.archive(
142+ name = " protobufapis" ,
143+ build_directives = [
144+ " gazelle:exclude testdata" ,
145+ " gazelle:exclude google/protobuf/compiler/ruby" ,
146+ " gazelle:exclude google/protobuf/bridge" ,
147+ " gazelle:exclude google/protobuf/util/internal/testdata" ,
148+ " gazelle:proto_language go enable true" ,
149+ ],
150+ build_file_proto_mode = " file" ,
151+ build_file_generation = " clean" ,
152+ cfgs = [" @//:rules_proto_config.yaml" ],
153+ deleted_files = [
154+ " google/protobuf/*test*.proto" ,
155+ " google/protobuf/*unittest*.proto" ,
156+ " google/protobuf/late*.proto" ,
157+ " google/protobuf/sample*.proto" ,
158+ " google/protobuf/cpp_features.proto" ,
159+ " google/protobuf/internal_options.proto" ,
160+ " google/protobuf/compiler/cpp/*test*.proto" ,
161+ " google/protobuf/util/*test*.proto" ,
162+ " google/protobuf/util/*unittest*.proto" ,
163+ " google/protobuf/util/json_format*.proto" ,
164+ ],
165+ sha256 = " bb1fd58473c47c747a3f00fc45ced1d562bba4bf645db07cc889fe86dee279ca" ,
166+ strip_prefix = " protobuf-4fbd1111a292d04746c732573025e3251de0bb9c/src" ,
167+ urls = [" https://github.com/protocolbuffers/protobuf/archive/4fbd1111a292d04746c732573025e3251de0bb9c.tar.gz" ],
168+ )
141169proto_repository.archive(
142170 name = " googleapis" ,
171+ build_file_generation = " clean" ,
143172 build_directives = [
144- " gazelle:proto_go_modules_target_dir ROOT" ,
145- " gazelle:exclude google/example" ,
173+ " gazelle:exclude google/ads/googleads/v19/services" ,
174+ " gazelle:exclude google/ads/googleads/v20/services" ,
175+ " gazelle:exclude google/ads/googleads/v21/services" ,
146176 " gazelle:exclude google/ads/googleads/v7/services" ,
147177 " gazelle:exclude google/ads/googleads/v8/services" ,
148- " gazelle:proto_language go enabled true" ,
178+ " gazelle:exclude google/cloud/recommendationengine/v1beta1" ,
179+ " gazelle:exclude google/devtools/containeranalysis/v1beta1" ,
180+ " gazelle:exclude google/example" ,
181+ " gazelle:exclude google/maps/weather/v1" ,
182+ " gazelle:proto_go_modules_enabled true" ,
183+ " gazelle:proto_language go enable true" ,
149184 ],
150- build_file_generation = " clean" ,
151185 build_file_proto_mode = " file" ,
152186 cfgs = [" //:rules_proto_config.yaml" ],
153- imports = [" @protoapis //:imports.csv" ],
187+ imports = [" @protobufapis //:imports.csv" ],
154188 reresolve_known_proto_imports = True ,
155- sha256 = " 95da12951c7d570980d5152f6cca9e1cb795ddc6b6dd7e9423bdffde28290f7a" ,
156- strip_prefix = " googleapis-02710fa0ea5312d79d7fb986c9c9823fb41049a9" ,
157- type = " zip" ,
158- urls = [
159- " https://codeload.github.com/googleapis/googleapis/zip/02710fa0ea5312d79d7fb986c9c9823fb41049a9" ,
160- ],
189+ sha256 = " b1f729e116312e1bed9a6c0b812e8d6071755dcf93ff4f665c07bbf517dd61a6" ,
190+ strip_prefix = " googleapis-60e1300d4a0b60b85b3df167ddc4062ac7cc4f44" ,
191+ urls = [" https://github.com/googleapis/googleapis/archive/60e1300d4a0b60b85b3df167ddc4062ac7cc4f44.tar.gz" ],
161192)
162193proto_repository.archive(
163194 name = " remoteapis" ,
164195 build_directives = [
165- " gazelle:proto_go_modules_target_dir ROOT" ,
166196 " gazelle:exclude third_party" ,
167- " gazelle:exclude build/bazel/remote/asset/v1" ,
168- " gazelle:exclude build/bazel/remote/logstream/v1" ,
197+ " gazelle:proto_go_modules_enabled true" ,
169198 " gazelle:proto_language go enable true" ,
170- " gazelle:proto_plugin protoc-gen-go option Mbuild/bazel/remote/execution/v2/remote_execution.proto=github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" ,
171- " gazelle:proto_plugin protoc-gen-go option Mbuild/bazel/semver/semver.proto=github.com/bazelbuild/remote-apis/build/bazel/semver" ,
172- " gazelle:proto_plugin protoc-gen-go-grpc option Mbuild/bazel/remote/execution/v2/remote_execution.proto=github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" ,
173- " gazelle:proto_plugin protoc-gen-go-grpc option Mbuild/bazel/semver/semver.proto=github.com/bazelbuild/remote-apis/build/bazel/semver" ,
174199 ],
175200 build_file_generation = " clean" ,
176201 build_file_proto_mode = " file" ,
177202 cfgs = [" //:rules_proto_config.yaml" ],
178203 imports = [
179204 " @googleapis//:imports.csv" ,
180- " @protoapis//:imports.csv" ,
181- ],
182- sha256 = " 743d2d5b5504029f3f825beb869ce0ec2330b647b3ee465a4f39ca82df83f8bf" ,
183- strip_prefix = " remote-apis-636121a32fa7b9114311374e4786597d8e7a69f3" ,
184- type = " zip" ,
185- urls = [
186- " https://codeload.github.com/bazelbuild/remote-apis/zip/636121a32fa7b9114311374e4786597d8e7a69f3" ,
187- ],
188- )
189- proto_repository.archive(
190- name = " protoapis" ,
191- build_directives = [
192- " gazelle:proto_go_modules_target_dir ROOT" ,
193- " gazelle:exclude testdata" ,
194- " gazelle:exclude google/protobuf/compiler/ruby" ,
195- " gazelle:exclude google/protobuf/util/internal/testdata" ,
196- " gazelle:proto_language go enable true" ,
197- ],
198- build_file_generation = " clean" ,
199- build_file_proto_mode = " file" ,
200- cfgs = [" //:rules_proto_config.yaml" ],
201- deleted_files = [
202- " google/protobuf/*test*.proto" ,
203- " google/protobuf/*unittest*.proto" ,
204- " google/protobuf/compiler/cpp/*test*.proto" ,
205- " google/protobuf/util/*test*.proto" ,
206- " google/protobuf/util/*unittest*.proto" ,
207- " google/protobuf/util/json_format*.proto" ,
208- ],
209- sha256 = " 4514213c25a5b87e1948aeeb4c40effc55d11d60871ca5b903a2779005fc48ce" ,
210- strip_prefix = " protobuf-9650e9fe8f737efcad485c2a8e6e696186ae3862/src" ,
211- type = " zip" ,
212- urls = [
213- " https://codeload.github.com/protocolbuffers/protobuf/zip/9650e9fe8f737efcad485c2a8e6e696186ae3862" ,
205+ " @protobufapis//:imports.csv" ,
214206 ],
207+ sha256 = " 7b6847779f18fe0a586c8629b9347cf5e54edb0c9fb7cd7b56c489c0209409c2" ,
208+ strip_prefix = " remote-apis-6777112ef7defa6705b1ebd2831d6c7efeb12ba2" ,
209+ urls = [" https://github.com/bazelbuild/remote-apis/archive/6777112ef7defa6705b1ebd2831d6c7efeb12ba2.tar.gz" ],
215210)
216211use_repo(
217212 proto_repository,
218213 " googleapis" ,
219- " protoapis " ,
214+ " protobufapis " ,
220215 " remoteapis" ,
221216)
222217```
@@ -227,10 +222,9 @@ few extra gazelle directives that are injected into the generated root
227222
2282231 . turns on go protobuf rule generation for ` go ` (`gazelle: proto_language go
229224 enable true`)
230- 2 . turns on the gazelle lang ` proto_go_modules ` by setting the target package to
231- the special token ` ROOT ` (` gazelle:proto_go_modules_target_dir ROOT ` ).
225+ 2 . turns on the gazelle lang ` proto_go_modules ` (` gazelle:proto_go_modules_enabled true ` ).
232226
233- When the requested (e.g. ` bazel query @protoapis //... ` ), bazel will:
227+ When the requested (e.g. ` bazel query @protobufapis //... ` ), bazel will:
234228
2352291 . download and extract the zip file
2362302 . remove all existing ` BUILD.bazel ` files in the workspace
@@ -247,26 +241,26 @@ rule include all the generated `proto_go_library` rules in the repo (`GoArchive`
247241providers):
248242
249243``` sh
250- bazel query @protoapis //:proto_go_modules --output build
244+ bazel query @protobufapis //:proto_go_modules --output build
251245```
252246
253247``` py
254248proto_go_modules(
255249 name = " proto_go_modules" ,
256250 visibility = [" //visibility:public" ],
257251 deps = [
258- " @protoapis //google/protobuf:any_go_proto" ,
259- " @protoapis //google/protobuf:api_go_proto" ,
260- " @protoapis //google/protobuf:descriptor_go_proto" ,
261- " @protoapis //google/protobuf:duration_go_proto" ,
262- " @protoapis //google/protobuf:empty_go_proto" ,
263- " @protoapis //google/protobuf:field_mask_go_proto" ,
264- " @protoapis //google/protobuf:source_context_go_proto" ,
265- " @protoapis //google/protobuf:struct_go_proto" ,
266- " @protoapis //google/protobuf:timestamp_go_proto" ,
267- " @protoapis //google/protobuf:type_go_proto" ,
268- " @protoapis //google/protobuf:wrappers_go_proto" ,
269- " @protoapis //google/protobuf/compiler:plugin_go_proto" ,
252+ " @protobufapis //google/protobuf:any_go_proto" ,
253+ " @protobufapis //google/protobuf:api_go_proto" ,
254+ " @protobufapis //google/protobuf:descriptor_go_proto" ,
255+ " @protobufapis //google/protobuf:duration_go_proto" ,
256+ " @protobufapis //google/protobuf:empty_go_proto" ,
257+ " @protobufapis //google/protobuf:field_mask_go_proto" ,
258+ " @protobufapis //google/protobuf:source_context_go_proto" ,
259+ " @protobufapis //google/protobuf:struct_go_proto" ,
260+ " @protobufapis //google/protobuf:timestamp_go_proto" ,
261+ " @protobufapis //google/protobuf:type_go_proto" ,
262+ " @protobufapis //google/protobuf:wrappers_go_proto" ,
263+ " @protobufapis //google/protobuf/compiler:plugin_go_proto" ,
270264 ],
271265)
272266```
@@ -284,7 +278,7 @@ proto_go_modules(
284278 ],
285279 modules = [
286280 " @googleapis//:proto_go_modules" ,
287- " @protoapis //:proto_go_modules" ,
281+ " @protobufapis //:proto_go_modules" ,
288282 " @remoteapis//:proto_go_modules" ,
289283 ],
290284)
@@ -339,4 +333,4 @@ go mod edit -replace github.com/bazelbuild/remoteapis/build/bazel/semver/semver=
339333
340334> NOTE: the script does not remove old entries, so you may need to `rm -rf
341335> ./local` and manually tweak the ` go.mod` file in the case of removing
342- > ` imports ` from the ` proto_go_modules ` rule.
336+ > ` imports ` from the ` proto_go_modules ` rule.
0 commit comments