Skip to content

Commit d7c0647

Browse files
committed
Simplify Ruby builds by avoiding data files
Everything that we need can be obtained as srcs already
1 parent f44cc24 commit d7c0647

File tree

2 files changed

+5
-21
lines changed

2 files changed

+5
-21
lines changed

rb/BUILD.bazel

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ rb_library(
8282
srcs = glob([
8383
"lib/selenium/webdriver/devtools/**/*.rb",
8484
"lib/selenium/webdriver/devtools.rb",
85-
]),
86-
data = [":mutation-listener"],
85+
]) + [":mutation-listener"],
8786
deps = [":common"],
8887
)
8988

@@ -114,8 +113,7 @@ rb_library(
114113
"Gemfile",
115114
"CHANGES",
116115
"README.md",
117-
]),
118-
data = [
116+
]) + [
119117
":find-elements",
120118
":get-attribute",
121119
":is-displayed",
@@ -160,8 +158,7 @@ rb_library(
160158
srcs = glob([
161159
"lib/selenium/webdriver/remote/**/*.rb",
162160
"lib/selenium/webdriver/remote.rb",
163-
]),
164-
data = [":selenium-server-deploy"],
161+
]) + [":selenium-server-deploy"],
165162
deps = [":common"],
166163
)
167164

@@ -181,8 +178,7 @@ rb_library(
181178
"lib/selenium/devtools.rb",
182179
"lib/selenium/devtools/version.rb",
183180
"selenium-devtools.gemspec",
184-
]),
185-
data = [":license"] + [":cdp-" + n for n in CDP_VERSIONS],
181+
]) + [":license"] + [":cdp-" + n for n in CDP_VERSIONS],
186182
deps = ["@bundle//:websocket"],
187183
)
188184

rb/private/rb_gem.bzl

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
def _rb_gem_impl(ctx):
22
gem_builder = ctx.actions.declare_file("gem_builder.rb")
33

4-
inputs = []
5-
for dep in ctx.attr.deps:
6-
inputs.extend(dep.files.to_list())
7-
inputs.extend(dep[DefaultInfo].data_runfiles.files.to_list())
8-
94
ctx.actions.expand_template(
105
template = ctx.file._gem_builder_template,
116
output = gem_builder,
@@ -17,7 +12,7 @@ def _rb_gem_impl(ctx):
1712
)
1813

1914
ctx.actions.run(
20-
inputs = inputs,
15+
inputs = ctx.files.deps,
2116
executable = gem_builder,
2217
outputs = [ctx.outputs.gem],
2318
execution_requirements = {
@@ -28,20 +23,13 @@ def _rb_gem_impl(ctx):
2823
rb_gem = rule(
2924
_rb_gem_impl,
3025
attrs = {
31-
"srcs": attr.label_list(
32-
allow_files = True,
33-
),
3426
"gemspec": attr.label(
3527
allow_single_file = True,
3628
mandatory = True,
3729
),
3830
"deps": attr.label_list(
3931
allow_files = True,
4032
),
41-
"data": attr.label_list(
42-
allow_empty = True,
43-
allow_files = True,
44-
),
4533
"_gem_builder_template": attr.label(
4634
allow_single_file = True,
4735
default = Label("//rb/private:gem_builder.tpl"),

0 commit comments

Comments
 (0)