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

@ -28,6 +28,10 @@ ng_rollup_bundle(
js_size_tracking_test(
name = "size_test",
src = "angular/packages/core/test/bundling/core_all/bundle.min.js",
# Ensures that this target runs with "--config=ivy" (aka Ivy). This is necessary
# because we don't run this test on CI currently, but if we run it manually, we need to
# ensure that it runs with Ivy for proper size comparisons.
angular_ivy_enabled = "True",
data = [
"bundle.golden_size_map_ivy.json",
":bundle",
@ -35,10 +39,6 @@ js_size_tracking_test(
golden_file = "angular/packages/core/test/bundling/core_all/bundle.golden_size_map_ivy.json",
max_byte_diff = 250,
max_percentage_diff = 15,
# Ensures that this target runs with "--define=compile=aot" (aka Ivy). This is necessary
# because we don't run this test on CI currently, but if we run it manually, we need to
# ensure that it runs with Ivy for proper size comparisons.
required_compile_mode = "aot",
source_map = "angular/packages/core/test/bundling/core_all/bundle.min.js.map",
tags = [
"ivy-only",
@ -49,6 +49,10 @@ js_size_tracking_test(
js_size_tracking_test(
name = "size_test_view_engine",
src = "angular/packages/core/test/bundling/core_all/bundle.min.js",
# Ensures that this target runs with `--config=view-engine`. This is
# necessary because we don't run this test on CI currently, but if we run it manually,
# we need to ensure that it runs with View Engine for proper size comparisons.
angular_ivy_enabled = "False",
data = [
"bundle.golden_size_map_view_engine.json",
":bundle",
@ -56,10 +60,6 @@ js_size_tracking_test(
golden_file = "angular/packages/core/test/bundling/core_all/bundle.golden_size_map_view_engine.json",
max_byte_diff = 250,
max_percentage_diff = 15,
# Ensures that this target runs with "--define=compile=legacy" (View Engine). This is
# necessary because we don't run this test on CI currently, but if we run it manually,
# we need to ensure that it runs with View Engine for proper size comparisons.
required_compile_mode = "legacy",
source_map = "angular/packages/core/test/bundling/core_all/bundle.min.js.map",
tags = [
"manual",

View File

@ -6,19 +6,9 @@ package(default_visibility = ["//visibility:public"])
ts_library(
name = "reflect_metadata",
srcs = [
"src/reflect_metadata_aot.ts",
"src/reflect_metadata_jit.ts",
"src/reflect_metadata_legacy.ts",
":metadata_switch",
"src/reflect_metadata.ts",
],
module_name = "@angular/core/test/bundling/util/src/reflect_metadata",
module_root = "src/reflect_metadata",
deps = ["@npm//reflect-metadata"],
)
# See packages/core/BUILD.bazel.
genrule(
name = "metadata_switch",
outs = ["src/reflect_metadata.ts"],
cmd = "echo import \"'./reflect_metadata_$(compile)';\" > $@",
)

View File

@ -6,4 +6,4 @@
* found in the LICENSE file at https://angular.io/license
*/
import './reflect_metadata_legacy';
export const UNUSED = true;

View File

@ -1,9 +0,0 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export const UNUSED = true;

View File

@ -1,9 +0,0 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import 'reflect-metadata';

View File

@ -1,9 +0,0 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export const UNUSED = true;