Skip to content

Commit

Permalink
feat(bazel): expose toolchain aliases for exposed browsers
Browse files Browse the repository at this point in the history
Exposes toolchain alias targets for all exposed browsers by the
dev-infra Bazel package. i.e. Chromium and Firefox. These can then
be used within integration tests, or other e.g. webdriver tests using
Bazel make variable expansion.
  • Loading branch information
devversion committed Nov 5, 2021
1 parent 4dc6a89 commit 818ad64
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions bazel/browsers/chromium/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("@io_bazel_rules_webtesting//web:web.bzl", "browser")
load("//bazel/browsers:browser_toolchain_alias.bzl", "browser_toolchain_alias")

package(default_visibility = ["//visibility:public"])

Expand Down Expand Up @@ -27,6 +28,16 @@ browser(
}),
)

browser_toolchain_alias(
name = "toolchain_alias",
metadata = select({
"//bazel/constraints:linux_x64": "@org_chromium_chromium_linux_x64//:metadata",
"//bazel/constraints:macos_x64": "@org_chromium_chromium_macos_x64//:metadata",
"//bazel/constraints:macos_arm64": "@org_chromium_chromium_macos_arm64//:metadata",
"//bazel/constraints:windows_x64": "@org_chromium_chromium_windows//:metadata",
}),
)

# Make source files available for distribution via pkg_npm
filegroup(
name = "files",
Expand Down
11 changes: 11 additions & 0 deletions bazel/browsers/firefox/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("@io_bazel_rules_webtesting//web:web.bzl", "browser")
load("//bazel/browsers:browser_toolchain_alias.bzl", "browser_toolchain_alias")

package(default_visibility = ["//visibility:public"])

Expand Down Expand Up @@ -34,6 +35,16 @@ browser(
}),
)

browser_toolchain_alias(
name = "toolchain_alias",
metadata = select({
"//bazel/constraints:linux_x64": "@org_mozilla_firefox_linux_x64//:metadata",
# Firefox has a launcher that conditionally starts x64/arm64
"//bazel/constraints:macos_x64": "@org_mozilla_firefox_macos//:metadata",
"//bazel/constraints:macos_arm64": "@org_mozilla_firefox_macos//:metadata",
}),
)

# Make source files available for distribution via pkg_npm
filegroup(
name = "files",
Expand Down

0 comments on commit 818ad64

Please sign in to comment.