Skip to content

Commit c6a31d8

Browse files
committed
Move devtools generator into devtools directory
1 parent f00998e commit c6a31d8

File tree

5 files changed

+48
-51
lines changed

5 files changed

+48
-51
lines changed

java/client/src/org/openqa/selenium/devtools/BUILD.bazel

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ load("@rules_jvm_external//:defs.bzl", "artifact")
22
load("//java:defs.bzl", "java_export")
33
load("//java:version.bzl", "SE_VERSION")
44

5+
GENERATOR_SOURCES = [
6+
"CdpClientGenerator.java",
7+
]
8+
59
PROTOTYPE_SOURCES = [
610
"Command.java",
711
"ConverterFunctions.java",
@@ -12,9 +16,6 @@ PROTOTYPE_SOURCES = [
1216
java_library(
1317
name = "devtools-prototypes",
1418
srcs = PROTOTYPE_SOURCES,
15-
visibility = [
16-
"//java/client/src/org/openqa/selenium/tools/cdp:__pkg__",
17-
],
1819
deps = [
1920
"//java/client/src/org/openqa/selenium:core",
2021
"//java/client/src/org/openqa/selenium/json",
@@ -26,23 +27,62 @@ java_export(
2627
name = "devtools",
2728
srcs = glob(
2829
["*.java"],
29-
exclude = PROTOTYPE_SOURCES,
30+
exclude = PROTOTYPE_SOURCES + GENERATOR_SOURCES,
3031
),
3132
maven_coordinates = "org.seleniumhq.selenium:selenium-devtools:%s" % SE_VERSION,
3233
pom_template = "//java/client/src/org/openqa/selenium:template-pom",
3334
visibility = [
3435
"//visibility:public",
3536
],
3637
exports = [
38+
":cdp",
3739
":devtools-prototypes",
38-
"//java/client/src/org/openqa/selenium/tools/cdp",
3940
],
4041
deps = [
42+
":cdp",
4143
":devtools-prototypes",
4244
"//java/client/src/org/openqa/selenium:core",
4345
"//java/client/src/org/openqa/selenium/json",
4446
"//java/client/src/org/openqa/selenium/remote",
45-
"//java/client/src/org/openqa/selenium/tools/cdp",
47+
artifact("com.google.guava:guava"),
48+
],
49+
)
50+
51+
java_binary(
52+
name = "cdp-client-generator",
53+
srcs = GENERATOR_SOURCES,
54+
main_class = "org.openqa.selenium.devtools.CdpClientGenerator",
55+
deps = [
56+
"//java/client/src/org/openqa/selenium:core",
57+
"//java/client/src/org/openqa/selenium/devtools:devtools-prototypes",
58+
"//java/client/src/org/openqa/selenium/json",
59+
artifact("com.github.javaparser:javaparser-core"),
60+
artifact("com.google.guava:guava"),
61+
],
62+
)
63+
64+
genrule(
65+
name = "create-cdp-srcs",
66+
srcs = [
67+
"browser_protocol.json",
68+
"js_protocol.json",
69+
],
70+
outs = ["cdp.srcjar"],
71+
cmd = "$(location :cdp-client-generator) $@",
72+
tools = [
73+
":cdp-client-generator",
74+
],
75+
)
76+
77+
java_library(
78+
name = "cdp",
79+
srcs = [
80+
":create-cdp-srcs",
81+
],
82+
deps = [
83+
"//java/client/src/org/openqa/selenium:core",
84+
"//java/client/src/org/openqa/selenium/devtools:devtools-prototypes",
85+
"//java/client/src/org/openqa/selenium/json",
4686
artifact("com.google.guava:guava"),
4787
],
4888
)

java/client/src/org/openqa/selenium/tools/cdp/CdpClientGenerator.java renamed to java/client/src/org/openqa/selenium/devtools/CdpClientGenerator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18-
package org.openqa.selenium.tools.cdp;
18+
package org.openqa.selenium.devtools;
1919

2020
import com.github.javaparser.ast.CompilationUnit;
2121
import com.github.javaparser.ast.body.BodyDeclaration;
@@ -60,7 +60,7 @@
6060
public class CdpClientGenerator {
6161

6262
public static void main(String[] args) throws IOException {
63-
Path source = Paths.get("java/client/src/org/openqa/selenium/tools/cdp");
63+
Path source = Paths.get("java/client/src/org/openqa/selenium/devtools");
6464
Path target = Files.createTempDirectory("devtools");
6565
String devtoolsDir = "org/openqa/selenium/devtools/";
6666

java/client/src/org/openqa/selenium/tools/cdp/BUILD.bazel

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)