1
0
mirror of https://github.com/angular/angular-cli.git synced 2025-05-28 02:58:04 +08:00
Paul Gschwendtner 2236bc185a build: remove legacy defaults.bzl macro file
This file is currently no longer necessary after migrating all consumers
to their `rules_js` variants, so we can delete the file.

In follow-ups we will consider renaming `defaults2.bzl` back to this
file, or have a better name altogether.
2025-01-30 11:16:46 +01:00

49 lines
1.6 KiB
Python

load("@aspect_bazel_lib//lib:copy_to_bin.bzl", _copy_to_bin = "copy_to_bin")
load("@aspect_rules_jasmine//jasmine:defs.bzl", _jasmine_test = "jasmine_test")
load("@aspect_rules_js//js:defs.bzl", _js_binary = "js_binary")
load("@npm//@angular/bazel:index.bzl", _ng_package = "ng_package")
load("//tools:interop.bzl", _ts_project = "ts_project")
load("//tools:substitutions.bzl", "substitutions")
load("//tools/bazel:npm_package.bzl", _npm_package = "npm_package")
def ts_project(**kwargs):
_ts_project(**kwargs)
def npm_package(**kwargs):
_npm_package(**kwargs)
def copy_to_bin(**kwargs):
_copy_to_bin(**kwargs)
def js_binary(**kwargs):
_js_binary(**kwargs)
def ng_package(deps = [], **kwargs):
_ng_package(
deps = deps,
license = "//:LICENSE",
substitutions = select({
"//:stamp": substitutions["legacy"]["stamp"],
"//conditions:default": substitutions["legacy"]["nostamp"],
}),
**kwargs
)
def jasmine_test(data = [], args = [], **kwargs):
# Create relative path to root, from current package dir. Necessary as
# we change the `chdir` below to the package directory.
relative_to_root = "/".join([".."] * len(native.package_name().split("/")))
_jasmine_test(
node_modules = "//:node_modules",
chdir = native.package_name(),
args = [
"--require=%s/node_modules/source-map-support/register.js" % relative_to_root,
"**/*spec.js",
"**/*spec.mjs",
"**/*spec.cjs",
] + args,
data = data + ["//:node_modules/source-map-support"],
**kwargs
)