Skip to content

Commit

Permalink
[bazel] Automated reformatting of build files
Browse files Browse the repository at this point in the history
  • Loading branch information
shs96c committed Jul 24, 2019
1 parent 4892ee9 commit 3d2054a
Show file tree
Hide file tree
Showing 30 changed files with 124 additions and 103 deletions.
7 changes: 5 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ workspace(
managed_directories = {
# Share the node_modules directory between Bazel and other tooling
"@npm": ["node_modules"],
}
},
)

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
Expand All @@ -27,10 +27,11 @@ http_archive(
strip_prefix = "rules_dotnet-e9537b4a545528b11b270dfa124f3193bdb2d78e",
urls = [
"https://github.com/bazelbuild/rules_dotnet/archive/e9537b4a545528b11b270dfa124f3193bdb2d78e.tar.gz",
]
],
)

load("//dotnet:workspace.bzl", "selenium_register_dotnet")

selenium_register_dotnet()

http_archive(
Expand All @@ -40,11 +41,13 @@ http_archive(
)

load("@build_bazel_rules_nodejs//:defs.bzl", "npm_install")

npm_install(
name = "npm",
package_json = "//:package.json",
package_lock_json = "//:package-lock.json",
)

load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies")

install_bazel_dependencies()
4 changes: 2 additions & 2 deletions dotnet/src/webdriver/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -157,20 +157,20 @@ core_library(
[merged_assembly(
name = "{}".format(framework),
out = "merged/{}/WebDriver.dll".format(framework),
dotnet_context_data = "@io_bazel_rules_dotnet//:net_context_data_{}".format(framework),
src_assembly = ":{}assembly".format(framework),
visibility = ["//visibility:public"],
deps = ["@json.net//:net45"],
dotnet_context_data = "@io_bazel_rules_dotnet//:net_context_data_{}".format(framework),
) for framework in SUPPORTED_NET_FRAMEWORKS]

[merged_assembly(
name = "{}-strongnamed".format(framework),
out = "strongnamed/{}/WebDriver.dll".format(framework),
dotnet_context_data = "@io_bazel_rules_dotnet//:net_context_data_{}".format(framework),
keyfile = "//dotnet:WebDriver.snk",
src_assembly = ":{}assembly-strongnamed".format(framework),
visibility = ["//visibility:public"],
deps = ["@json.net//:net45"],
dotnet_context_data = "@io_bazel_rules_dotnet//:net_context_data_{}".format(framework),
) for framework in SUPPORTED_NET_FRAMEWORKS]

nuget_package(
Expand Down
4 changes: 2 additions & 2 deletions dotnet/test/common/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@ SUPPORTED_BROWSERS = [
"appconfig.json",
"//common/src/web",
"//java/client/test/org/openqa/selenium/environment:appserver_deploy.jar",
"//java/client/test/org/openqa/selenium/environment/keystore:keystore"
"//java/client/test/org/openqa/selenium/environment/keystore",
],
dotnet_context_data = "@io_bazel_rules_dotnet//:net_context_data_net47",
visibility = ["//visibility:public"],
deps = [
"//dotnet/src/webdriver:net47assembly",
"@benderproxy//:net47",
"@castle.core//:net45",
"@io_bazel_rules_dotnet//dotnet/stdlib.net:system.dll",
"@io_bazel_rules_dotnet//dotnet/stdlib.net:system.core.dll",
"@io_bazel_rules_dotnet//dotnet/stdlib.net:system.data.dll",
"@io_bazel_rules_dotnet//dotnet/stdlib.net:system.dll",
"@io_bazel_rules_dotnet//dotnet/stdlib.net:system.drawing.dll",
"@io_bazel_rules_dotnet//dotnet/stdlib.net:system.xml.dll",
"@json.net//:net45",
Expand Down
8 changes: 4 additions & 4 deletions dotnet/test/support/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ nunit_test(
dotnet_context_data = "@io_bazel_rules_dotnet//:net_context_data_net47",
visibility = ["//visibility:public"],
deps = [
"//dotnet/src/webdriver:net47",
"//dotnet/src/support:net47",
"@io_bazel_rules_dotnet//dotnet/stdlib.net:system.dll",
"//dotnet/src/webdriver:net47",
"@castle.core//:net45",
"@io_bazel_rules_dotnet//dotnet/stdlib.net:system.core.dll",
"@io_bazel_rules_dotnet//dotnet/stdlib.net:system.data.dll",
"@io_bazel_rules_dotnet//dotnet/stdlib.net:system.dll",
"@io_bazel_rules_dotnet//dotnet/stdlib.net:system.drawing.dll",
"@io_bazel_rules_dotnet//dotnet/stdlib.net:system.xml.dll",
"@json.net//:net45",
"@moq//:net45",
"@castle.core//:net45",
"@system.threading.tasks.extensions//:net45",
"@nunit//:net45",
"@system.threading.tasks.extensions//:net45",
],
)
2 changes: 1 addition & 1 deletion java/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ exports_files(
],
visibility = [
"//visibility:public",
]
],
)
6 changes: 3 additions & 3 deletions java/client/src/org/openqa/selenium/edge/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ load("//java:version.bzl", "SE_VERSION")

java_library(
name = "edge",
visibility = [
"//visibility:public",
],
exports = [
":edgeium",
"//java/client/src/org/openqa/selenium/devtools",
"//java/client/src/org/openqa/selenium/edge/edgehtml",
],
visibility = [
"//visibility:public",
]
)

java_library(
Expand Down
8 changes: 4 additions & 4 deletions java/client/src/org/openqa/selenium/edge/edgehtml/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ java_library(
tags = [
"maven_coordinates=org.seleniumhq.selenium:selenium-edgehtml-driver:%s" % SE_VERSION,
],
visibility = [
"//java/client/src/org/openqa/selenium/edge:__subpackages__",
],
deps = [
"//java/client/src/org/openqa/selenium/edge:edgeium",
"//java/client/src/org/openqa/selenium/remote",
"//third_party/java/guava",
"//third_party/java/service:service",
"//third_party/java/service",
],
visibility = [
"//java/client/src/org/openqa/selenium/edge:__subpackages__",
]
)
6 changes: 3 additions & 3 deletions java/client/src/org/openqa/selenium/lift/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ java_library(
tags = [
"maven_coordinates=org.seleniumhq.selenium:lift:%s" % SE_VERSION,
],
visibility = [
"//visibility:public",
],
deps = [
"//java/client/src/org/openqa/selenium:core",
"//java/client/src/org/openqa/selenium/support",
"//third_party/java/guava",
"//third_party/java/hamcrest:hamcrest-library",
"//third_party/java/junit",
],
visibility = [
"//visibility:public",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ java_library(
"//java/client/test/org/openqa/selenium/testing/drivers:__pkg__",
"//java/server/src/org/openqa/selenium/grid:__subpackages__",
"//java/server/src/org/openqa/selenium/netty:__subpackages__",
"//java/server/test/org/openqa/selenium/grid:__subpackages__",
"//java/server/test/com/thoughtworks/selenium:__subpackages__",
"//java/server/test/org/openqa/selenium/grid:__subpackages__",
],
deps = [
"//java/client/src/org/openqa/selenium:core",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
java_library(
name = "okhttp",
srcs = glob(["*.java"]),
visibility = [
"//java/client/src/org/openqa/selenium/remote:__pkg__",
"//java/client/test/org/openqa/selenium/remote/http/okhttp:__pkg__",
],
deps = [
"//java/client/src/org/openqa/selenium/remote/http",
"//third_party/java/guava",
"//third_party/java/okhttp3:okhttp",
],
visibility = [
"//java/client/src/org/openqa/selenium/remote:__pkg__",
"//java/client/test/org/openqa/selenium/remote/http/okhttp:__pkg__",
],
)
15 changes: 9 additions & 6 deletions java/client/test/org/openqa/selenium/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("//java:test.bzl", "java_test_suite", "java_selenium_test_suite")
load("//java:test.bzl", "java_selenium_test_suite", "java_test_suite")

SMALL_TESTS = [
"ArchitectureTest.java",
Expand All @@ -19,13 +19,13 @@ java_test_suite(
size = "small",
srcs = SMALL_TESTS,
deps = [
"//java/client/src/org/openqa/selenium/remote",
"//java/client/src/org/openqa/selenium/json",
"//java/client/src/org/openqa/selenium/remote",
"//third_party/java/assertj",
"//third_party/java/junit",
"//third_party/java/guava",
"//third_party/java/junit",
"//third_party/java/mockito:mockito-core",
]
],
)

java_library(
Expand All @@ -52,7 +52,10 @@ java_library(
java_selenium_test_suite(
name = "LargeTests",
size = "large",
srcs = glob(["*Test.java"], exclude = SMALL_TESTS),
srcs = glob(
["*Test.java"],
exclude = SMALL_TESTS,
),
deps = [
":helpers",
"//java/client/src/org/openqa/selenium/net",
Expand All @@ -69,7 +72,7 @@ java_selenium_test_suite(
"//third_party/java/junit",
"//third_party/java/littleshoot:littleproxy",
"//third_party/java/servlet:javax.servlet-api",
]
],
)

# TODO: replace with smaller suites
Expand Down
32 changes: 19 additions & 13 deletions java/client/test/org/openqa/selenium/devtools/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ load("//java:test.bzl", "java_test_suite")

DEV_TOOLS_BROWSERS = {
"chrome": {
"deps": ["//java/client/src/org/openqa/selenium/chrome",],
"jvm_flags": ["-Dselenium.browser=chrome",],
"deps": ["//java/client/src/org/openqa/selenium/chrome"],
"jvm_flags": ["-Dselenium.browser=chrome"],
},
"edge": {
"deps": ["//java/client/src/org/openqa/selenium/edge",],
"jvm_flags": ["-Dselenium.browser=edge",],
"deps": ["//java/client/src/org/openqa/selenium/edge"],
"jvm_flags": ["-Dselenium.browser=edge"],
},
}

Expand All @@ -23,18 +23,24 @@ DEV_TOOLS_BROWSERS = {
"//third_party/java/guava",
"//third_party/java/junit",
],
) for (name,values) in DEV_TOOLS_BROWSERS.items()]
) for (name, values) in DEV_TOOLS_BROWSERS.items()]

java_library(
name = "test-lib",
srcs = glob(["*.java"], exclude=["*Tests.java", "*Test.java"]),
srcs = glob(
["*.java"],
exclude = [
"*Tests.java",
"*Test.java",
],
),
deps = [
"//java/client/src/org/openqa/selenium/devtools",
"//java/client/src/org/openqa/selenium/remote",
"//java/client/test/org/openqa/selenium/environment",
"//java/client/test/org/openqa/selenium/testing:test-base",
"//java/client/test/org/openqa/selenium/testing/drivers",
"//third_party/java/assertj",
"//third_party/java/junit",
"//java/client/src/org/openqa/selenium/devtools",
"//java/client/src/org/openqa/selenium/remote",
"//java/client/test/org/openqa/selenium/environment",
"//java/client/test/org/openqa/selenium/testing:test-base",
"//java/client/test/org/openqa/selenium/testing/drivers",
"//third_party/java/assertj",
"//third_party/java/junit",
],
)
16 changes: 8 additions & 8 deletions java/client/test/org/openqa/selenium/environment/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ java_library(
"//common/src/web",
"//javascript/atoms",
"//third_party/closure/goog",
"//third_party/js/selenium:webdriver_xpi",
"//third_party/js/selenium:webdriver.json",
"//third_party/js/selenium:webdriver_xpi",
"//third_party/js/sizzle",
],
visibility = [
Expand Down Expand Up @@ -55,12 +55,12 @@ java_library(
name = "test-base",
srcs = ["webserver/AppServerTestBase.java"],
deps = [
":environment",
"//java/client/src/org/openqa/selenium:core",
"//java/client/src/org/openqa/selenium/remote/http",
"//java/client/src/org/openqa/selenium/support",
"//java/client/test/org/openqa/selenium/testing/drivers",
"//third_party/java/junit",
":environment",
"//java/client/src/org/openqa/selenium:core",
"//java/client/src/org/openqa/selenium/remote/http",
"//java/client/src/org/openqa/selenium/support",
"//java/client/test/org/openqa/selenium/testing/drivers",
"//third_party/java/junit",
],
)

Expand All @@ -71,5 +71,5 @@ java_test_suite(
deps = [
":environment",
":test-base",
]
],
)
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
java_library(
name = "javascript",
srcs = glob(["*.java"]),
testonly = 1,
srcs = glob(["*.java"]),
visibility = ["//javascript:__subpackages__"],
deps = [
"//java/client/src/org/openqa/selenium:core",
Expand Down
2 changes: 1 addition & 1 deletion java/client/test/org/openqa/selenium/json/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ java_test_suite(
"//third_party/java/gson",
"//third_party/java/guava",
"//third_party/java/junit",
]
],
)
16 changes: 8 additions & 8 deletions java/client/test/org/openqa/selenium/lift/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ java_test_suite(
size = "small",
srcs = glob(["**/*Test.java"]),
deps = [
"//java/client/src/org/openqa/selenium:core",
"//java/client/src/org/openqa/selenium/lift",
"//java/client/test/org/openqa/selenium/support/ui:clock",
"//third_party/java/hamcrest:hamcrest-core",
"//third_party/java/hamcrest:hamcrest-library",
"//third_party/java/junit",
"//third_party/java/mockito:mockito-core",
]
"//java/client/src/org/openqa/selenium:core",
"//java/client/src/org/openqa/selenium/lift",
"//java/client/test/org/openqa/selenium/support/ui:clock",
"//third_party/java/hamcrest:hamcrest-core",
"//third_party/java/hamcrest:hamcrest-library",
"//third_party/java/junit",
"//third_party/java/mockito:mockito-core",
],
)
2 changes: 1 addition & 1 deletion java/client/test/org/openqa/selenium/support/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ java_test_suite(
"//third_party/java/assertj",
"//third_party/java/junit",
"//third_party/java/mockito:mockito-core",
]
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ java_test_suite(
"//third_party/java/guava",
"//third_party/java/junit",
"//third_party/java/mockito:mockito-core",
]
],
)

0 comments on commit 3d2054a

Please sign in to comment.