Skip to content

Commit 3d9f4e7

Browse files
sbarfurthdevversion
authored andcommitted
Add testonly parameter to ng_project configuration
Ensures that callers can propagate `testonly` into the macro completely. Otherwise if the macro is marked `testonly`, only the `ts_project` will be marked through `kwargs` and the build would fail due to the non-test-only dependency on the project config.
1 parent e975faa commit 3d9f4e7

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/ng_project/index.bzl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ def ng_project(
88
angular_compiler_options = {},
99
assets = [],
1010
tsconfig = None,
11+
testonly = False,
1112
**kwargs):
1213
"""Angular compiler specific version of ts_project, running ngc on the provided files.
1314
@@ -30,6 +31,7 @@ def ng_project(
3031
name = "%s_ng_project_tsconfig" % name,
3132
angular_compiler_options = json.encode(angular_compiler_options),
3233
tsconfig = tsconfig,
34+
testonly = testonly,
3335
)
3436

3537
ts_project(
@@ -47,5 +49,6 @@ def ng_project(
4749
"@rules_angular//src/ng_project/config:partial_compilation_enabled": "Compiling Angular TS (partial compilation): {label}",
4850
"//conditions:default": "Compiling Angular TS: {label}",
4951
}),
52+
testonly = testonly,
5053
**kwargs
5154
)

0 commit comments

Comments
 (0)