mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-19 20:52:06 +08:00
83 lines
2.7 KiB
Python
83 lines
2.7 KiB
Python
workspace(
|
|
name = "angular_cli",
|
|
managed_directories = {"@npm": ["node_modules"]},
|
|
)
|
|
|
|
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
|
|
|
http_archive(
|
|
name = "bazel_skylib",
|
|
sha256 = "af87959afe497dc8dfd4c6cb66e1279cb98ccc84284619ebfec27d9c09a903de",
|
|
urls = [
|
|
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.2.0/bazel-skylib-1.2.0.tar.gz",
|
|
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.2.0/bazel-skylib-1.2.0.tar.gz",
|
|
],
|
|
)
|
|
|
|
http_archive(
|
|
name = "build_bazel_rules_nodejs",
|
|
sha256 = "d63ecec7192394f5cc4ad95a115f8a6c9de55c60d56c1f08da79c306355e4654",
|
|
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.6.1/rules_nodejs-4.6.1.tar.gz"],
|
|
)
|
|
|
|
http_archive(
|
|
name = "rules_pkg",
|
|
sha256 = "62eeb544ff1ef41d786e329e1536c1d541bb9bcad27ae984d57f18f314018e66",
|
|
urls = ["https://github.com/bazelbuild/rules_pkg/releases/download/0.6.0/rules_pkg-0.6.0.tar.gz"],
|
|
)
|
|
|
|
load("@bazel_tools//tools/sh:sh_configure.bzl", "sh_configure")
|
|
|
|
sh_configure()
|
|
|
|
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
|
|
|
|
bazel_skylib_workspace()
|
|
|
|
load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
|
|
|
|
rules_pkg_dependencies()
|
|
|
|
# Check the bazel version and download npm dependencies
|
|
load("@build_bazel_rules_nodejs//:index.bzl", "check_bazel_version", "check_rules_nodejs_version", "node_repositories", "yarn_install")
|
|
|
|
# Bazel version must be at least the following version because:
|
|
# - 0.26.0 managed_directories feature added which is required for nodejs rules 0.30.0
|
|
# - 0.27.0 has a fix for managed_directories after `rm -rf node_modules`
|
|
check_bazel_version(
|
|
message = """
|
|
You no longer need to install Bazel on your machine.
|
|
Angular has a dependency on the @bazel/bazelisk package which supplies it.
|
|
Try running `yarn bazel` instead.
|
|
(If you did run that, check that you've got a fresh `yarn install`)
|
|
""",
|
|
minimum_bazel_version = "4.0.0",
|
|
)
|
|
|
|
check_rules_nodejs_version(minimum_version_string = "2.0.0")
|
|
|
|
# Setup the Node.js toolchain
|
|
node_repositories(
|
|
node_version = "14.17.1",
|
|
package_json = ["//:package.json"],
|
|
)
|
|
|
|
yarn_install(
|
|
name = "npm",
|
|
package_json = "//:package.json",
|
|
yarn_lock = "//:yarn.lock",
|
|
)
|
|
|
|
http_archive(
|
|
name = "aspect_bazel_lib",
|
|
sha256 = "534c9c61b72c257c95302d544984fd8ee63953c233292c5b6952ca5b33cd225e",
|
|
strip_prefix = "bazel-lib-0.4.2",
|
|
url = "https://github.com/aspect-build/bazel-lib/archive/v0.4.2.tar.gz",
|
|
)
|
|
|
|
load("@aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies", "register_jq_toolchains")
|
|
|
|
aspect_bazel_lib_dependencies()
|
|
|
|
register_jq_toolchains(version = "1.6")
|