Skip to content

Commit

Permalink
Switch to using rules_jvm_external for managing third party java deps
Browse files Browse the repository at this point in the history
  • Loading branch information
shs96c committed Nov 12, 2019
1 parent 2171634 commit 6085af9
Show file tree
Hide file tree
Showing 339 changed files with 3,776 additions and 1,595 deletions.
16 changes: 16 additions & 0 deletions WORKSPACE
Expand Up @@ -8,6 +8,22 @@ workspace(

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "rules_jvm_external",
strip_prefix = "rules_jvm_external-2.10",
sha256 = "1bbf2e48d07686707dd85357e9a94da775e1dbd7c464272b3664283c9c716d26",
url = "https://github.com/bazelbuild/rules_jvm_external/archive/2.10.zip",
)

load("//java:maven_deps.bzl", "selenium_java_deps")

selenium_java_deps()

load("@maven//:defs.bzl", "pinned_maven_install")

pinned_maven_install()


http_archive(
name = "io_bazel_rules_closure",
sha256 = "2e95ba060acd74f3662547a38814ffff60317be047b7168d25498aea52f3e732",
Expand Down
27 changes: 27 additions & 0 deletions java/BUILD.bazel
@@ -1,3 +1,5 @@
load("@rules_jvm_external//:defs.bzl", "artifact")

exports_files(
srcs = [
"CHANGELOG",
Expand All @@ -8,3 +10,28 @@ exports_files(
"//visibility:public",
],
)

java_plugin(
name = "auto-service-plugin",
processor_class = "com.google.auto.service.processor.AutoServiceProcessor",
visibility = ["//visibility:private"],
deps = [
artifact("com.google.auto:auto-common"),
artifact("com.google.auto.service:auto-service"),
artifact("com.google.guava:guava"),
],
)

java_library(
name = "auto-service",
exported_plugins = [
":auto-service-plugin",
],
exports = [
artifact("com.google.auto.service:auto-service"),
artifact("com.google.auto.service:auto-service-annotations"),
],
visibility = [
"//java:__subpackages__",
]
)
8 changes: 5 additions & 3 deletions java/client/src/com/thoughtworks/selenium/BUILD.bazel
@@ -1,3 +1,5 @@
load("@rules_jvm_external//:defs.bzl", "artifact")

java_library(
name = "api",
srcs = [
Expand Down Expand Up @@ -40,9 +42,9 @@ java_library(
"//java/client/src/org/openqa/selenium:core",
"//java/client/src/org/openqa/selenium/edge",
"//java/client/src/org/openqa/selenium/remote",
"//third_party/java/guava",
"//third_party/java/junit",
"//third_party/java/testng",
artifact("com.google.guava:guava"),
artifact("junit:junit"),
artifact("org.testng:testng"),
],
)

Expand Down
@@ -1,3 +1,5 @@
load("@rules_jvm_external//:defs.bzl", "artifact")

java_library(
name = "condition",
srcs = glob(["*.java"]),
Expand All @@ -6,6 +8,6 @@ java_library(
],
deps = [
"//java/client/src/com/thoughtworks/selenium:api",
"//third_party/java/junit",
artifact("junit:junit"),
],
)
@@ -1,3 +1,4 @@
load("@rules_jvm_external//:defs.bzl", "artifact")
load("//:copy_file.bzl", "copy_file")

exports_files([
Expand Down Expand Up @@ -53,7 +54,7 @@ java_library(
"//java/client/src/com/thoughtworks/selenium/webdriven/commands",
"//java/client/src/org/openqa/selenium:core",
"//java/client/src/org/openqa/selenium/remote",
"//third_party/java/guava",
artifact("com.google.guava:guava"),
],
)

Expand All @@ -74,7 +75,7 @@ java_library(
deps = [
"//java/client/src/com/thoughtworks/selenium",
"//java/client/src/org/openqa/selenium:core",
"//third_party/java/guava",
artifact("com.google.guava:guava"),
],
)

Expand Down
@@ -1,3 +1,5 @@
load("@rules_jvm_external//:defs.bzl", "artifact")

java_library(
name = "commands",
srcs = glob(["*.java"]),
Expand All @@ -8,6 +10,6 @@ java_library(
"//java/client/src/com/thoughtworks/selenium",
"//java/client/src/com/thoughtworks/selenium/webdriven:emulation-api",
"//java/client/src/org/openqa/selenium/remote",
"//third_party/java/guava",
artifact("com.google.guava:guava"),
],
)
5 changes: 3 additions & 2 deletions java/client/src/org/openqa/selenium/chrome/BUILD.bazel
@@ -1,3 +1,4 @@
load("@rules_jvm_external//:defs.bzl", "artifact")
load("//java:defs.bzl", "java_export")
load("//java:version.bzl", "SE_VERSION")

Expand All @@ -11,13 +12,13 @@ java_export(
"//java/client/src/org/openqa/selenium/chromium",
],
deps = [
"//java:auto-service",
"//java/client/src/org/openqa/selenium:core",
"//java/client/src/org/openqa/selenium/chromium",
"//java/client/src/org/openqa/selenium/devtools",
"//java/client/src/org/openqa/selenium/json",
"//java/client/src/org/openqa/selenium/remote",
"//java/client/src/org/openqa/selenium/remote/http",
"//third_party/java/guava",
"//third_party/java/service",
artifact("com.google.guava:guava"),
],
)
5 changes: 3 additions & 2 deletions java/client/src/org/openqa/selenium/chromium/BUILD.bazel
@@ -1,3 +1,4 @@
load("@rules_jvm_external//:defs.bzl", "artifact")
load("//java:defs.bzl", "java_export")
load("//java:version.bzl", "SE_VERSION")

Expand All @@ -13,10 +14,10 @@ java_export(
"//java/client/src/org/openqa/selenium/devtools",
],
deps = [
"//java:auto-service",
"//java/client/src/org/openqa/selenium/devtools",
"//java/client/src/org/openqa/selenium/json",
"//java/client/src/org/openqa/selenium/remote",
"//third_party/java/guava",
"//third_party/java/service",
artifact("com.google.guava:guava"),
],
)
3 changes: 2 additions & 1 deletion java/client/src/org/openqa/selenium/devtools/BUILD.bazel
@@ -1,3 +1,4 @@
load("@rules_jvm_external//:defs.bzl", "artifact")
load("//java:defs.bzl", "java_export")
load("//java:version.bzl", "SE_VERSION")

Expand All @@ -13,6 +14,6 @@ java_export(
"//java/client/src/org/openqa/selenium:core",
"//java/client/src/org/openqa/selenium/json",
"//java/client/src/org/openqa/selenium/remote",
"//third_party/java/guava",
artifact("com.google.guava:guava"),
],
)
5 changes: 3 additions & 2 deletions java/client/src/org/openqa/selenium/edge/BUILD.bazel
@@ -1,3 +1,4 @@
load("@rules_jvm_external//:defs.bzl", "artifact")
load("//java:defs.bzl", "java_export")
load("//java:version.bzl", "SE_VERSION")

Expand All @@ -22,10 +23,10 @@ java_export(
"//visibility:public",
],
deps = [
"//java:auto-service",
"//java/client/src/org/openqa/selenium:core",
"//java/client/src/org/openqa/selenium/chromium",
"//java/client/src/org/openqa/selenium/remote",
"//third_party/java/guava",
"//third_party/java/service",
artifact("com.google.guava:guava"),
],
)
5 changes: 3 additions & 2 deletions java/client/src/org/openqa/selenium/edge/edgehtml/BUILD.bazel
@@ -1,3 +1,4 @@
load("@rules_jvm_external//:defs.bzl", "artifact")
load("//java:defs.bzl", "java_export")
load("//java:version.bzl", "SE_VERSION")

