Skip to content

Commit

Permalink
[bazel] Reformat all build and bzl files using buildifier
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Stewart committed Nov 22, 2018
1 parent 2ed1c5e commit a178bc7
Show file tree
Hide file tree
Showing 85 changed files with 660 additions and 653 deletions.
4 changes: 2 additions & 2 deletions dotnet/selenium-dotnet-version.bzl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# BUILD FILE SYNTAX: SKYLARK

SE_VERSION = '3.141.0'
ASSEMBLY_VERSION = '3.141.0.0'
SE_VERSION = "3.141.0"
ASSEMBLY_VERSION = "3.141.0.0"
2 changes: 1 addition & 1 deletion java/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# Required to allow load of selenium-version.bzl to work
# Required to allow load of selenium-version.bzl to work
17 changes: 10 additions & 7 deletions java/bazel-rules.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ def _contains(list, value):
for v in list:
if v == value:
return True
return False
return False

def _shortName(file):
base = file.rpartition("/")[-1]
Expand All @@ -16,7 +16,7 @@ def _className(file):
name = file.rpartition(".")[0]
className = native.package_name() + "/" + name

segments = className.split('/')
segments = className.split("/")
idx = len(segments) - 1
for i, segment in enumerate(segments):
if _contains(_PREFIXES, segment):
Expand All @@ -31,19 +31,22 @@ def _impl(ctx):
test_class = _className(src),
srcs = ctx.attr.srcs,
size = ctx.attr.size,
deps = ctx.attr.deps)
deps = ctx.attr.deps,
)

def gen_java_tests(srcs=[], deps=[], **kwargs):
def gen_java_tests(srcs = [], deps = [], **kwargs):
native.java_library(
name = "%s-lib" % native.package_name(),
srcs = srcs,
deps = deps)
deps = deps,
)

deps.append(":%s-lib" % native.package_name())

for src in srcs:
native.java_test(
name = _shortName(src),
test_class = _className(src),
runtime_deps = deps,
**kwargs)
runtime_deps = deps,
**kwargs
)
10 changes: 5 additions & 5 deletions java/client/src/org/openqa/selenium/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ load("//java:version.bzl", "SE_VERSION")

