2017-12-06 09:56:49 -05:00
|
|
|
workspace(name = "bazel_integration_test")
|
|
|
|
|
2018-12-01 19:08:15 -05:00
|
|
|
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
|
|
|
|
2019-02-04 18:53:32 -05:00
|
|
|
# Fetch rules_nodejs so we can install our npm dependencies
|
|
|
|
http_archive(
|
|
|
|
name = "build_bazel_rules_nodejs",
|
2019-02-22 16:22:11 -05:00
|
|
|
sha256 = "86ea92217dfd4a84e1e335cc07dfd942b12899796b080492546b947f12c5ab77",
|
|
|
|
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.26.0-beta.0/rules_nodejs-0.26.0-beta.0.tar.gz"],
|
2019-02-04 18:53:32 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
# Fetch sass rules for compiling sass files
|
|
|
|
http_archive(
|
|
|
|
name = "io_bazel_rules_sass",
|
|
|
|
sha256 = "dbe9fb97d5a7833b2a733eebc78c9c1e3880f676ac8af16e58ccf2139cbcad03",
|
|
|
|
strip_prefix = "rules_sass-1.11.0",
|
|
|
|
url = "https://github.com/bazelbuild/rules_sass/archive/1.11.0.zip",
|
|
|
|
)
|
2018-06-25 14:22:23 -04:00
|
|
|
|
2019-02-04 18:53:32 -05:00
|
|
|
# Check the bazel version and download npm dependencies
|
2018-10-04 16:14:14 -04:00
|
|
|
load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_repositories", "yarn_install")
|
2018-05-29 18:35:48 -04:00
|
|
|
|
2019-02-04 18:53:32 -05:00
|
|
|
# Bazel version must be at least v0.21.0 because:
|
|
|
|
# - 0.21.0 Using --incompatible_strict_action_env flag fixes cache when running `yarn bazel`
|
|
|
|
# (see https://github.com/angular/angular/issues/27514#issuecomment-451438271)
|
|
|
|
check_bazel_version("0.21.0", """
|
|
|
|
You no longer need to install Bazel on your machine.
|
|
|
|
Angular has a dependency on the @bazel/bazel package which supplies it.
|
|
|
|
Try running `yarn bazel` instead.
|
|
|
|
(If you did run that, check that you've got a fresh `yarn install`)
|
2018-12-06 17:46:51 -05:00
|
|
|
|
2019-02-04 18:53:32 -05:00
|
|
|
""")
|
|
|
|
|
|
|
|
# Setup the Node.js toolchain
|
2018-09-05 15:38:53 -04:00
|
|
|
node_repositories(
|
2018-09-11 21:11:32 -04:00
|
|
|
node_version = "10.9.0",
|
2018-11-20 09:21:05 -05:00
|
|
|
yarn_version = "1.12.1",
|
2018-09-05 15:38:53 -04:00
|
|
|
)
|
2018-05-29 18:35:48 -04:00
|
|
|
|
2019-02-04 18:53:32 -05:00
|
|
|
# Install our npm dependencies into @npm
|
2018-10-04 16:14:14 -04:00
|
|
|
yarn_install(
|
|
|
|
name = "npm",
|
2019-02-15 13:27:13 -05:00
|
|
|
data = [
|
|
|
|
# Needed because this tsconfig file is used in the "postinstall" script.
|
|
|
|
"//:angular-metadata.tsconfig.json",
|
|
|
|
],
|
2018-10-16 16:20:00 -04:00
|
|
|
package_json = "//src:package.json",
|
|
|
|
yarn_lock = "//src:yarn.lock",
|
2018-10-04 16:14:14 -04:00
|
|
|
)
|
|
|
|
|
2019-02-04 18:53:32 -05:00
|
|
|
# Install all bazel dependencies of our npm packages
|
|
|
|
load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies")
|
|
|
|
|
|
|
|
install_bazel_dependencies()
|
|
|
|
|
|
|
|
# Load karma dependencies
|
2019-02-08 17:01:51 -05:00
|
|
|
load("@npm_bazel_karma//:package.bzl", "rules_karma_dependencies")
|
2019-02-04 18:53:32 -05:00
|
|
|
|
|
|
|
rules_karma_dependencies()
|
|
|
|
|
|
|
|
# Setup the rules_webtesting toolchain
|
2019-02-13 12:33:48 -05:00
|
|
|
load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories")
|
2018-05-29 18:35:48 -04:00
|
|
|
|
|
|
|
web_test_repositories()
|
2018-12-06 17:46:51 -05:00
|
|
|
|
2019-02-13 12:33:48 -05:00
|
|
|
# Temporary work-around for https://github.com/angular/angular/issues/28681
|
|
|
|
# TODO(gregmagolan): go back to @io_bazel_rules_webtesting browser_repositories
|
2019-02-08 17:01:51 -05:00
|
|
|
load("@npm_bazel_karma//:browser_repositories.bzl", "browser_repositories")
|
2019-02-13 12:33:48 -05:00
|
|
|
|
|
|
|
browser_repositories()
|
2018-05-29 18:35:48 -04:00
|
|
|
|
2019-02-04 18:53:32 -05:00
|
|
|
# Setup the rules_typescript tooolchain
|
2019-02-08 17:01:51 -05:00
|
|
|
load("@npm_bazel_typescript//:defs.bzl", "ts_setup_workspace")
|
2017-12-06 09:56:49 -05:00
|
|
|
|
2017-12-22 12:36:47 -05:00
|
|
|
ts_setup_workspace()
|
2017-12-06 09:56:49 -05:00
|
|
|
|
2019-02-04 18:53:32 -05:00
|
|
|
# Setup the rules_sass toolchain
|
2018-06-04 13:45:27 -04:00
|
|
|
load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories")
|
2018-05-29 18:35:48 -04:00
|
|
|
|
|
|
|
sass_repositories()
|
|
|
|
|
2019-02-15 13:27:13 -05:00
|
|
|
# Setup the angular toolchain. This integration test no longer builds Angular from source,
|
|
|
|
# but we still need to set up the "angular" workspace since some Bazel rules depend on
|
|
|
|
# the "ngdeps" repository. This can be fixed if we switched the Angular repository to the
|
|
|
|
# "npm" repository for the bazel managed dependencies.
|
2019-02-19 19:15:06 -05:00
|
|
|
load("@npm_angular_bazel//:index.bzl", "ng_setup_workspace")
|
2018-05-11 02:35:21 -04:00
|
|
|
|
|
|
|
ng_setup_workspace()
|