-
Notifications
You must be signed in to change notification settings - Fork 12k
/
Copy pathdefaults2.bzl
48 lines (41 loc) · 1.61 KB
/
defaults2.bzl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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
)