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
This commit is contained in:
Alex Rickabaugh 2018-07-26 09:16:07 -07:00 committed by Igor Minar
parent 6fe865b080
commit 0d1d5898e3
1 changed files with 4 additions and 4 deletions

View File

@ -14,7 +14,7 @@ load(":rules_typescript.bzl",
"ts_providers_dict_to_struct", "ts_providers_dict_to_struct",
) )
def _compile_strategy(ctx): def compile_strategy(ctx):
"""Detect which strategy should be used to implement ng_module. """Detect which strategy should be used to implement ng_module.
Depending on the value of the 'compile' define flag or the '_global_mode' attribute, ng_module Depending on the value of the 'compile' define flag or the '_global_mode' attribute, ng_module
@ -50,7 +50,7 @@ def _compiler_name(ctx):
the name of the current compiler to be displayed in build output the name of the current compiler to be displayed in build output
""" """
strategy = _compile_strategy(ctx) strategy = compile_strategy(ctx)
if strategy == 'legacy': if strategy == 'legacy':
return 'ngc' return 'ngc'
elif strategy == 'global': elif strategy == 'global':
@ -72,7 +72,7 @@ def _enable_ivy_value(ctx):
the value of enableIvy that needs to be set in angularCompilerOptions in the generated tsconfig the value of enableIvy that needs to be set in angularCompilerOptions in the generated tsconfig
""" """
strategy = _compile_strategy(ctx) strategy = compile_strategy(ctx)
if strategy == 'legacy': if strategy == 'legacy':
return False return False
elif strategy == 'global': elif strategy == 'global':
@ -95,7 +95,7 @@ def _include_ng_files(ctx):
factory files), false otherwise factory files), false otherwise
""" """
strategy = _compile_strategy(ctx) strategy = compile_strategy(ctx)
return strategy == 'legacy' or strategy == 'global' return strategy == 'legacy' or strategy == 'global'
def _basename_of(ctx, file): def _basename_of(ctx, file):