2018-11-02 14:33:07 -07:00
|
|
|
# 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
|
|
|
|
|
"""Install Angular Material source dependencies"""
|
|
|
|
|
|
|
|
|
|
load("@build_bazel_rules_nodejs//:defs.bzl", "yarn_install")
|
|
|
|
|
|
|
|
|
|
def angular_material_setup_workspace():
|
2018-11-05 19:19:41 +01:00
|
|
|
"""
|
|
|
|
|
This repository rule should be called from your WORKSPACE file.
|
2018-11-02 14:33:07 -07:00
|
|
|
|
2018-11-05 19:19:41 +01:00
|
|
|
It creates some additional Bazel external repositories that are used internally
|
|
|
|
|
to build Angular Material
|
2018-11-02 14:33:07 -07:00
|
|
|
"""
|
2018-11-07 18:05:09 +00:00
|
|
|
# Use Bazel managed node modules. See more below:
|
2018-11-02 14:33:07 -07:00
|
|
|
# https://github.com/bazelbuild/rules_nodejs#bazel-managed-vs-self-managed-dependencies
|
|
|
|
|
# Note: The repository_rule name is `@matdeps` so it does not conflict with the `@npm` repository
|
|
|
|
|
# name downstream when building Angular Material from source. In the future when Angular + Bazel
|
|
|
|
|
# users can build using the @angular/material npm bundles (depends on Ivy) this can be changed
|
|
|
|
|
# to `@npm`.
|
|
|
|
|
yarn_install(
|
|
|
|
|
name = "matdeps",
|
|
|
|
|
package_json = "@angular_material//:package.json",
|
2018-11-07 18:05:09 +00:00
|
|
|
# Ensure that the script is available when running `postinstall` in the Bazel sandbox.
|
|
|
|
|
data = ["@angular_material//:tools/npm/check-npm.js"],
|
2018-11-02 14:33:07 -07:00
|
|
|
yarn_lock = "@angular_material//:yarn.lock",
|
|
|
|
|
)
|