Skip to content

Commit 0d1d589

Browse files
alxhubIgorMinar
authored andcommitted
fix(bazel): allow compile_strategy to be (privately) imported (#25080)
compile_strategy() is used to decide whether to build Angular code using ngc (legacy) or ngtsc (local). In order for g3 BUILD rules to switch properly and allow testing of Ivy in g3, they need to import this function. This commit removes the _ prefix which allows the function to be imported. PR Close #25080
1 parent 6fe865b commit 0d1d589

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/bazel/src/ng_module.bzl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ load(":rules_typescript.bzl",
1414
"ts_providers_dict_to_struct",
1515
)
1616

17-
def _compile_strategy(ctx):
17+
def compile_strategy(ctx):
1818
"""Detect which strategy should be used to implement ng_module.
1919
2020
Depending on the value of the 'compile' define flag or the '_global_mode' attribute, ng_module
@@ -50,7 +50,7 @@ def _compiler_name(ctx):
5050
the name of the current compiler to be displayed in build output
5151
"""
5252

53-
strategy = _compile_strategy(ctx)
53+
strategy = compile_strategy(ctx)
5454
if strategy == 'legacy':
5555
return 'ngc'
5656
elif strategy == 'global':
@@ -72,7 +72,7 @@ def _enable_ivy_value(ctx):
7272
the value of enableIvy that needs to be set in angularCompilerOptions in the generated tsconfig
7373
"""
7474

75-
strategy = _compile_strategy(ctx)
75+
strategy = compile_strategy(ctx)
7676
if strategy == 'legacy':
7777
return False
7878
elif strategy == 'global':
@@ -95,7 +95,7 @@ def _include_ng_files(ctx):
9595
factory files), false otherwise
9696
"""
9797

98-
strategy = _compile_strategy(ctx)
98+
strategy = compile_strategy(ctx)
9999
return strategy == 'legacy' or strategy == 'global'
100100

101101
def _basename_of(ctx, file):

0 commit comments

Comments
 (0)