mirror of
https://github.com/angular/angular.git
synced 2026-11-30 10:27:51 -05:00
Marks the beginning of a migration over to building Angular devtools with Bazel. This commit brings in tooling from the canonical angular bazel example repository and includes the necessary dependencies in the package.json
87 lines
3.0 KiB
Python
87 lines
3.0 KiB
Python
# 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 = "angular_devtools",
|
|
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")
|
|
|
|
http_archive(
|
|
name = "bazel_skylib",
|
|
sha256 = "1c531376ac7e5a180e0237938a2536de0c54d93f5c278634818e0efc952dd56c",
|
|
urls = [
|
|
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.3/bazel-skylib-1.0.3.tar.gz",
|
|
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.3/bazel-skylib-1.0.3.tar.gz",
|
|
],
|
|
)
|
|
|
|
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
|
|
|
|
bazel_skylib_workspace()
|
|
|
|
# Fetch rules_nodejs so we can install our npm dependencies
|
|
http_archive(
|
|
name = "build_bazel_rules_nodejs",
|
|
sha256 = "8f5f192ba02319254aaf2cdcca00ec12eaafeb979a80a1e946773c520ae0a2c9",
|
|
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/3.7.0/rules_nodejs-3.7.0.tar.gz"],
|
|
)
|
|
|
|
load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories")
|
|
|
|
# Setup the Node.js toolchain
|
|
node_repositories(
|
|
node_version = "14.16.1",
|
|
package_json = ["//:package.json"],
|
|
)
|
|
|
|
# Fetch sass rules for compiling sass files
|
|
http_archive(
|
|
name = "io_bazel_rules_sass",
|
|
sha256 = "dcead3cbe749d8e9467d28e326ea8ea3a126bc6095a0e1665222c94ff9db6fcc",
|
|
strip_prefix = "rules_sass-1.36.0",
|
|
urls = [
|
|
"https://github.com/bazelbuild/rules_sass/archive/1.36.0.zip",
|
|
"https://mirror.bazel.build/github.com/bazelbuild/rules_sass/archive/1.36.0.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 karma_web_test 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()
|