angular/tools/defaults2.bzl
Paul Gschwendtner a1bf58e32e build: migrate symbol-extractor to ts_project (#61156)
Migrates the symbol-extractor code to `ts_project`.

PR Close #61156
2025-05-07 11:28:59 -07:00

43 lines
1.3 KiB
Python

load("@rules_angular//src/ng_project:index.bzl", _ng_project = "ng_project")
load("//tools/bazel:module_name.bzl", "compute_module_name")
load("//tools/bazel:ts_project_interop.bzl", _ts_project = "ts_project")
def ts_project(
name,
source_map = True,
testonly = False,
tsconfig = None,
**kwargs):
module_name = kwargs.pop("module_name", compute_module_name(testonly))
if tsconfig == None and native.package_name().startswith("packages"):
tsconfig = "//packages:tsconfig_test" if testonly else "//packages:tsconfig_build"
_ts_project(
name,
source_map = source_map,
module_name = module_name,
testonly = testonly,
tsconfig = tsconfig,
**kwargs
)
def ng_project(
name,
source_map = True,
testonly = False,
tsconfig = None,
**kwargs):
module_name = kwargs.pop("module_name", compute_module_name(testonly))
if tsconfig == None and native.package_name().startswith("packages"):
tsconfig = "//packages:tsconfig_test" if testonly else "//packages:tsconfig_build"
_ts_project(
name,
source_map = source_map,
module_name = module_name,
rule_impl = _ng_project,
testonly = testonly,
tsconfig = tsconfig,
**kwargs
)