| # The WORKSPACE file tells Bazel that this directory is a "workspace", which is like a project root. | |
| # The content of this file specifies all the external dependencies Bazel needs to perform a build. | |
| #################################### | |
| # ESModule imports (and TypeScript imports) can be absolute starting with the workspace name. | |
| # The name of the workspace should match the npm package where we publish, so that these | |
| # imports also make sense when referencing the published package. | |
| workspace( | |
| name = "examples_angular_view_engine", | |
| managed_directories = {"@npm": ["node_modules"]}, | |
| ) | |
| # These rules are built-into Bazel but we need to load them first to download more rules | |
| load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | |
| # Fetch rules_nodejs so we can install our npm dependencies | |
| http_archive( | |
| name = "build_bazel_rules_nodejs", | |
| sha256 = "e79c08a488cc5ac40981987d862c7320cee8741122a2649e9b08e850b6f20442", | |
| urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/3.8.0/rules_nodejs-3.8.0.tar.gz"], | |
| ) | |
| # Fetch sass rules for compiling sass files | |
| http_archive( | |
| name = "io_bazel_rules_sass", | |
| sha256 = "90efc362ad7916e4477a1ccb3e2d87c452bb9433fe81793be7acdf442962317b", | |
| strip_prefix = "rules_sass-1.37.5", | |
| urls = [ | |
| "https://github.com/bazelbuild/rules_sass/archive/1.37.5.zip", | |
| "https://mirror.bazel.build/github.com/bazelbuild/rules_sass/archive/1.37.5.zip", | |
| ], | |
| ) | |
| # Check the bazel version and download npm dependencies | |
| load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install") | |
| # Setup the Node.js toolchain & install our npm dependencies into @npm | |
| yarn_install( | |
| name = "npm", | |
| package_json = "//:package.json", | |
| yarn_lock = "//:yarn.lock", | |
| ) | |
| # Load @bazel/protractor dependencies | |
| load("@npm//@bazel/protractor:package.bzl", "npm_bazel_protractor_dependencies") | |
| npm_bazel_protractor_dependencies() | |
| # Load karma dependencies | |
| http_archive( | |
| name = "io_bazel_rules_webtesting", | |
| sha256 = "9bb461d5ef08e850025480bab185fd269242d4e533bca75bfb748001ceb343c3", | |
| urls = ["https://github.com/bazelbuild/rules_webtesting/releases/download/0.3.3/rules_webtesting.tar.gz"], | |
| ) | |
| # Setup the rules_webtesting toolchain | |
| load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories") | |
| web_test_repositories() | |
| load("@io_bazel_rules_webtesting//web/versioned:browsers-0.3.2.bzl", "browser_repositories") | |
| browser_repositories( | |
| chromium = True, | |
| firefox = True, | |
| ) | |
| # Setup the rules_sass toolchain | |
| load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories") | |
| sass_repositories() | |
| ################################ | |
| # Support for Remote Execution # | |
| ################################ | |
| http_archive( | |
| name = "bazel_toolchains", | |
| sha256 = "179ec02f809e86abf56356d8898c8bd74069f1bd7c56044050c2cd3d79d0e024", | |
| strip_prefix = "bazel-toolchains-4.1.0", | |
| urls = [ | |
| "https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/releases/download/4.1.0/bazel-toolchains-4.1.0.tar.gz", | |
| "https://github.com/bazelbuild/bazel-toolchains/releases/download/4.1.0/bazel-toolchains-4.1.0.tar.gz", | |
| ], | |
| ) |