java_library(
name = "selenium",
tags = [
"maven_coordinates=org.seleniumhq.selenium:selenium-api:" + SE_VERSION,
],
srcs = glob([
"*.java",
"html5/*.java",
Expand All @@ -13,10 +10,13 @@ java_library(
"logging/**/*.java",
"mobile/*.java",
]),
deps = [
# Deliberately left empty of third party deps
tags = [
"maven_coordinates=org.seleniumhq.selenium:selenium-api:" + SE_VERSION,
],
visibility = [
"//visibility:public",
],
deps = [
# Deliberately left empty of third party deps
],
)
10 changes: 5 additions & 5 deletions java/client/src/org/openqa/selenium/chrome/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ load("//java:version.bzl", "SE_VERSION")

java_library(
name = "chrome",
srcs = glob(["*.java"]),
tags = [
"maven_coordinates=org.seleniumhq.selenium:selenium-chrome-driver:" + SE_VERSION,
"maven_coordinates=org.seleniumhq.selenium:selenium-chrome-driver:" + SE_VERSION,
],
visibility = [
"//visibility:public",
],
srcs = glob(["*.java"]),
deps = [
"//java/client/src/org/openqa/selenium/remote",
"//third_party/java/guava",
"//third_party/java/service",
],
visibility = [
"//visibility:public",
],
)
10 changes: 5 additions & 5 deletions java/client/src/org/openqa/selenium/edge/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ load("//java:version.bzl", "SE_VERSION")

java_library(
name = "edge",
srcs = glob(["*.java"]),
tags = [
"maven_coordinates=org.seleniumhq.selenium:selenium-edge-driver:" + SE_VERSION,
"maven_coordinates=org.seleniumhq.selenium:selenium-edge-driver:" + SE_VERSION,
],
visibility = [
"//visibility:public",
],
srcs = glob(["*.java"]),
deps = [
"//java/client/src/org/openqa/selenium/remote",
"//third_party/java/guava",
"//third_party/java/service",
],
visibility = [
"//visibility:public",
],
)
10 changes: 5 additions & 5 deletions java/client/src/org/openqa/selenium/firefox/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ load("//java:version.bzl", "SE_VERSION")

java_library(
name = "firefox",
srcs = glob(["*.java"]),
tags = [
"maven_coordinates=org.seleniumhq.selenium:selenium-firefox-driver:" + SE_VERSION,
"maven_coordinates=org.seleniumhq.selenium:selenium-firefox-driver:" + SE_VERSION,
],
visibility = [
"//visibility:public",
],
srcs = glob(["*.java"]),
deps = [
"//java/client/src/org/openqa/selenium/remote",
"//third_party/java/guava",
"//third_party/java/service",
],
visibility = [
"//visibility:public",
],
)
10 changes: 5 additions & 5 deletions java/client/src/org/openqa/selenium/ie/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ load("//java:version.bzl", "SE_VERSION")

java_library(
name = "ie",
srcs = glob(["*.java"]),
tags = [
"maven_coordinates=org.seleniumhq.selenium:selenium-ie-driver:" + SE_VERSION,
"maven_coordinates=org.seleniumhq.selenium:selenium-ie-driver:" + SE_VERSION,
],
visibility = [
"//visibility:public",
],
srcs = glob(["*.java"]),
deps = [
"//java/client/src/org/openqa/selenium/remote",
"//third_party/java/guava",
"//third_party/java/service",
],
visibility = [
"//visibility:public",
],
)
6 changes: 3 additions & 3 deletions java/client/src/org/openqa/selenium/io/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
java_library(
name = "io",
srcs = glob(["*.java"]),
deps = [
"//java/client/src/org/openqa/selenium",
],
visibility = [
"//java/client/src/org/openqa/selenium/os:__pkg__",
"//java/client/src/org/openqa/selenium/remote:__pkg__",
],
deps = [
"//java/client/src/org/openqa/selenium",
],
)
8 changes: 4 additions & 4 deletions java/client/src/org/openqa/selenium/json/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
java_library(
name = "json",
srcs = glob(["*.java"]),
visibility = [
"//java/client/src/org/openqa/selenium/remote:__pkg__",
],
deps = [
"//java/client/src/org/openqa/selenium",
"//java/client/src/org/openqa/selenium/remote:types",
"//third_party/java/guava:guava",
],
visibility = [
"//java/client/src/org/openqa/selenium/remote:__pkg__",
"//third_party/java/guava",
],
)
6 changes: 3 additions & 3 deletions java/client/src/org/openqa/selenium/net/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
java_library(
name = "net",
srcs = glob(["*.java"]),
visibility = [
"//java/client/src/org/openqa/selenium/remote:__pkg__",
],
deps = [
"//java/client/src/org/openqa/selenium",
"//third_party/java/guava",
],
visibility = [
"//java/client/src/org/openqa/selenium/remote:__pkg__",
],
)
10 changes: 5 additions & 5 deletions java/client/src/org/openqa/selenium/opera/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ load("//java:version.bzl", "SE_VERSION")

java_library(
name = "opera",
srcs = glob(["*.java"]),
tags = [
"maven_coordinates=org.seleniumhq.selenium:selenium-opera-driver:" + SE_VERSION,
"maven_coordinates=org.seleniumhq.selenium:selenium-opera-driver:" + SE_VERSION,
],
visibility = [
"//visibility:public",
],
srcs = glob(["*.java"]),
deps = [
"//java/client/src/org/openqa/selenium/remote",
"//third_party/java/guava",
"//third_party/java/service",
],
visibility = [
"//visibility:public",
],
)
6 changes: 3 additions & 3 deletions java/client/src/org/openqa/selenium/os/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
java_library(
name = "os",
srcs = glob(["*.java"]),
visibility = [
"//java/client/src/org/openqa/selenium/remote:__pkg__",
],
deps = [
"//java/client/src/org/openqa/selenium",
"//java/client/src/org/openqa/selenium/io",
"//third_party/java/commons:commons-exec",
"//third_party/java/guava",
],
visibility = [
"//java/client/src/org/openqa/selenium/remote:__pkg__",
],
)
39 changes: 21 additions & 18 deletions java/client/src/org/openqa/selenium/remote/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,51 +10,54 @@ TYPE_SOURCES = [

java_library(
name = "remote",
srcs = glob(
[
"*.java",
"html5/*.java",
"http/*.java",
"internal/*.java",
"mobile/*.java",
"service/*.java",
"session/*.java",
],
exclude = TYPE_SOURCES,
),
tags = [
"maven_coordinates=org.seleniumhq.selenium:selenium-remote-driver:" + SE_VERSION,
],
srcs = glob([
"*.java",
"html5/*.java",
"http/*.java",
"internal/*.java",
"mobile/*.java",
"service/*.java",
"session/*.java",
], exclude = TYPE_SOURCES),
visibility = [
"//visibility:public",
],
exports = [
":types",
"//java/client/src/org/openqa/selenium",
"//java/client/src/org/openqa/selenium/json",
"//java/client/src/org/openqa/selenium/io",
"//java/client/src/org/openqa/selenium/json",
"//java/client/src/org/openqa/selenium/net",
"//java/client/src/org/openqa/selenium/os",
],
deps = [
":types",
"//java/client/src/org/openqa/selenium",
"//java/client/src/org/openqa/selenium/json",
"//java/client/src/org/openqa/selenium/io",
"//java/client/src/org/openqa/selenium/json",
"//java/client/src/org/openqa/selenium/net",
"//java/client/src/org/openqa/selenium/os",
"//third_party/java/bytebuddy:byte-buddy",
"//third_party/java/guava",
"//third_party/java/okhttp3:okhttp",
],
visibility = [
"//visibility:public",
],
)

java_library(
name = "types",
srcs = TYPE_SOURCES,
deps = [
"//java/client/src/org/openqa/selenium",
"//third_party/java/guava",
],
visibility = [
"//java/client/src/org/openqa/selenium/json:__pkg__",
"//java/client/test:__subpackages__",
],
deps = [
"//java/client/src/org/openqa/selenium",
"//third_party/java/guava",
],
)
11 changes: 5 additions & 6 deletions java/client/src/org/openqa/selenium/remote/tracing/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@

java_library(
name = "tracing",
srcs = glob(["*.java"]),
visibility = [
"//java/server/src/org/openqa/selenium:__subpackages__",
"//java/server/test/org/openqa/selenium:__subpackages__",
],
deps = [
"//java/client/src/org/openqa/selenium/remote",
"//third_party/java/guava",
"//third_party/java/contrib:opentracing-tracerresolver",
"//third_party/java/guava",
"//third_party/java/opencensus:opencensus-api",
"//third_party/java/opentracing:opentracing-api",
"//third_party/java/opentracing:opentracing-noop",
"//third_party/java/opentracing:opentracing-util",
],
visibility = [
"//java/server/src/org/openqa/selenium:__subpackages__",
"//java/server/test/org/openqa/selenium:__subpackages__",
],
)
10 changes: 5 additions & 5 deletions java/client/src/org/openqa/selenium/safari/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ load("//java:version.bzl", "SE_VERSION")

java_library(
name = "safari",
srcs = glob(["*.java"]),
tags = [
"maven_coordinates=org.seleniumhq.selenium:selenium-safari-driver:" + SE_VERSION,
"maven_coordinates=org.seleniumhq.selenium:selenium-safari-driver:" + SE_VERSION,
],
visibility = [
"//visibility:public",
],
srcs = glob(["*.java"]),
deps = [
"//java/client/src/org/openqa/selenium/remote",
"//third_party/java/guava",
"//third_party/java/service",
],
visibility = [
"//visibility:public",
],
)
Loading

0 comments on commit a178bc7

Please sign in to comment.