Skip to content

Commit bf65abc

Browse files
committed
Avoid @//
1 parent e515eca commit bf65abc

9 files changed

Lines changed: 54 additions & 37 deletions

File tree

example/person/BUILD.bazel

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,11 @@ proto_ts_library(
151151
srcs = ["person.ts"],
152152
visibility = ["//visibility:public"],
153153
deps = [
154+
"//:node_modules/@nestjs/microservices",
155+
"//:node_modules/@types/node",
156+
"//:node_modules/long",
157+
"//:node_modules/protobufjs",
158+
"//:node_modules/rxjs",
154159
"//example/place:place_ts_proto",
155-
"@//:node_modules/@nestjs/microservices",
156-
"@//:node_modules/@types/node",
157-
"@//:node_modules/long",
158-
"@//:node_modules/protobufjs",
159-
"@//:node_modules/rxjs",
160160
],
161161
)

example/place/BUILD.bazel

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,11 @@ proto_ts_library(
151151
srcs = ["place.ts"],
152152
visibility = ["//visibility:public"],
153153
deps = [
154+
"//:node_modules/@nestjs/microservices",
155+
"//:node_modules/@types/node",
156+
"//:node_modules/long",
157+
"//:node_modules/protobufjs",
158+
"//:node_modules/rxjs",
154159
"//example/thing:thing_ts_proto",
155-
"@//:node_modules/@nestjs/microservices",
156-
"@//:node_modules/@types/node",
157-
"@//:node_modules/long",
158-
"@//:node_modules/protobufjs",
159-
"@//:node_modules/rxjs",
160160
],
161161
)

example/routeguide/BUILD.bazel

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -252,10 +252,10 @@ proto_ts_library(
252252
srcs = ["routeguide.ts"],
253253
visibility = ["//visibility:public"],
254254
deps = [
255-
"@//:node_modules/@nestjs/microservices",
256-
"@//:node_modules/@types/node",
257-
"@//:node_modules/long",
258-
"@//:node_modules/protobufjs",
259-
"@//:node_modules/rxjs",
255+
"//:node_modules/@nestjs/microservices",
256+
"//:node_modules/@types/node",
257+
"//:node_modules/long",
258+
"//:node_modules/protobufjs",
259+
"//:node_modules/rxjs",
260260
],
261261
)

example/thing/BUILD.bazel

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,11 @@ proto_ts_library(
151151
srcs = ["thing.ts"],
152152
visibility = ["//visibility:public"],
153153
deps = [
154+
"//:node_modules/@nestjs/microservices",
155+
"//:node_modules/@types/node",
156+
"//:node_modules/long",
157+
"//:node_modules/protobufjs",
158+
"//:node_modules/rxjs",
154159
"//google/protobuf:timestamppb_ts_proto",
155-
"@//:node_modules/@nestjs/microservices",
156-
"@//:node_modules/@types/node",
157-
"@//:node_modules/long",
158-
"@//:node_modules/protobufjs",
159-
"@//:node_modules/rxjs",
160160
],
161161
)

google/protobuf/BUILD.bazel

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ proto_ts_library(
2727
srcs = ["timestamp.ts"],
2828
visibility = ["//visibility:public"],
2929
deps = [
30-
"@//:node_modules/@nestjs/microservices",
31-
"@//:node_modules/@types/node",
32-
"@//:node_modules/long",
33-
"@//:node_modules/protobufjs",
34-
"@//:node_modules/rxjs",
30+
"//:node_modules/@nestjs/microservices",
31+
"//:node_modules/@types/node",
32+
"//:node_modules/long",
33+
"//:node_modules/protobufjs",
34+
"//:node_modules/rxjs",
3535
],
3636
)

rules/go/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ One solution is to manually copy all the needed `.proto` files from the
1515
different repos into the default workspace and generate protos from there. This
1616
is a common solution but can be troublesome to maintain.
1717

18-
The solution described here (`bazel run @//:proto_go_modules`) has the following
18+
The solution described here (`bazel run //:proto_go_modules`) has the following
1919
two side effects:
2020

2121
1. creates a "vendored" file tree in `./local`
@@ -149,7 +149,7 @@ proto_repository.archive(
149149
],
150150
build_file_proto_mode = "file",
151151
build_file_generation = "clean",
152-
cfgs = ["@//:rules_proto_config.yaml"],
152+
cfgs = ["//:rules_proto_config.yaml"],
153153
deleted_files = [
154154
"google/protobuf/*test*.proto",
155155
"google/protobuf/*unittest*.proto",

rules/golden_filegroup.bzl

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,21 @@ load("@build_stack_rules_proto//rules:providers.bzl", "ProtoCompileInfo")
1919

2020
def _files_impl(ctx):
2121
dep = ctx.attr.dep[DefaultInfo]
22+
outputs = dep.files.to_list()
23+
output_files_by_rel_path = {"/".join([ctx.label.package, f.basename]): f for f in outputs}
24+
2225
return ProtoCompileInfo(
2326
label = ctx.attr.dep.label,
24-
outputs = dep.files.to_list(),
25-
output_files_by_rel_path = {},
27+
outputs = outputs,
28+
output_files_by_rel_path = output_files_by_rel_path,
2629
)
2730

2831
_files = rule(
2932
doc = """Provider Adapter from DefaultInfo to ProtoCompileInfo.""",
3033
implementation = _files_impl,
31-
attrs = {"dep": attr.label(providers = [DefaultInfo])},
34+
attrs = {
35+
"dep": attr.label(providers = [DefaultInfo]),
36+
},
3237
)
3338

3439
def golden_filegroup(
@@ -55,9 +60,19 @@ def golden_filegroup(
5560
tags = kwargs.pop("tags", [])
5661
srcs = kwargs.pop("srcs", [])
5762
goldens = [src + extension for src in srcs]
58-
native.filegroup(name = name, srcs = srcs, tags = tags, **kwargs)
5963

60-
_files(name = name_sources, dep = name, tags = tags)
64+
native.filegroup(
65+
name = name,
66+
srcs = srcs,
67+
tags = tags,
68+
**kwargs
69+
)
70+
71+
_files(
72+
name = name_sources,
73+
dep = name,
74+
tags = tags,
75+
)
6176

6277
proto_compile_gencopy_test(
6378
name = name_test,

rules/proto_compile_gencopy.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ def _proto_compile_gencopy_run_impl(ctx):
2222
source_files.append(rel)
2323
generated_files.append(generated_file.short_path)
2424

25+
if len(source_files) == 0:
26+
fail("source files cannot be empty")
2527
config.packageConfigs.append(
2628
struct(
2729
targetLabel = str(info.label),

rules_proto_config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,11 @@ rules:
208208
visibility:
209209
- //visibility:public
210210
deps:
211-
- "@//:node_modules/@nestjs/microservices"
212-
- "@//:node_modules/@types/node"
213-
- "@//:node_modules/long"
214-
- "@//:node_modules/protobufjs"
215-
- "@//:node_modules/rxjs"
211+
- "//:node_modules/@nestjs/microservices"
212+
- "//:node_modules/@types/node"
213+
- "//:node_modules/long"
214+
- "//:node_modules/protobufjs"
215+
- "//:node_modules/rxjs"
216216

217217
languages:
218218
# CLOSURE

0 commit comments

Comments
 (0)