Skip to content

Commit 328d56d

Browse files
committed
[dotnet] Make CDP code generation work on non-Windows platforms
1 parent 7dcd8fa commit 328d56d

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

‎dotnet/private/generate_devtools.bzl

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@ def _generate_devtools_impl(ctx):
1010
},
1111
)
1212

13+
template_files = []
14+
for template_file in ctx.attr.templates:
15+
template_files.append(template_file.files.to_list()[0])
16+
1317
args = ctx.actions.args()
1418
args.add_all("-s", [settings_template_file])
1519
args.add_all("-b", [ctx.attr.browser_protocol.files.to_list()[0]])
1620
args.add_all("-j", [ctx.attr.js_protocol.files.to_list()[0]])
17-
args.add_all("-t", [ctx.attr.template.files.to_list()[0]])
21+
args.add_all("-t", [template_files[0]])
1822
args.add("-q")
1923
args.add_all("-o", [outdir.path])
2024

@@ -29,8 +33,7 @@ def _generate_devtools_impl(ctx):
2933
settings_template_file,
3034
ctx.file.browser_protocol,
3135
ctx.file.js_protocol,
32-
ctx.file.template,
33-
],
36+
] + template_files,
3437
use_default_shell_env = True,
3538
)
3639

@@ -51,8 +54,8 @@ generate_devtools = rule(
5154
"js_protocol": attr.label(
5255
allow_single_file = True,
5356
),
54-
"template": attr.label(
55-
allow_single_file = True,
57+
"templates": attr.label_list(
58+
allow_files = True
5659
),
5760
"out": attr.string(
5861
doc = "File name, without extension, of the built assembly.",

‎dotnet/src/webdriver/cdp/BUILD.bazel

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ load("//dotnet:selenium-dotnet-version.bzl", "SUPPORTED_DEVTOOLS_VERSIONS")
88
generator = "//third_party/dotnet/devtools/src/generator:generator",
99
js_protocol = "//common/devtools/chromium/{}:js_protocol".format(devtools_version),
1010
protocol_version = "{}".format(devtools_version),
11-
template = "//third_party/dotnet/devtools/src/generator/Templates:command.hbs",
11+
templates = [
12+
"//third_party/dotnet/devtools/src/generator/Templates:command.hbs",
13+
"//third_party/dotnet/devtools/src/generator/Templates:DevToolsSessionDomains.hbs",
14+
"//third_party/dotnet/devtools/src/generator/Templates:domain.hbs",
15+
"//third_party/dotnet/devtools/src/generator/Templates:event.hbs",
16+
"//third_party/dotnet/devtools/src/generator/Templates:project.hbs",
17+
"//third_party/dotnet/devtools/src/generator/Templates:type-enum.hbs",
18+
"//third_party/dotnet/devtools/src/generator/Templates:type-hash.hbs",
19+
"//third_party/dotnet/devtools/src/generator/Templates:type-object.hbs",
20+
],
1221
visibility = ["//visibility:public"],
1322
) for devtools_version in SUPPORTED_DEVTOOLS_VERSIONS]

0 commit comments

Comments
 (0)