Skip to content

Commit

Permalink
[bazel] Get the RC emulation servlet running with bazel
Browse files Browse the repository at this point in the history
This means compiling a whole bunch of stuff that has
avoided being pulled in so far. I've cheated and used
a massive glob in one rule to make life easier. It's
probable we'll need to adjust this at some point.
  • Loading branch information
shs96c committed Jul 9, 2019
1 parent d14c738 commit d34ac6b
Show file tree
Hide file tree
Showing 12 changed files with 133 additions and 1 deletion.
3 changes: 2 additions & 1 deletion java/client/src/com/thoughtworks/selenium/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ java_library(
visibility = [
"//java/client/src/com/thoughtworks/selenium:__subpackages__",
"//java/client/test/com/thoughtworks/selenium:__subpackages__",
"//java/server/src/com/thoughtworks/selenium:__pkg__",
"//java/server/src/com/thoughtworks/selenium:__subpackages__",
"//java/server/test/com/thoughtworks/selenium:__subpackages__",
],
exports = [
":api",
Expand Down
2 changes: 2 additions & 0 deletions java/client/src/org/openqa/selenium/io/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ java_library(
"//java/client/test/org/openqa/selenium/environment:__pkg__",
"//java/client/test/org/openqa/selenium/firefox:__pkg__",
"//java/client/test/org/openqa/selenium/io:__pkg__",
"//java/server/src/org/openqa/selenium/grid/session:__pkg__",
"//java/server/src/org/openqa/selenium/remote/server:__pkg__",
],
deps = [
"//java/client/src/org/openqa/selenium:core",
Expand Down
1 change: 1 addition & 0 deletions java/client/src/org/openqa/selenium/net/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ java_library(
"//java/client/test/org/openqa/selenium/testing/drivers:__pkg__",
"//java/server/src/org/openqa/selenium/events/zeromq:__pkg__",
"//java/server/src/org/openqa/selenium/grid:__subpackages__",
"//java/server/test/com/thoughtworks/selenium:__subpackages__",
"//java/server/test/org/openqa/selenium/grid:__subpackages__",
],
deps = [
Expand Down
27 changes: 27 additions & 0 deletions java/server/src/com/thoughtworks/selenium/webdriven/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
load("//java:version.bzl", "SE_VERSION")

java_library(
name = "webdriven",
tags = [
"maven_coordinates=org.seleniumhq.selenium:selenium-leg-rc:%s" % SE_VERSION,
],
srcs = glob(["*.java"]),
deps = [
"//java/client/src/com/thoughtworks/selenium",
"//java/client/src/com/thoughtworks/selenium/webdriven",
"//java/client/src/org/openqa/selenium/chrome",
"//java/client/src/org/openqa/selenium/edge",
"//java/client/src/org/openqa/selenium/firefox",
"//java/client/src/org/openqa/selenium/ie",
"//java/client/src/org/openqa/selenium/opera",
"//java/client/src/org/openqa/selenium/remote",
"//java/client/src/org/openqa/selenium/safari",
"//java/server/src/org/openqa/selenium/grid/session",
"//java/server/src/org/openqa/selenium/remote/server",
"//third_party/java/guava",
"//third_party/java/servlet:javax.servlet-api",
],
visibility = [
"//java/server/test/com/thoughtworks/selenium/webdriven:__pkg__",
]
)
1 change: 1 addition & 0 deletions java/server/src/org/openqa/selenium/grid/data/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ java_library(
srcs = glob(["*.java"]),
visibility = [
"//java/server/src/org/openqa/selenium/grid:__subpackages__",
"//java/server/src/org/openqa/selenium/remote/server:__subpackages__",
"//java/server/test/org/openqa/selenium/grid:__subpackages__",
],
deps = [
Expand Down
1 change: 1 addition & 0 deletions java/server/src/org/openqa/selenium/grid/log/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ java_library(
srcs = glob(["*.java"]),
visibility = [
"//java/server/src/org/openqa/selenium/grid:__subpackages__",
"//java/server/src/org/openqa/selenium/remote/server:__subpackages__",
],
deps = [
"//java/client/src/org/openqa/selenium/json",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ java_library(
visibility = [
"//java/server/src/org/openqa/selenium/grid:__subpackages__",
"//java/server/src/org/openqa/selenium/netty/server:__pkg__",
"//java/server/src/org/openqa/selenium/remote/server:__pkg__",
"//java/server/test/org/openqa/selenium/grid:__subpackages__",
],
runtime_deps = [
Expand Down
20 changes: 20 additions & 0 deletions java/server/src/org/openqa/selenium/grid/session/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
java_library(
name = "session",
srcs = glob([
"*.java",
"remote/*.java",
]),
deps = [
"//java/client/src/org/openqa/selenium/io",
"//java/client/src/org/openqa/selenium/net",
"//java/client/src/org/openqa/selenium/remote",
"//java/server/src/org/openqa/selenium/grid/data",
"//java/server/src/org/openqa/selenium/grid/web",
"//java/server/src/org/openqa/selenium/remote/server/jmx",
"//third_party/java/guava",
],
visibility = [
"//java/server/src/com/thoughtworks/selenium:__subpackages__",
"//java/server/src/org/openqa/selenium/remote/server:__subpackages__",
],
)
1 change: 1 addition & 0 deletions java/server/src/org/openqa/selenium/grid/web/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ java_library(
srcs = glob(["*.java"]),
visibility = [
"//java/server/src/org/openqa/selenium/grid:__subpackages__",
"//java/server/src/org/openqa/selenium/remote/server:__subpackages__",
"//java/server/test/org/openqa/selenium/grid:__subpackages__",
],
deps = [
Expand Down
53 changes: 53 additions & 0 deletions java/server/src/org/openqa/selenium/remote/server/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@

# Only enough to get the webdriven rc emulation working
# TODO(simon): Migrate webdriver rc emulation off this stack
java_library(
name = "server",
srcs = [
"ActiveSessionFactory.java",
"ActiveSessionListener.java",
"ActiveSessions.java",
"AllHandlers.java",
"DefaultDriverProvider.java",
"DriverProvider.java",
"DriverSessions.java",
"InMemorySession.java",
"JsonHttpCommandHandler.java",
"KnownElements.java",
"InputStreamWrappingServletInputStream.java",
"NewSessionPipeline.java",
"RequiresAllSessions.java",
"RequiresSession.java",
"Session.java",
"StaticResourceHandler.java",
"WebDriverServlet.java",
] + glob([
"commandhandler/*.java",
"handler/*.java",
"handler/html5/*.java",
"handler/interactions/*.java",
"handler/interactions/touch/*.java",
"handler/internal/*.java",
"handler/mobile/*.java",
"log/*.java",
"rest/*.java",
"xdrpc/*.java",
]),
deps = [
"//java/client/src/org/openqa/selenium/io",
"//java/client/src/org/openqa/selenium/json",
"//java/client/src/org/openqa/selenium/remote",
"//java/server/src/org/openqa/selenium/grid/data",
"//java/server/src/org/openqa/selenium/grid/log",
"//java/server/src/org/openqa/selenium/grid/server",
"//java/server/src/org/openqa/selenium/grid/session",
"//java/server/src/org/openqa/selenium/grid/web",
"//third_party/java/guava",
"//third_party/java/servlet:javax.servlet-api",
],
visibility = [
"//java/server/src/com/thoughtworks/selenium:__subpackages__",
"//java/server/test/com/thoughtworks/selenium:__subpackages__",
]

)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
java_library(
name = "jmx",
srcs = glob(["*.java"]),
visibility = [
"//java/server/src/org/openqa/selenium/grid/session:__pkg__",
]
)
17 changes: 17 additions & 0 deletions java/server/test/com/thoughtworks/selenium/webdriven/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
load("//java:rules.bzl", "java_test_suite")

java_test_suite(
name = "MediumTests",
size = "medium",
srcs = glob(["*Test.java"]),
deps = [
"//java/client/src/com/thoughtworks/selenium",
"//java/client/src/org/openqa/selenium/net",
"//java/client/test/org/openqa/selenium/environment",
"//java/client/test/org/openqa/selenium/testing:test-base",
"//java/server/src/com/thoughtworks/selenium/webdriven",
"//java/server/src/org/openqa/selenium/remote/server",
"//third_party/java/jetty",
"//third_party/java/junit",
]
)

0 comments on commit d34ac6b

Please sign in to comment.