forked from angular/angular
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathng_setup_workspace.bzl
46 lines (37 loc) · 1.73 KB
/
ng_setup_workspace.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
# 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
"Install angular source dependencies"
load("@build_bazel_rules_nodejs//:package.bzl", "check_rules_nodejs_version")
load("@build_bazel_rules_nodejs//:defs.bzl", "yarn_install")
load("@angular//packages/bazel/src:ng_setup_workspace.bzl", _ng_setup_workspace = "ng_setup_workspace")
def ng_setup_workspace():
"""This repository rule should be called from your WORKSPACE file.
It creates some additional Bazel external repositories that are used internally
to build angular
"""
# The NodeJS rules version must be at least v0.15.3 because:
# - 0.15.2 Re-introduced the prod_only attribute on yarn_install
# - 0.15.3 Includes a fix for the `jasmine_node_test` rule ignoring target tags
# - 0.16.8 Supports npm installed bazel workspaces
check_rules_nodejs_version("0.16.8")
yarn_install(
name = "ngdeps",
package_json = "@angular//:package.json",
yarn_lock = "@angular//:yarn.lock",
data = ["@angular//:tools/yarn/check-yarn.js", "@angular//:tools/postinstall-patches.js"],
# Don't install devDependencies, they are large and not used under Bazel
prod_only = True,
)
yarn_install(
name = "ts-api-guardian_deps",
package_json = "@angular//tools/ts-api-guardian:package.json",
yarn_lock = "@angular//tools/ts-api-guardian:yarn.lock",
)
yarn_install(
name = "http-server_runtime_deps",
package_json = "@angular//tools/http-server:package.json",
yarn_lock = "@angular//tools/http-server:yarn.lock",
)
_ng_setup_workspace()