Expand All @@ -10,9 +11,9 @@ java_export(
"//visibility:public",
],
deps = [
"//java:auto-service",
"//java/client/src/org/openqa/selenium/edge:edgeium",
"//java/client/src/org/openqa/selenium/remote",
"//third_party/java/guava",
"//third_party/java/service",
artifact("com.google.guava:guava"),
],
)
5 changes: 3 additions & 2 deletions java/client/src/org/openqa/selenium/firefox/BUILD.bazel
@@ -1,3 +1,4 @@
load("@rules_jvm_external//:defs.bzl", "artifact")
load("//java:defs.bzl", "java_export")
load("//java:version.bzl", "SE_VERSION")
load("//:copy_file.bzl", "copy_file")
Expand All @@ -10,10 +11,10 @@ java_export(
pom_template = "//java/client/src/org/openqa/selenium:template-pom",
visibility = ["//visibility:public"],
deps = [
"//java:auto-service",
"//java/client/src/org/openqa/selenium/json",
"//java/client/src/org/openqa/selenium/remote",
"//third_party/java/guava",
"//third_party/java/service",
artifact("com.google.guava:guava"),
],
)

Expand Down
5 changes: 3 additions & 2 deletions java/client/src/org/openqa/selenium/firefox/xpi/BUILD.bazel
@@ -1,3 +1,4 @@
load("@rules_jvm_external//:defs.bzl", "artifact")
load("//java:defs.bzl", "java_export")
load("//java:version.bzl", "SE_VERSION")
load("//:copy_file.bzl", "copy_file")
Expand All @@ -14,11 +15,11 @@ java_export(
pom_template = "//java/client/src/org/openqa/selenium:template-pom",
visibility = ["//visibility:public"],
deps = [
"//java:auto-service",
"//java/client/src/org/openqa/selenium:core",
"//java/client/src/org/openqa/selenium/firefox",
"//java/client/src/org/openqa/selenium/remote",
"//third_party/java/guava",
"//third_party/java/service",
artifact("com.google.guava:guava"),
],
)

