Skip to content

Commit

Permalink
[bazel] Upgrade closure rules to 0.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
shs96c committed Nov 10, 2020
1 parent 83b2f46 commit 6b24560
Show file tree
Hide file tree
Showing 12 changed files with 91 additions and 18 deletions.
28 changes: 15 additions & 13 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,6 @@ load("@maven//:defs.bzl", "pinned_maven_install")

pinned_maven_install()

http_archive(
name = "io_bazel_rules_closure",
sha256 = "2e95ba060acd74f3662547a38814ffff60317be047b7168d25498aea52f3e732",
strip_prefix = "rules_closure-b3d4ec3879620edcadd3422b161cebb37c59b6c5",
urls = [
"https://github.com/bazelbuild/rules_closure/archive/b3d4ec3879620edcadd3422b161cebb37c59b6c5.tar.gz",
],
)

load("@io_bazel_rules_closure//closure:defs.bzl", "closure_repositories")

closure_repositories()

http_archive(
name = "d2l_rules_csharp",
sha256 = "4e8e9a93a5436d81c0a410148bef9e3e44860cd7dc567dd4732ab5b269a5e1f8",
Expand Down Expand Up @@ -139,6 +126,21 @@ pip_install(
requirements = "//py:requirements.txt",
)

http_archive(
name = "io_bazel_rules_closure",
sha256 = "d66deed38a0bb20581c15664f0ab62270af5940786855c7adc3087b27168b529",
strip_prefix = "rules_closure-0.11.0",
urls = [
"https://github.com/bazelbuild/rules_closure/archive/0.11.0.tar.gz",
],
)

load("@io_bazel_rules_closure//closure:repositories.bzl", "rules_closure_dependencies", "rules_closure_toolchains")

rules_closure_dependencies()

rules_closure_toolchains()

http_archive(
name = "rules_pkg",
sha256 = "aeca78988341a2ee1ba097641056d168320ecc51372ef7ff8e64b139516a4937",
Expand Down
27 changes: 27 additions & 0 deletions javascript/atoms/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ closure_js_library(
"JSC_IMPLICITLY_NULLABLE_JSDOC",
"JSC_STRICT_INEXISTENT_PROPERTY",
"JSC_UNKNOWN_EXPR_TYPE",
"JSC_USE_OF_GOOG_PROVIDE",
],
visibility = [
"//javascript/atoms/fragments:__pkg__",
Expand All @@ -46,11 +47,17 @@ closure_js_library(
closure_js_library(
name = "bot",
srcs = ["bot.js"],
suppress = [
"JSC_USE_OF_GOOG_PROVIDE",
],
)

closure_js_library(
name = "color",
srcs = ["color.js"],
suppress = [
"JSC_USE_OF_GOOG_PROVIDE",
],
deps = [
"@io_bazel_rules_closure//closure/library",
],
Expand All @@ -70,6 +77,7 @@ closure_js_library(
"JSC_NULLABLE_RETURN_WITH_NAME",
"JSC_STRICT_INEXISTENT_PROPERTY",
"JSC_UNKNOWN_EXPR_TYPE",
"JSC_USE_OF_GOOG_PROVIDE",
],
deps = [
":bot",
Expand All @@ -89,6 +97,7 @@ closure_js_library(
"JSC_IMPLICITLY_NULLABLE_JSDOC",
"JSC_STRICT_INEXISTENT_PROPERTY",
"JSC_UNKNOWN_EXPR_TYPE",
"JSC_USE_OF_GOOG_PROVIDE",
],
deps = [
":errors",
Expand All @@ -105,6 +114,7 @@ closure_js_library(
"JSC_IMPLICITLY_NULLABLE_JSDOC",
"JSC_STRICT_INEXISTENT_PROPERTY",
"JSC_UNKNOWN_EXPR_TYPE",
"JSC_USE_OF_GOOG_PROVIDE",
],
deps = [
":bot",
Expand All @@ -128,6 +138,7 @@ closure_js_library(
"JSC_MISSING_CONST_PROPERTY",
"JSC_STRICT_INEXISTENT_PROPERTY",
"JSC_UNKNOWN_EXPR_TYPE",
"JSC_USE_OF_GOOG_PROVIDE",
],
)

Expand All @@ -139,6 +150,7 @@ closure_js_library(
"JSC_MISSING_CONST_PROPERTY",
"JSC_STRICT_INEXISTENT_PROPERTY",
"JSC_UNKNOWN_EXPR_TYPE",
"JSC_USE_OF_GOOG_PROVIDE",
],
deps = [
":bot",
Expand All @@ -157,6 +169,7 @@ closure_js_library(
"JSC_IMPLICITLY_NULLABLE_JSDOC",
"JSC_NULLABLE_RETURN_WITH_NAME",
"JSC_UNKNOWN_EXPR_TYPE",
"JSC_USE_OF_GOOG_PROVIDE",
],
visibility = [
"//javascript/webdriver/atoms/inject:__pkg__",
Expand All @@ -177,6 +190,7 @@ closure_js_library(
"JSC_IMPLICITLY_NULLABLE_JSDOC",
"JSC_NULLABLE_RETURN_WITH_NAME",
"JSC_UNKNOWN_EXPR_TYPE",
"JSC_USE_OF_GOOG_PROVIDE",
],
deps = [
":bot",
Expand All @@ -194,6 +208,7 @@ closure_js_library(
"JSC_IMPLICITLY_NULLABLE_JSDOC",
"JSC_STRICT_INEXISTENT_PROPERTY",
"JSC_UNKNOWN_EXPR_TYPE",
"JSC_USE_OF_GOOG_PROVIDE",
],
visibility = [
"//javascript/atoms/fragments:__pkg__",
Expand All @@ -211,6 +226,9 @@ closure_js_library(
closure_js_library(
name = "json",
srcs = ["json.js"],
suppress = [
"JSC_USE_OF_GOOG_PROVIDE",
],
deps = [
":useragent",
"@io_bazel_rules_closure//closure/library",
Expand All @@ -228,6 +246,7 @@ closure_js_library(
"JSC_LATE_PROVIDE_ERROR",
"JSC_NULLABLE_RETURN_WITH_NAME",
"JSC_UNKNOWN_EXPR_TYPE",
"JSC_USE_OF_GOOG_PROVIDE",
],
deps = [
":bot",
Expand All @@ -246,6 +265,7 @@ closure_js_library(
suppress = [
"JSC_STRICT_INEXISTENT_PROPERTY",
"JSC_UNKNOWN_EXPR_TYPE",
"JSC_USE_OF_GOOG_PROVIDE",
],
deps = ["@io_bazel_rules_closure//closure/library"],
)
Expand All @@ -256,6 +276,9 @@ closure_js_library(
"frame.js",
"window.js",
],
suppress = [
"JSC_USE_OF_GOOG_PROVIDE",
],
deps = [
":bot",
":errors",
Expand All @@ -272,6 +295,7 @@ closure_js_library(
"JSC_IMPLICITLY_NULLABLE_JSDOC",
"JSC_STRICT_INEXISTENT_PROPERTY",
"JSC_UNKNOWN_EXPR_TYPE",
"JSC_USE_OF_GOOG_PROVIDE",
],
deps = [
":bot",
Expand All @@ -285,6 +309,9 @@ closure_js_library(
name = "test_util",
testonly = 1,
srcs = ["test/test_util.js"],
suppress = [
"JSC_USE_OF_GOOG_PROVIDE",
],
deps = [
":useragent",
"@io_bazel_rules_closure//closure/library",
Expand Down
4 changes: 2 additions & 2 deletions javascript/atoms/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ bot.dom.isShown = function(elem, opt_ignoreOpacity) {
/**
* Determines whether an element or its parents have `display: none` set
* @param {!Node} e the element
* @return {boolean}
* @return {!boolean}
*/
function displayed(e) {
if (bot.dom.isElement(e)) {
Expand Down Expand Up @@ -609,7 +609,7 @@ bot.dom.isShown = function(elem, opt_ignoreOpacity) {
return false;
}

return parent && displayed(parent);
return !!parent && displayed(parent);
}

return bot.dom.isShown_(elem, !!opt_ignoreOpacity, displayed);
Expand Down
1 change: 1 addition & 0 deletions javascript/chrome-driver/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ closure_js_library(
"JSC_PREFER_BACKTICKS_TO_AT_SIGN_CODE",
"JSC_STRICT_INEXISTENT_PROPERTY",
"JSC_UNKNOWN_EXPR_TYPE",
"JSC_USE_OF_GOOG_PROVIDE",
],
deps = [
"//javascript/atoms:dom",
Expand Down
1 change: 1 addition & 0 deletions javascript/ie-driver/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ closure_js_library(
],
suppress = [
"JSC_UNKNOWN_EXPR_TYPE",
"JSC_USE_OF_GOOG_PROVIDE",
],
deps = [
"//javascript/atoms:dom",
Expand Down
1 change: 1 addition & 0 deletions javascript/remote/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ closure_js_library(
"JSC_PREFER_BACKTICKS_TO_AT_SIGN_CODE",
"JSC_STRICT_INEXISTENT_PROPERTY",
"JSC_UNKNOWN_EXPR_TYPE",
"JSC_USE_OF_GOOG_PROVIDE",
],
deps = [
"//javascript/atoms:errors",
Expand Down
2 changes: 1 addition & 1 deletion javascript/selenium-atoms/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ closure_js_library(
"JSC_IMPLICITLY_NULLABLE_JSDOC",
"JSC_MISSING_JSDOC",
"JSC_MISSING_PARAMETER_JSDOC",
"JSC_MISSING_REQUIRE_STRICT_WARNING",
"JSC_MISSING_RETURN_JSDOC",
"JSC_MUST_BE_PRIVATE",
"JSC_PREFER_BACKTICKS_TO_AT_SIGN_CODE",
"JSC_PRIMITIVE_OBJECT",
"JSC_STRICT_INEXISTENT_PROPERTY",
"JSC_UNKNOWN_EXPR_TYPE",
"JSC_UNUSED_LOCAL_ASSIGNMENT",
"JSC_USE_OF_GOOG_PROVIDE",
],
deps = [
"//javascript/atoms:action",
Expand Down
7 changes: 7 additions & 0 deletions javascript/webdriver/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ closure_js_library(
"JSC_IMPLICITLY_NULLABLE_JSDOC",
"JSC_MISSING_CONST_PROPERTY",
"JSC_UNKNOWN_EXPR_TYPE",
"JSC_USE_OF_GOOG_PROVIDE",
],
visibility = ["//javascript/remote:__pkg__"],
deps = [
Expand All @@ -26,13 +27,19 @@ closure_js_library(
closure_js_library(
name = "key",
srcs = ["key.js"],
suppress = [
"JSC_USE_OF_GOOG_PROVIDE",
],
visibility = ["//javascript:__subpackages__"],
)

closure_js_library(
name = "all_js_for_testing",
testonly = 1,
srcs = glob(["**/*.js"]),
suppress = [
"JSC_USE_OF_GOOG_PROVIDE",
],
visibility = ["//javascript:__pkg__"],
deps = ["@io_bazel_rules_closure//closure/library"],
)
Expand Down
7 changes: 7 additions & 0 deletions javascript/webdriver/atoms/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ closure_js_library(
suppress = [
"JSC_IMPLICITLY_NULLABLE_JSDOC",
"JSC_NULLABLE_RETURN_WITH_NAME",
"JSC_USE_OF_GOOG_PROVIDE",
],
visibility = ["//javascript:__subpackages__"],
deps = [
Expand All @@ -44,6 +45,9 @@ closure_fragment(
name = "clear-local-storage",
function = "webdriver.atoms.storage.local.clear",
module = "webdriver.atoms.storage.local",
suppress = [
"JSC_USE_OF_GOOG_PROVIDE",
],
visibility = [
"//javascript/chrome-driver:__pkg__",
],
Expand Down Expand Up @@ -267,6 +271,9 @@ closure_js_library(
name = "all_js_for_testing",
testonly = 1,
srcs = glob(["**/*.js"]),
suppress = [
"JSC_USE_OF_GOOG_PROVIDE",
],
visibility = [
"//javascript:__pkg__",
"//javascript/chrome-driver:__pkg__",
Expand Down
17 changes: 17 additions & 0 deletions javascript/webdriver/atoms/inject/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ closure_js_library(
suppress = [
"JSC_IMPLICITLY_NULLABLE_JSDOC",
"JSC_UNKNOWN_EXPR_TYPE",
"JSC_USE_OF_GOOG_PROVIDE",
],
deps = [
":execute-script",
Expand All @@ -44,6 +45,9 @@ closure_js_library(
closure_js_library(
name = "appcache",
srcs = ["appcache.js"],
suppress = [
"JSC_USE_OF_GOOG_PROVIDE",
],
deps = [
"//javascript/atoms:inject",
"//javascript/webdriver/atoms:atoms-lib",
Expand All @@ -56,6 +60,7 @@ closure_js_library(
suppress = [
"JSC_IMPLICITLY_NULLABLE_JSDOC",
"JSC_UNKNOWN_EXPR_TYPE",
"JSC_USE_OF_GOOG_PROVIDE",
],
deps = [
":execute-script",
Expand All @@ -73,6 +78,7 @@ closure_js_library(
suppress = [
"JSC_IMPLICITLY_NULLABLE_JSDOC",
"JSC_NULLABLE_RETURN_WITH_NAME",
"JSC_USE_OF_GOOG_PROVIDE",
],
deps = [
"//javascript/atoms:inject",
Expand All @@ -85,6 +91,7 @@ closure_js_library(
suppress = [
"JSC_IMPLICITLY_NULLABLE_JSDOC",
"JSC_UNKNOWN_EXPR_TYPE",
"JSC_USE_OF_GOOG_PROVIDE",
],
deps = [
":execute-script",
Expand All @@ -100,6 +107,7 @@ closure_js_library(
suppress = [
"JSC_IMPLICITLY_NULLABLE_JSDOC",
"JSC_NULLABLE_RETURN_WITH_NAME",
"JSC_USE_OF_GOOG_PROVIDE",
],
deps = [
":execute-script",
Expand All @@ -110,6 +118,9 @@ closure_js_library(
closure_js_library(
name = "local-storage",
srcs = ["local_storage.js"],
suppress = [
"JSC_USE_OF_GOOG_PROVIDE",
],
deps = [
":execute-script",
"//javascript/webdriver/atoms:atoms-lib",
Expand All @@ -119,6 +130,9 @@ closure_js_library(
closure_js_library(
name = "session-storage",
srcs = ["session_storage.js"],
suppress = [
"JSC_USE_OF_GOOG_PROVIDE",
],
deps = [
":execute-script",
"//javascript/webdriver/atoms:atoms-lib",
Expand All @@ -128,6 +142,9 @@ closure_js_library(
closure_js_library(
name = "sql-database",
srcs = ["sql_database.js"],
suppress = [
"JSC_USE_OF_GOOG_PROVIDE",
],
deps = [
":execute-script",
"//javascript/atoms:errors",
Expand Down
2 changes: 1 addition & 1 deletion third_party/js/wgxpath/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ closure_js_library(
"JSC_HIDDEN_SUPERCLASS_PROPERTY",
"JSC_IMPLICITLY_NULLABLE_JSDOC",
"JSC_MISSING_CONST_PROPERTY",
"JSC_MISSING_REQUIRE_STRICT_WARNING",
"JSC_MISSING_SEMICOLON",
"JSC_STRICT_INEXISTENT_PROPERTY",
"JSC_UNKNOWN_EXPR_TYPE",
"JSC_USE_OF_GOOG_PROVIDE",
],
visibility = ["//visibility:public"],
deps = ["@io_bazel_rules_closure//closure/library"],
Expand Down
Loading

0 comments on commit 6b24560

Please sign in to comment.