refactor(upgrade): use Bazel packages to avoid symlinks in the source (#29466)

Previously we had to share code between upgrade/dynamic and upgrade/static
by symlinking the `src` folder, which allowed both packages to access
the upgrade/common files.

These symlinks are always problematic on Windows, where we had to run
a script to re-link them, and restore them.

This change uses Bazel packages to share the `upgrade/common` code,
which avoids the need for symlinking the `src` folder.

Also, the Windows specific scripts that fixup the symlinks have also
been removed as there is no more need for them.

PR Close #29466
This commit is contained in:
Pete Bacon Darwin
2019-03-22 09:42:52 +00:00
committed by Jason Aden
parent e5201f92fc
commit 9f54d76ef5
49 changed files with 219 additions and 162 deletions

View File

@ -3,8 +3,12 @@ load(":public_api_guard.bzl", "generate_targets")
generate_targets(golden_files = glob(
["*/**/*.d.ts"],
# exclude the following target because we have an explicit target for it bellow, see :core_api
exclude = ["core/core.d.ts"],
# exclude the following target because we have an explicit target for it bellow, see :core_api, etc
exclude = [
"core/core.d.ts",
"upgrade/upgrade.d.ts",
"upgrade/static.d.ts",
],
))
# Explicit target because core is broken down into sub-packages.
@ -25,6 +29,32 @@ ts_api_guardian_test(
],
)
ts_api_guardian_test(
name = "upgrade_api",
actual = "angular/packages/upgrade/upgrade.d.ts",
data = ["//tools/public_api_guard:upgrade/upgrade.d.ts"] + [
"//packages/upgrade",
"//packages/upgrade/src/common",
],
golden = "angular/tools/public_api_guard/upgrade/upgrade.d.ts",
tags = [
"fixme-ivy-aot", # ivy no longer emits generated index file
],
)
ts_api_guardian_test(
name = "upgrade_static_api",
actual = "angular/packages/upgrade/static/index.d.ts",
data = ["//tools/public_api_guard:upgrade/static.d.ts"] + [
"//packages/upgrade/static",
"//packages/upgrade/src/common",
],
golden = "angular/tools/public_api_guard/upgrade/static.d.ts",
tags = [
"fixme-ivy-aot", # ivy no longer emits generated index file
],
)
# explicit target because the d.ts file is nested in the core and not part of typical public d.ts api
ts_api_guardian_test(
name = "ng_global_utils_api",