From 2d0e642dbe7baa9b180a3dc8ebd71add638b791e Mon Sep 17 00:00:00 2001 From: Alex Rickabaugh Date: Thu, 26 Jul 2018 09:16:07 -0700 Subject: [PATCH] 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 --- packages/bazel/src/ng_module.bzl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/bazel/src/ng_module.bzl b/packages/bazel/src/ng_module.bzl index b8fd347229..409d7c6c07 100644 --- a/packages/bazel/src/ng_module.bzl +++ b/packages/bazel/src/ng_module.bzl @@ -15,7 +15,7 @@ load( "tsc_wrapped_tsconfig", ) -def _compile_strategy(ctx): +def compile_strategy(ctx): """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 @@ -51,7 +51,7 @@ def _compiler_name(ctx): the name of the current compiler to be displayed in build output """ - strategy = _compile_strategy(ctx) + strategy = compile_strategy(ctx) if strategy == "legacy": return "ngc" elif strategy == "global": @@ -73,7 +73,7 @@ def _enable_ivy_value(ctx): 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": return False elif strategy == "global": @@ -96,7 +96,7 @@ def _include_ng_files(ctx): factory files), false otherwise """ - strategy = _compile_strategy(ctx) + strategy = compile_strategy(ctx) return strategy == "legacy" or strategy == "global" def _basename_of(ctx, file):