2019-05-22 20:28:42 -04:00
|
|
|
workspace(
|
|
|
|
name = "bazel_integration_test",
|
|
|
|
managed_directories = {"@npm": ["node_modules"]},
|
|
|
|
)
|
2017-12-06 09:56:49 -05:00
|
|
|
|
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-10-28 21:34:21 -04:00
|
|
|
sha256 = "3d7296d834208792fa3b2ded8ec04e75068e3de172fae79db217615bd75a6ff7",
|
|
|
|
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.39.1/rules_nodejs-0.39.1.tar.gz"],
|
2019-02-04 18:53:32 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
# Fetch sass rules for compiling sass files
|
|
|
|
http_archive(
|
|
|
|
name = "io_bazel_rules_sass",
|
2019-06-19 00:26:53 -04:00
|
|
|
sha256 = "4f05239080175a3f4efa8982d2b7775892d656bb47e8cf56914d5f9441fb5ea6",
|
|
|
|
strip_prefix = "rules_sass-86ca977cf2a8ed481859f83a286e164d07335116",
|
|
|
|
url = "https://github.com/bazelbuild/rules_sass/archive/86ca977cf2a8ed481859f83a286e164d07335116.zip",
|
2019-02-04 18:53:32 -05:00
|
|
|
)
|
2018-06-25 14:22:23 -04:00
|
|
|
|
2019-02-04 18:53:32 -05:00
|
|
|
# Check the bazel version and download npm dependencies
|
2019-10-25 04:13:43 -04:00
|
|
|
load("@build_bazel_rules_nodejs//:index.bzl", "check_bazel_version", "node_repositories", "yarn_install")
|
2018-05-29 18:35:48 -04:00
|
|
|
|
2019-05-22 20:28:42 -04:00
|
|
|
# Bazel version must be at least the following version because:
|
|
|
|
# - 0.26.0 managed_directories feature added which is required for nodejs rules 0.30.0
|
2019-06-12 21:18:26 -04:00
|
|
|
# - 0.27.0 has a fix for managed_directories after `rm -rf node_modules`
|
2019-02-26 07:30:44 -05:00
|
|
|
check_bazel_version(
|
|
|
|
message = """
|
2019-02-04 18:53:32 -05:00
|
|
|
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-26 07:30:44 -05:00
|
|
|
""",
|
2019-06-12 21:18:26 -04:00
|
|
|
minimum_bazel_version = "0.27.0",
|
2019-02-26 07:30:44 -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(
|
2019-06-19 00:26:53 -04:00
|
|
|
# Use same node version as root angular WORKSPACE since
|
|
|
|
# we share node_module packages and some require node >= 10.15.0
|
|
|
|
node_repositories = {
|
|
|
|
"10.16.0-darwin_amd64": ("node-v10.16.0-darwin-x64.tar.gz", "node-v10.16.0-darwin-x64", "6c009df1b724026d84ae9a838c5b382662e30f6c5563a0995532f2bece39fa9c"),
|
|
|
|
"10.16.0-linux_amd64": ("node-v10.16.0-linux-x64.tar.xz", "node-v10.16.0-linux-x64", "1827f5b99084740234de0c506f4dd2202a696ed60f76059696747c34339b9d48"),
|
|
|
|
"10.16.0-windows_amd64": ("node-v10.16.0-win-x64.zip", "node-v10.16.0-win-x64", "aa22cb357f0fb54ccbc06b19b60e37eefea5d7dd9940912675d3ed988bf9a059"),
|
|
|
|
},
|
|
|
|
node_version = "10.16.0",
|
2019-03-20 15:55:31 -04: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-05-22 20:28:42 -04:00
|
|
|
package_json = "//:package.json",
|
|
|
|
yarn_lock = "//: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()
|
|
|
|
|
2019-07-24 11:52:26 -04:00
|
|
|
# Load protractor dependencies
|
|
|
|
load("@npm_bazel_protractor//:package.bzl", "npm_bazel_protractor_dependencies")
|
|
|
|
|
|
|
|
npm_bazel_protractor_dependencies()
|
|
|
|
|
2019-02-04 18:53:32 -05:00
|
|
|
# Load karma dependencies
|
2019-09-27 18:49:59 -04:00
|
|
|
load("@npm_bazel_karma//:package.bzl", "npm_bazel_karma_dependencies")
|
2019-02-04 18:53:32 -05:00
|
|
|
|
2019-09-27 18:49:59 -04:00
|
|
|
npm_bazel_karma_dependencies()
|
2019-02-04 18:53:32 -05:00
|
|
|
|
|
|
|
# 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-08-15 11:35:33 -04:00
|
|
|
load("@io_bazel_rules_webtesting//web/versioned:browsers-0.3.2.bzl", "browser_repositories")
|
2019-02-13 12:33:48 -05:00
|
|
|
|
2019-08-15 11:35:33 -04:00
|
|
|
browser_repositories(
|
|
|
|
chromium = True,
|
|
|
|
firefox = True,
|
|
|
|
)
|
2018-05-29 18:35:48 -04:00
|
|
|
|
2019-02-04 18:53:32 -05:00
|
|
|
# Setup the rules_typescript tooolchain
|
2019-02-20 12:54:42 -05:00
|
|
|
load("@npm_bazel_typescript//:index.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()
|