Expand Down
5 changes: 3 additions & 2 deletions java/client/src/org/openqa/selenium/ie/BUILD.bazel
@@ -1,3 +1,4 @@
load("@rules_jvm_external//:defs.bzl", "artifact")
load("//java:defs.bzl", "java_export")
load("//java:version.bzl", "SE_VERSION")

Expand All @@ -8,9 +9,9 @@ java_export(
pom_template = "//java/client/src/org/openqa/selenium:template-pom",
visibility = ["//visibility:public"],
deps = [
"//java:auto-service",
"//java/client/src/org/openqa/selenium:core",
"//java/client/src/org/openqa/selenium/remote",
"//third_party/java/guava",
"//third_party/java/service",
artifact("com.google.guava:guava"),
],
)
7 changes: 4 additions & 3 deletions java/client/src/org/openqa/selenium/lift/BUILD.bazel
@@ -1,3 +1,4 @@
load("@rules_jvm_external//:defs.bzl", "artifact")
load("//java:defs.bzl", "java_export")
load("//java:version.bzl", "SE_VERSION")

Expand All @@ -12,8 +13,8 @@ java_export(
deps = [
"//java/client/src/org/openqa/selenium:core",
"//java/client/src/org/openqa/selenium/support",
"//third_party/java/guava",
"//third_party/java/hamcrest",
"//third_party/java/junit",
artifact("com.google.guava:guava"),
artifact("org.hamcrest:hamcrest-all"),
artifact("junit:junit")
],
)
5 changes: 3 additions & 2 deletions java/client/src/org/openqa/selenium/opera/BUILD.bazel
@@ -1,3 +1,4 @@
load("@rules_jvm_external//:defs.bzl", "artifact")
load("//java:defs.bzl", "java_export")
load("//java:version.bzl", "SE_VERSION")

