Skip to content

Commit

Permalink
Move devtools generator into devtools directory
Browse files Browse the repository at this point in the history
  • Loading branch information
shs96c committed Nov 12, 2019
1 parent f00998e commit c6a31d8
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 51 deletions.
52 changes: 46 additions & 6 deletions java/client/src/org/openqa/selenium/devtools/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ load("@rules_jvm_external//:defs.bzl", "artifact")
load("//java:defs.bzl", "java_export")
load("//java:version.bzl", "SE_VERSION")

GENERATOR_SOURCES = [
"CdpClientGenerator.java",
]

PROTOTYPE_SOURCES = [
"Command.java",
"ConverterFunctions.java",
Expand All @@ -12,9 +16,6 @@ PROTOTYPE_SOURCES = [
java_library(
name = "devtools-prototypes",
srcs = PROTOTYPE_SOURCES,
visibility = [
"//java/client/src/org/openqa/selenium/tools/cdp:__pkg__",
],
deps = [
"//java/client/src/org/openqa/selenium:core",
"//java/client/src/org/openqa/selenium/json",
Expand All @@ -26,23 +27,62 @@ java_export(
name = "devtools",
srcs = glob(
["*.java"],
exclude = PROTOTYPE_SOURCES,
exclude = PROTOTYPE_SOURCES + GENERATOR_SOURCES,
),
maven_coordinates = "org.seleniumhq.selenium:selenium-devtools:%s" % SE_VERSION,
pom_template = "//java/client/src/org/openqa/selenium:template-pom",
visibility = [
"//visibility:public",
],
exports = [
":cdp",
":devtools-prototypes",
"//java/client/src/org/openqa/selenium/tools/cdp",
],
deps = [
":cdp",
":devtools-prototypes",
"//java/client/src/org/openqa/selenium:core",
"//java/client/src/org/openqa/selenium/json",
"//java/client/src/org/openqa/selenium/remote",
"//java/client/src/org/openqa/selenium/tools/cdp",
artifact("com.google.guava:guava"),
],
)

java_binary(
name = "cdp-client-generator",
srcs = GENERATOR_SOURCES,
main_class = "org.openqa.selenium.devtools.CdpClientGenerator",
deps = [
"//java/client/src/org/openqa/selenium:core",
"//java/client/src/org/openqa/selenium/devtools:devtools-prototypes",
"//java/client/src/org/openqa/selenium/json",
artifact("com.github.javaparser:javaparser-core"),
artifact("com.google.guava:guava"),
],
)

genrule(
name = "create-cdp-srcs",
srcs = [
"browser_protocol.json",
"js_protocol.json",
],
outs = ["cdp.srcjar"],
cmd = "$(location :cdp-client-generator) $@",
tools = [
":cdp-client-generator",
],
)

java_library(
name = "cdp",
srcs = [
":create-cdp-srcs",
],
deps = [
"//java/client/src/org/openqa/selenium:core",
"//java/client/src/org/openqa/selenium/devtools:devtools-prototypes",
"//java/client/src/org/openqa/selenium/json",
artifact("com.google.guava:guava"),
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.

package org.openqa.selenium.tools.cdp;
package org.openqa.selenium.devtools;

import com.github.javaparser.ast.CompilationUnit;
import com.github.javaparser.ast.body.BodyDeclaration;
Expand Down Expand Up @@ -60,7 +60,7 @@
public class CdpClientGenerator {

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

Expand Down
43 changes: 0 additions & 43 deletions java/client/src/org/openqa/selenium/tools/cdp/BUILD.bazel

This file was deleted.

0 comments on commit c6a31d8

Please sign in to comment.