build: update to rules_typescript 0.23.2 and rules_nodejs 0.16.8 (#28567)
PR Close #28567
This commit is contained in:

committed by
Matias Niemelä

parent
116512b06d
commit
2ee265fb1f
@ -2,34 +2,14 @@ workspace(name = "bazel_integration_test")
|
||||
|
||||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
||||
|
||||
#
|
||||
# Download Bazel toolchain dependencies as needed by build actions
|
||||
#
|
||||
|
||||
local_repository(
|
||||
name = "angular",
|
||||
path = "../..",
|
||||
)
|
||||
|
||||
# Fetch rules_nodejs so we can install our npm dependencies
|
||||
http_archive(
|
||||
name = "rxjs",
|
||||
sha256 = "72b0b4e517f43358f554c125e40e39f67688cd2738a8998b4a266981ed32f403",
|
||||
strip_prefix = "package/src",
|
||||
url = "https://registry.yarnpkg.com/rxjs/-/rxjs-6.3.3.tgz",
|
||||
name = "build_bazel_rules_nodejs",
|
||||
strip_prefix = "rules_nodejs-0.16.8",
|
||||
urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.8.zip"],
|
||||
)
|
||||
|
||||
load("@angular//packages/bazel:package.bzl", "rules_angular_dependencies")
|
||||
|
||||
rules_angular_dependencies()
|
||||
|
||||
load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies")
|
||||
|
||||
rules_typescript_dependencies()
|
||||
|
||||
load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies")
|
||||
|
||||
rules_nodejs_dependencies()
|
||||
|
||||
# Fetch sass rules for compiling sass files
|
||||
http_archive(
|
||||
name = "io_bazel_rules_sass",
|
||||
sha256 = "dbe9fb97d5a7833b2a733eebc78c9c1e3880f676ac8af16e58ccf2139cbcad03",
|
||||
@ -37,31 +17,63 @@ http_archive(
|
||||
url = "https://github.com/bazelbuild/rules_sass/archive/1.11.0.zip",
|
||||
)
|
||||
|
||||
#
|
||||
# Setup dependencies loaded above
|
||||
#
|
||||
# Fetch the angular repository since we build angular from source
|
||||
# TODO(gregmagolan): use angular bundles in the Bazel build
|
||||
local_repository(
|
||||
name = "angular",
|
||||
path = "../..",
|
||||
)
|
||||
|
||||
# Fetch the rxjs repository since we build rxjs from source
|
||||
# TODO(gregmagolan): use rxjs bundles in the Bazel build
|
||||
http_archive(
|
||||
name = "rxjs",
|
||||
sha256 = "72b0b4e517f43358f554c125e40e39f67688cd2738a8998b4a266981ed32f403",
|
||||
strip_prefix = "package/src",
|
||||
url = "https://registry.yarnpkg.com/rxjs/-/rxjs-6.3.3.tgz",
|
||||
)
|
||||
|
||||
# Check the bazel version and download npm dependencies
|
||||
load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_repositories", "yarn_install")
|
||||
|
||||
check_bazel_version("0.17.0")
|
||||
# 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`)
|
||||
|
||||
""")
|
||||
|
||||
# Setup the Node.js toolchain
|
||||
node_repositories(
|
||||
node_version = "10.9.0",
|
||||
yarn_version = "1.12.1",
|
||||
)
|
||||
|
||||
# Install our npm dependencies into @npm
|
||||
yarn_install(
|
||||
name = "npm",
|
||||
# Need a reference to @angular here so that Bazel sets up the
|
||||
# external repository before calling yarn_install
|
||||
data = ["@angular//:LICENSE"],
|
||||
package_json = "//src:package.json",
|
||||
yarn_lock = "//src:yarn.lock",
|
||||
)
|
||||
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_register_toolchains", "go_rules_dependencies")
|
||||
# Install all bazel dependencies of our npm packages
|
||||
load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies")
|
||||
|
||||
go_rules_dependencies()
|
||||
install_bazel_dependencies()
|
||||
|
||||
go_register_toolchains()
|
||||
# Load karma dependencies
|
||||
load("@build_bazel_rules_karma//:package.bzl", "rules_karma_dependencies")
|
||||
|
||||
rules_karma_dependencies()
|
||||
|
||||
# Setup the rules_webtesting toolchain
|
||||
load("@io_bazel_rules_webtesting//web:repositories.bzl", "browser_repositories", "web_test_repositories")
|
||||
|
||||
web_test_repositories()
|
||||
@ -71,14 +83,17 @@ browser_repositories(
|
||||
firefox = True,
|
||||
)
|
||||
|
||||
# Setup the rules_typescript tooolchain
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace")
|
||||
|
||||
ts_setup_workspace()
|
||||
|
||||
# Setup the rules_sass toolchain
|
||||
load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories")
|
||||
|
||||
sass_repositories()
|
||||
|
||||
# Setup the angular toolchain
|
||||
load("@angular//:index.bzl", "ng_setup_workspace")
|
||||
|
||||
ng_setup_workspace()
|
||||
|
@ -2,7 +2,8 @@ package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("@angular//:index.bzl", "ng_module", "ng_package")
|
||||
load("@io_bazel_rules_sass//sass:sass.bzl", "sass_binary")
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_web_test_suite")
|
||||
load("@build_bazel_rules_karma//:defs.bzl", "ts_web_test_suite")
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
sass_binary(
|
||||
name = "hello-world-styles",
|
||||
|
@ -13,8 +13,8 @@
|
||||
"@angular/bazel": "file:../angular/dist/packages-dist/bazel",
|
||||
"@angular/compiler": "file:../angular/dist/packages-dist/compiler",
|
||||
"@angular/compiler-cli": "file:../angular/dist/packages-dist/compiler-cli",
|
||||
"@bazel/karma": "0.22.1",
|
||||
"@bazel/typescript": "0.22.1",
|
||||
"@bazel/karma": "0.23.2",
|
||||
"@bazel/typescript": "0.23.2",
|
||||
"@types/jasmine": "2.8.8",
|
||||
"@types/source-map": "0.5.1",
|
||||
"protractor": "5.1.2",
|
||||
@ -23,4 +23,4 @@
|
||||
"scripts": {
|
||||
"//": "TODO(gregmagolan): figure out how to keep dependencies here up to date with the root package.json"
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user