From 0d1d5898e370d111b0e7840c3231bbe3f50173a7 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 4244a74567..be0ef7a001 100644 --- a/packages/bazel/src/ng_module.bzl +++ b/packages/bazel/src/ng_module.bzl @@ -14,7 +14,7 @@ load(":rules_typescript.bzl", "ts_providers_dict_to_struct", ) -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 @@ -50,7 +50,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': @@ -72,7 +72,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': @@ -95,7 +95,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):