Skip to content

Commit

Permalink
Moves //bazel/browsers/... to //tools/browsers/....
Browse files Browse the repository at this point in the history
Refs #74.

Modifications were just a find-and-replace of `//bazel/browsers` -> `//tools/browsers`. No manual modifications appear to be needed.
  • Loading branch information
dgp1130 committed Jul 29, 2023
1 parent ab2e3ff commit fe85111
Show file tree
Hide file tree
Showing 24 changed files with 45 additions and 45 deletions.
2 changes: 1 addition & 1 deletion WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@ load(
web_test_repositories()

# Load browser binaries.
load("//bazel/browsers:browser_repositories.bzl", "browser_repositories")
load("//tools/browsers:browser_repositories.bzl", "browser_repositories")
browser_repositories()
30 changes: 0 additions & 30 deletions bazel/browsers/BUILD.bazel

This file was deleted.

34 changes: 32 additions & 2 deletions tools/browsers/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# flag, making the browser more easily inspectable.
# See: https://github.com/bazelbuild/rules_webtesting/issues/324

load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")

# Whether to use the debug versions of browsers or the "normal" version if not.
Expand All @@ -15,7 +16,7 @@ config_setting(
name = "use_debug_browsers_config",
flag_values = {":use_debug_browsers": "True"},
visibility = [
"//bazel/browsers:__subpackages__",
"//tools/browsers:__subpackages__",

# Should not be necessary, but is to avoid a bugged visibility error.
# https://github.com/bazelbuild/bazel/issues/19126
Expand All @@ -25,6 +26,35 @@ config_setting(

alias(
name = "chromium-local",
actual = "//bazel/browsers/chromium",
actual = "//tools/browsers/chromium",
visibility = ["//visibility:public"],
)

bzl_library(
name = "browser_archive_repo",
srcs = ["browser_archive_repo.bzl"],
visibility = [
"//tools/browsers/chromium:__pkg__",
"//tools/browsers/firefox:__pkg__",
],
)

bzl_library(
name = "browser_configure",
srcs = ["browser_configure.bzl"],
)

bzl_library(
name = "browser_repositories",
srcs = ["browser_repositories.bzl"],
deps = [
"//tools/browsers/chromium:chromium_bzl",
"//tools/browsers/firefox:firefox_bzl",
],
)

bzl_library(
name = "browser_toolchain_alias",
srcs = ["browser_toolchain_alias.bzl"],
deps = [":browser_configure"],
)
2 changes: 1 addition & 1 deletion bazel/browsers/README.md → tools/browsers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ We manually keep the configuration of these two tools in sync to create a consis

## Bazel

Bazel `karma_web_test_suite` and `protractor_web_test_suite` targets will use Chromium or Firefox provisioned by `//bazel/browsers`.
Bazel `karma_web_test_suite` and `protractor_web_test_suite` targets will use Chromium or Firefox provisioned by `//tools/browsers`.
The version of Chrome and Firefox are specified in the `chromium.bzl` and `firefox.bzl` files in `/bazel/browsers`.

The process of updating the Chrome or Firefox version is not straightforward, but below are dedicated sections for each browser.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def _browser_archive_impl(ctx):
# repository `BUILD.bazel` file that exposes the archive files, together
# with the specified named files using the `browser_configure` rule.
ctx.file("BUILD.bazel", content = """
load("@rules_prerender//bazel/browsers:browser_configure.bzl", "browser_configure")
load("@rules_prerender//tools/browsers:browser_configure.bzl", "browser_configure")
licenses({licenses})
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Unlike the `rules_webtesting` `browser_repositories`, this function defines
separate repositories for each platform.
"""

load("//bazel/browsers/chromium:chromium.bzl", "define_chromium_repositories")
load("//bazel/browsers/firefox:firefox.bzl", "define_firefox_repositories")
load("//tools/browsers/chromium:chromium.bzl", "define_chromium_repositories")
load("//tools/browsers/firefox:firefox.bzl", "define_firefox_repositories")

def browser_repositories():
"""Load pinned `@io_bazel_rules_webtesting` browser versions."""
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("@io_bazel_rules_webtesting//web:web.bzl", "browser")
load("//bazel/browsers:browser_toolchain_alias.bzl", "browser_toolchain_alias")
load("//tools/browsers:browser_toolchain_alias.bzl", "browser_toolchain_alias")

PLATFORM_METADATA = select({
"//tools/constraints:linux_x64": [
Expand Down Expand Up @@ -44,6 +44,6 @@ browser_toolchain_alias(
bzl_library(
name = "chromium_bzl",
srcs = ["chromium.bzl"],
visibility = ["//bazel/browsers:__pkg__"],
deps = ["//bazel/browsers:browser_archive_repo"],
visibility = ["//tools/browsers:__pkg__"],
deps = ["//tools/browsers:browser_archive_repo"],
)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Defines repositories for the Chromium browser."""

load("//bazel/browsers:browser_archive_repo.bzl", "browser_archive")
load("//tools/browsers:browser_archive_repo.bzl", "browser_archive")

def define_chromium_repositories():
# To update to a newer version of Chromium see instructions in
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("@io_bazel_rules_webtesting//web:web.bzl", "browser")
load("//bazel/browsers:browser_toolchain_alias.bzl", "browser_toolchain_alias")
load("//tools/browsers:browser_toolchain_alias.bzl", "browser_toolchain_alias")

PLATFORM_METADATA = select({
"//tools/constraints:linux_x64": [
Expand Down Expand Up @@ -51,6 +51,6 @@ browser_toolchain_alias(
bzl_library(
name = "firefox_bzl",
srcs = ["firefox.bzl"],
visibility = ["//bazel/browsers:__pkg__"],
deps = ["//bazel/browsers:browser_archive_repo"],
visibility = ["//tools/browsers:__pkg__"],
deps = ["//tools/browsers:browser_archive_repo"],
)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Defines repositories for the Firefox browser."""

load("//bazel/browsers:browser_archive_repo.bzl", "browser_archive")
load("//tools/browsers:browser_archive_repo.bzl", "browser_archive")

def define_firefox_repositories():
browser_archive(
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit fe85111

Please sign in to comment.