Skip to content

Commit 1007079

Browse files
josephperrottthePunderWoman
authored andcommitted
build: update compiler-cli to not be stamped when used for the compiler in ng_project (#61539)
The compiler-cli package needs to be unstamped and will the resulting generated code will be stamped as expected. PR Close #61539
1 parent eac4229 commit 1007079

3 files changed

Lines changed: 22 additions & 17 deletions

File tree

packages/compiler-cli/BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,14 @@ pkg_npm(
150150
# Long-term, `pkg_npm` will be migrated to `npm_package` in general.
151151
npm_package(
152152
name = "pkg",
153-
srcs = [":npm_package_nosub"],
153+
srcs = [":npm_package"],
154154
data = [
155155
# Needed because compiler is a dev dependency (to satisfy the peer dependency)
156156
# and `rules_js` only makes transitive production dependencies available.
157157
":node_modules/@angular/compiler",
158158
],
159159
replace_prefixes = {
160-
"npm_package_nosub/": "",
160+
"npm_package/": "",
161161
},
162162
)
163163

packages/compiler/BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ ng_package(
4848
# Long-term, `pkg_npm` will be migrated to `npm_package` in general.
4949
npm_package(
5050
name = "pkg",
51-
srcs = [":npm_package"],
51+
srcs = [":npm_package_nosub"],
5252
replace_prefixes = {
53-
"npm_package/": "",
53+
"npm_package_nosub/": "",
5454
},
5555
)
5656

tools/defaults.bzl

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ def ng_package(name, readme_md = None, license_banner = None, license = None, de
173173
if not license:
174174
license = "//:LICENSE"
175175
visibility = kwargs.pop("visibility", None)
176+
tags = kwargs.pop("tags", [])
176177

177178
common_substitutions = dict(kwargs.pop("substitutions", {}), **PKG_GROUP_REPLACEMENTS)
178179
substitutions = dict(common_substitutions, **{
@@ -197,6 +198,23 @@ def ng_package(name, readme_md = None, license_banner = None, license = None, de
197198
rollup_config_tmpl = _INTERNAL_NG_PACKAGE_DEFAULT_ROLLUP_CONFIG_TMPL,
198199
rollup = _INTERNAL_NG_PACKAGE_DEFAULT_ROLLUP,
199200
visibility = visibility,
201+
tags = tags,
202+
**kwargs
203+
)
204+
205+
_ng_package(
206+
name = "%s_nosub" % name,
207+
deps = deps,
208+
validate = True,
209+
readme_md = readme_md,
210+
license = license,
211+
license_banner = license_banner,
212+
substitutions = common_substitutions,
213+
ng_packager = _INTERNAL_NG_PACKAGE_PACKAGER,
214+
rollup_config_tmpl = _INTERNAL_NG_PACKAGE_DEFAULT_ROLLUP_CONFIG_TMPL,
215+
rollup = _INTERNAL_NG_PACKAGE_DEFAULT_ROLLUP,
216+
visibility = visibility,
217+
tags = ["manual"],
200218
**kwargs
201219
)
202220

@@ -213,7 +231,6 @@ def ng_package(name, readme_md = None, license_banner = None, license = None, de
213231
def pkg_npm(name, deps = [], validate = True, **kwargs):
214232
"""Default values for pkg_npm"""
215233
visibility = kwargs.pop("visibility", None)
216-
tags = kwargs.pop("tags", [])
217234

218235
common_substitutions = dict(kwargs.pop("substitutions", {}), **PKG_GROUP_REPLACEMENTS)
219236
substitutions = dict(common_substitutions, **{
@@ -247,18 +264,6 @@ def pkg_npm(name, deps = [], validate = True, **kwargs):
247264
}),
248265
deps = [":%s_js_module_output" % name],
249266
visibility = visibility,
250-
tags = tags,
251-
**kwargs
252-
)
253-
254-
_pkg_npm(
255-
name = "%s_nosub" % name,
256-
validate = validate,
257-
substitutions = common_substitutions,
258-
deps = [":%s_js_module_output" % name],
259-
visibility = visibility,
260-
# should not be built unless it is a dependency of another rule
261-
tags = ["manual"],
262267
**kwargs
263268
)
264269

0 commit comments

Comments
 (0)