forked from angular/angular
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
packages.bzl
127 lines (118 loc) Β· 3.75 KB
/
packages.bzl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# Copyright Google LLC 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
"""Packages published to npm"""
load("@build_bazel_rules_nodejs//internal/linker:npm_link.bzl", "npm_link")
def to_package_label(package_name):
"""Get a label corresponding to the npm_package target for the package name"""
if package_name == "angular-in-memory-web-api":
return "//packages/misc/angular-in-memory-web-api:npm_package"
return "//packages/{package_name}:npm_package".format(package_name = package_name.replace("@angular/", ""))
def _exclude_pkgs(packages, *args):
modified_packages = packages[:]
for pkg in args:
modified_packages.remove(pkg)
return modified_packages
def link_packages(packages = []):
linked_packages = []
for package in packages:
pkg_name = Label(package).package
if pkg_name in ALL_PACKAGES:
name = "%s_linked" % pkg_name.replace("@angular/", "").replace("/", "_")
npm_link(
name = name,
target = to_package_label(pkg_name),
package_name = pkg_name,
tags = ["manual"],
)
linked_packages += [":%s" % name]
else:
linked_packages += [package]
return linked_packages
# All framework packages published to NPM.
ALL_PACKAGES = [
"@angular/animations",
"@angular/benchpress",
"@angular/common",
"@angular/compiler",
"@angular/compiler-cli",
"@angular/core",
"@angular/elements",
"@angular/forms",
"@angular/language-service",
"@angular/localize",
"@angular/platform-browser",
"@angular/platform-browser-dynamic",
"@angular/platform-server",
"@angular/router",
"@angular/service-worker",
"@angular/upgrade",
"angular-in-memory-web-api",
"zone.js",
]
# Packages used by integration tests
INTEGRATION_PACKAGES = _exclude_pkgs(ALL_PACKAGES, "angular-in-memory-web-api")
# Packages used by example e2e tests
AIO_EXAMPLE_PACKAGES = _exclude_pkgs(ALL_PACKAGES, "@angular/benchpress")
# Package names under //packages that have `files_for_docgen` targets
# including files needed for AIO doc generation.
DOCS_ENTRYPOINTS = [
"animations",
"animations/browser",
"animations/browser/testing",
"common",
"common/http",
"common/http/testing",
"common/testing",
"common/upgrade",
"compiler",
"core",
"core/rxjs-interop",
"core/src/compiler",
"core/src/di/interface",
"core/src/interface",
"core/src/reflection",
"core/src/util",
"core/testing",
"elements",
"examples/common",
"examples/core",
"examples/core/di/ts/forward_ref",
"examples/core/testing/ts",
"examples/forms",
"examples/platform-browser",
"examples/router/activated-route",
"examples/router/testing",
"examples/router",
"examples/service-worker/push",
"examples/service-worker/registration-options",
"examples/test-utils",
"examples/testing",
"examples/upgrade/static/ts/full",
"examples/upgrade/static/ts/lite",
"examples/upgrade/static/ts/lite-multi",
"examples/upgrade/static/ts/lite-multi-shared",
"forms",
"localize",
"localize/init",
"localize/src/localize",
"localize/src/utils",
"platform-browser",
"platform-browser-dynamic",
"platform-browser-dynamic/testing",
"platform-browser/animations",
"platform-browser/animations/async",
"platform-browser/testing",
"platform-server",
"platform-server/init",
"platform-server/testing",
"router",
"router/testing",
"router/upgrade",
"service-worker",
"upgrade",
"upgrade/src/common",
"upgrade/static",
"upgrade/static/testing",
]