fix(bazel): add missing binary path for api-extractor (#29202)
`api-extractor` binary is required for external consumers of `ng_module` that want to use the `bundle_dts` flag. This also sets a different api-exttractor binary to use for ng_module, based if it's internal or external. PR Close #29202
This commit is contained in:

committed by
Kara Erickson

parent
4227126305
commit
df354d1b34
@ -33,6 +33,7 @@ compile_ts = _compile_ts
|
||||
DEPS_ASPECTS = _DEPS_ASPECTS
|
||||
ts_providers_dict_to_struct = _ts_providers_dict_to_struct
|
||||
|
||||
DEFAULT_API_EXTRACTOR = "@npm//@angular/bazel/bin:api-extractor"
|
||||
DEFAULT_NG_COMPILER = "@npm//@angular/bazel/bin:ngc-wrapped"
|
||||
DEFAULT_NG_XI18N = "@npm//@angular/bazel/bin:xi18n"
|
||||
FLAT_DTS_FILE_SUFFIX = ".bundle.d.ts"
|
||||
|
@ -9,6 +9,7 @@ load(
|
||||
":external.bzl",
|
||||
"COMMON_ATTRIBUTES",
|
||||
"COMMON_OUTPUTS",
|
||||
"DEFAULT_API_EXTRACTOR",
|
||||
"DEFAULT_NG_COMPILER",
|
||||
"DEFAULT_NG_XI18N",
|
||||
"DEPS_ASPECTS",
|
||||
@ -450,7 +451,7 @@ def ngc_compile_action(
|
||||
ctx.actions.run(
|
||||
progress_message = "Bundling DTS %s" % str(ctx.label),
|
||||
mnemonic = "APIExtractor",
|
||||
executable = ctx.executable._api_extractor,
|
||||
executable = ctx.executable.api_extractor,
|
||||
inputs = filter_inputs,
|
||||
outputs = dts_bundles_out,
|
||||
arguments = [
|
||||
@ -716,8 +717,8 @@ NG_MODULE_RULE_ATTRS = dict(dict(COMMON_ATTRIBUTES, **NG_MODULE_ATTRIBUTES), **{
|
||||
# https://github.com/angular/angular/blob/master/packages/compiler-cli/src/transformers/api.ts
|
||||
"flat_module_out_file": attr.string(),
|
||||
"bundle_dts": attr.bool(default = False),
|
||||
"_api_extractor": attr.label(
|
||||
default = Label("//packages/bazel/src/api-extractor:api_extractor"),
|
||||
"api_extractor": attr.label(
|
||||
default = Label(DEFAULT_API_EXTRACTOR),
|
||||
executable = True,
|
||||
cfg = "host",
|
||||
),
|
||||
|
Reference in New Issue
Block a user