Expand All @@ -8,9 +9,9 @@ java_export(
pom_template = "//java/client/src/org/openqa/selenium:template-pom",
visibility = ["//visibility:public"],
deps = [
"//java:auto-service",
"//java/client/src/org/openqa/selenium:core",
"//java/client/src/org/openqa/selenium/remote",
"//third_party/java/guava",
"//third_party/java/service",
artifact("com.google.guava:guava"),
],
)
6 changes: 4 additions & 2 deletions java/client/src/org/openqa/selenium/os/BUILD.bazel
@@ -1,3 +1,5 @@
load("@rules_jvm_external//:defs.bzl", "artifact")

java_library(
name = "os",
srcs = glob(["*.java"]),
Expand All @@ -11,7 +13,7 @@ java_library(
deps = [
"//java/client/src/org/openqa/selenium:core",
"//java/client/src/org/openqa/selenium/io",
"//third_party/java/commons:commons-exec",
"//third_party/java/guava",
artifact("org.apache.commons:commons-exec"),
artifact("com.google.guava:guava"),
],
)
26 changes: 13 additions & 13 deletions java/client/src/org/openqa/selenium/remote/BUILD.bazel
@@ -1,3 +1,5 @@
load("@rules_jvm_external//:defs.bzl", "artifact")
load("//:copy_file.bzl", "copy_file")
load("//java:defs.bzl", "java_dist_zip", "java_export")
load("//java:version.bzl", "SE_VERSION")

Expand All @@ -19,7 +21,7 @@ java_library(
deps = [
"//java/client/src/org/openqa/selenium:core",
"//java/client/src/org/openqa/selenium/json",
"//third_party/java/guava",
artifact("com.google.guava:guava"),
],
)

Expand All @@ -35,7 +37,7 @@ java_library(
],
deps = [
"//java/client/src/org/openqa/selenium:core",
"//third_party/java/guava",
artifact("com.google.guava:guava"),
],
)

Expand Down Expand Up @@ -87,8 +89,8 @@ java_export(
"//java/client/src/org/openqa/selenium/os",
"//java/client/src/org/openqa/selenium/remote/http/okhttp",
"//java/client/src/org/openqa/selenium/remote/http/netty",
"//third_party/java/bytebuddy:byte-buddy",
"//third_party/java/guava",
artifact("net.bytebuddy:byte-buddy"),
artifact("com.google.guava:guava"),
],
)

Expand Down Expand Up @@ -152,20 +154,18 @@ java_library(
"//java/client/src/org/openqa/selenium/os",
"//java/client/src/org/openqa/selenium/remote/http",
"//java/client/src/org/openqa/selenium/remote/session",
"//third_party/java/guava",
artifact("com.google.guava:guava"),
],
)

genrule(
copy_file(
name = "get-attribute",
srcs = ["//javascript/webdriver/atoms:get-attribute.js"],
outs = ["getAttribute.js"],
cmd = "cp $< $@",
src = "//javascript/webdriver/atoms:get-attribute.js",
out = "getAttribute.js",
)

genrule(
copy_file(
name = "is-displayed",
srcs = ["//javascript/atoms/fragments:is-displayed.js"],
outs = ["isDisplayed.js"],
cmd = "cp $< $@",
src = "//javascript/atoms/fragments:is-displayed.js",
out = "isDisplayed.js",
)
3 changes: 2 additions & 1 deletion java/client/src/org/openqa/selenium/remote/http/BUILD.bazel
@@ -1,3 +1,4 @@
load("@rules_jvm_external//:defs.bzl", "artifact")
load("//java:defs.bzl", "java_export")
load("//java:version.bzl", "SE_VERSION")

Expand All @@ -12,6 +13,6 @@ java_export(
deps = [
"//java/client/src/org/openqa/selenium:core",
"//java/client/src/org/openqa/selenium/json",
"//third_party/java/guava",
artifact("com.google.guava:guava"),
],
)

0 comments on commit 6085af9

Please sign in to comment.