build: migrate determining if Ivy is enabled in typescript genrule files to use angular_ivy_enabled (#33983)

Use angular_ivy_enabled to determine if Ivy is being used for the ivy_test_selector.ts symbols.
Additionally, remove the reflect_metadata genrules as we not longer have a "jit" compile option
so all possible invocations result in the same generated file.  Instead we can just commit this
file.

PR Close #33983
This commit is contained in:
Joey Perrott
2019-11-22 12:14:39 -08:00
committed by Matias Niemelä
parent 6bf258178d
commit a122311773
9 changed files with 24 additions and 62 deletions

View File

@ -21,14 +21,14 @@ ng_module(
## Controls if Ivy is enabled. (Temporary target until we permanently switch over to Ivy)
##
## This file generates `src/bazel_define_compile_value.ts` file which reexports
## `--define=compile` value as `bazelDefineCompileValue` symbols so that runtime can detect
## which mode it is running in.
## This file generates `src/angular_ivy_enabled.ts` file which exports a truthy value
## whether Ivy should be enabled based on the `--defined=angular_ivy_enabled` value so
## runtime can detect which mode it is running in.
##
## See: `//.bazelrc` where `--define=ivy=legacy` is defined as default.
## See: `./src/bazel_define_compile_value.ts` for more details.
## See: `//.bazelrc` where `--define=angular_ivy_enabled=false` is defined as default.
## See: `./src/angular_ivy_enabled.ts` for more details.
genrule(
name = "bazel_define_compile_value",
outs = ["src/bazel_define_compile_value.ts"],
cmd = "echo export const bazelDefineCompileValue = \"'$(compile)'\"\; > $@",
name = "angular_ivy_enabled",
outs = ["src/angular_ivy_enabled.ts"],
cmd = "echo export const ivyEnabled = \"'True'.toString() == '$(angular_ivy_enabled)'\"\; > $@",
)