build: upgrade to latest bazel rules (#18733)

PR Close #18733
This commit is contained in:
Alex Eagle
2017-08-22 16:56:29 -07:00
committed by Miško Hevery
parent 47220997e1
commit f2f5286020
13 changed files with 69 additions and 61 deletions

View File

@ -7,15 +7,3 @@
# We take the name "angular" so that users can write
# load("@angular//:index.bzl", "ng_module")
workspace(name = "angular")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
git_repository(
name = "build_bazel_rules_typescript",
remote = "https://github.com/bazelbuild/rules_typescript.git",
tag = "0.0.6",
)
load("@build_bazel_rules_typescript//:defs.bzl", "node_repositories")
node_repositories(package_json = ":package.json")

View File

@ -1,4 +1,5 @@
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "nodejs_binary")
load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary")
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
licenses(["notice"]) # Apache 2.0
@ -9,7 +10,7 @@ ts_library(
# BEGIN-INTERNAL
# Only needed when compiling within the Angular repo.
# Users will get this dependency from node_modules.
"//packages/compiler-cli",
"@//packages/compiler-cli",
# END-INTERNAL
"@build_bazel_rules_typescript//internal/tsc_wrapped"
],
@ -18,7 +19,9 @@ ts_library(
nodejs_binary(
name = "ngc-wrapped",
entry_point = "__main__/packages/bazel/src/ngc-wrapped/index.js",
# Entry point assumes the user is outside this WORKSPACE,
# and references our rules with @angular//src/ngc-wrapped
entry_point = "angular/src/ngc-wrapped/index.js",
data = [":ngc_lib"],
visibility = ["//visibility:public"],
)

View File

@ -5,15 +5,10 @@
* 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
*/
// TODO(chuckj): Remove the requirment for a fake 'reflect` implementation from
// the compiler
import 'reflect-metadata'; // from //third_party/javascript/node_modules/reflect_decorators:ts
import * as ng from '@angular/compiler-cli';
import {CompilerHost, UncachedFileLoader, parseTsconfig} from '@bazel/typescript';
import * as fs from 'fs';
import * as path from 'path';
// Note, the tsc_wrapped module comes from rules_typescript, not from npm
import {CompilerHost, UncachedFileLoader, parseTsconfig} from 'tsc_wrapped';
import * as tsickle from 'tsickle';
import * as ts from 'typescript';

View File

@ -1,28 +1,13 @@
package(default_visibility=["//visibility:public"])
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
ts_library(
name = "core",
srcs = glob(["**/*.ts"], exclude=[
"test/**",
"testing/**",
]),
module_name = "@angular/core",
deps = [],
tsconfig = ":tsconfig-build.json",
)
load("@build_bazel_rules_angular//:defs.bzl", "ng_module")
load("@angular//:index.bzl", "ng_module")
ng_module(
name = "core_ng_module",
name = "core",
srcs = glob(["**/*.ts"], exclude=[
"test/**",
"testing/**",
]),
# Needed to allow (ts_library,ng_module) pair
write_ng_outputs_only = True,
module_name = "@angular/core",
tsconfig = ":tsconfig-build.json",
compiler = "//packages/bazel/src/ngc-wrapped"
)