Skip to content

Commit

Permalink
Use default_tsconfig on ts_repositories
Browse files Browse the repository at this point in the history
This prevents us repeating the tsconfig attribute everywhere, and possibly having different tsconfig for different targets
  • Loading branch information
alexeagle committed Dec 13, 2017
1 parent add3589 commit 120962f
Show file tree
Hide file tree
Showing 33 changed files with 12 additions and 42 deletions.
8 changes: 5 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ node_repositories(package_json = ["//:package.json"])
git_repository(
name = "build_bazel_rules_typescript",
remote = "https://github.com/bazelbuild/rules_typescript.git",
tag = "0.6.0",
commit = "d734cc534c4a7a631862c422386eec4ca4a00e71",
)

load("@build_bazel_rules_typescript//:defs.bzl", "ts_repositories")
load("@build_bazel_rules_typescript//:setup.bzl", "ts_setup_workspace")

ts_repositories()
ts_setup_workspace(
default_tsconfig = "@angular_src//packages:tsconfig-build.json"
)

local_repository(
name = "angular",
Expand Down
9 changes: 1 addition & 8 deletions packages/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,9 @@ exports_files([
"tsconfig.json",
])

load("@build_bazel_rules_typescript//:defs.bzl", "ts_config", "ts_library")

ts_config(
name = "tsconfig",
src = ":tsconfig-build.json",
deps = [],
)
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")

ts_library(
name = "types",
srcs = glob(["*.ts"]),
tsconfig = ":tsconfig",
)
1 change: 0 additions & 1 deletion packages/animations/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ ts_library(
],
),
module_name = "@angular/animations",
tsconfig = "//packages:tsconfig",
deps = [
"//packages/core",
],
Expand Down
1 change: 0 additions & 1 deletion packages/animations/browser/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ ts_library(
],
),
module_name = "@angular/animations/browser",
tsconfig = "//packages:tsconfig",
deps = [
"//packages/animations",
],
Expand Down
1 change: 0 additions & 1 deletion packages/animations/browser/test/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ ts_library(
name = "test",
testonly = 1,
srcs = glob(["**/*.ts"]),
tsconfig = "//packages:tsconfig",
deps = [
"//packages:types",
"//packages/animations",
Expand Down
1 change: 0 additions & 1 deletion packages/animations/browser/testing/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ ts_library(
testonly = 1,
srcs = glob(["**/*.ts"]),
module_name = "@angular/animations/browser/testing",
tsconfig = "//packages:tsconfig",
deps = [
"//packages/animations",
"//packages/animations/browser",
Expand Down
1 change: 0 additions & 1 deletion packages/animations/test/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ ts_library(
name = "test",
testonly = 1,
srcs = glob(["test/**/*.ts"]),
tsconfig = "//packages:tsconfig",
deps = [
"//packages:types",
"//packages/animations",
Expand Down
7 changes: 6 additions & 1 deletion packages/bazel/src/ng_module.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,15 @@ NG_MODULE_ATTRIBUTES = {
"_supports_workers": attr.bool(default = True),
}

# This is created by the ts_repositories() repository rule
load("@build_bazel_rules_typescript_install//:tsconfig.bzl", "get_default_tsconfig")

ng_module = rule(
implementation = _ng_module_impl,
attrs = COMMON_ATTRIBUTES + NG_MODULE_ATTRIBUTES + {
"tsconfig": attr.label(allow_files = True, single_file = True),
"tsconfig": attr.label(
default = get_default_tsconfig(),
allow_files = True, single_file = True),

# @// is special syntax for the "main" repository
# The default assumes the user specified a target "node_modules" in their
Expand Down
1 change: 0 additions & 1 deletion packages/common/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ ts_library(
],
),
module_name = "@angular/common",
tsconfig = "//packages:tsconfig",
deps = [
"//packages/core",
"@rxjs",
Expand Down
1 change: 0 additions & 1 deletion packages/common/http/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ ts_library(
],
),
module_name = "@angular/common/http",
tsconfig = "//packages:tsconfig",
deps = [
"//packages/common",
"//packages/core",
Expand Down
1 change: 0 additions & 1 deletion packages/common/http/testing/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ ts_library(
testonly = 1,
srcs = glob(["testing/**/*.ts"]),
module_name = "@angular/common/http/testing",
tsconfig = "//packages:tsconfig",
deps = [
"//packages/common/http",
],
Expand Down
1 change: 0 additions & 1 deletion packages/common/testing/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ ts_library(
testonly = 1,
srcs = glob(["**/*.ts"]),
module_name = "@angular/common/testing",
tsconfig = "//packages:tsconfig",
deps = [
"//packages/common",
"//packages/core",
Expand Down
1 change: 0 additions & 1 deletion packages/compiler/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ ts_library(
],
),
module_name = "@angular/compiler",
tsconfig = "//packages:tsconfig",
)
1 change: 0 additions & 1 deletion packages/compiler/test/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ ts_library(
name = "test",
testonly = 1,
srcs = glob(["**/*.ts"]),
tsconfig = "//packages:tsconfig",
deps = [
"//packages:types",
"//packages/common",
Expand Down
1 change: 0 additions & 1 deletion packages/compiler/testing/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ ts_library(
testonly = 1,
srcs = glob(["**/*.ts"]),
module_name = "@angular/compiler/testing",
tsconfig = "//packages:tsconfig",
deps = ["//packages/compiler"],
)
1 change: 0 additions & 1 deletion packages/core/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ ng_module(
],
),
module_name = "@angular/core",
tsconfig = "//packages:tsconfig",
deps = [
"@rxjs",
],
Expand Down
1 change: 0 additions & 1 deletion packages/core/test/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ ts_library(
name = "test_lib",
testonly = 1,
srcs = glob(["**/*.ts"]),
tsconfig = "//packages:tsconfig",
deps = [
"//packages/animations",
"//packages/animations/browser",
Expand Down
1 change: 0 additions & 1 deletion packages/core/testing/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ ts_library(
testonly = 1,
srcs = glob(["**/*.ts"]),
module_name = "@angular/core/testing",
tsconfig = "//packages:tsconfig",
deps = [
"//packages:types",
"//packages/core",
Expand Down
1 change: 0 additions & 1 deletion packages/http/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ ts_library(
],
),
module_name = "@angular/http",
tsconfig = "//packages:tsconfig",
deps = [
"//packages/core",
"//packages/platform-browser",
Expand Down
1 change: 0 additions & 1 deletion packages/http/testing/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ ts_library(
testonly = 1,
srcs = glob(["**/*.ts"]),
module_name = "@angular/http/testing",
tsconfig = "//packages:tsconfig",
deps = [
"//packages/core",
"//packages/http",
Expand Down
1 change: 0 additions & 1 deletion packages/platform-browser-dynamic/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ ts_library(
],
),
module_name = "@angular/platform-browser-dynamic",
tsconfig = "//packages:tsconfig",
deps = [
"//packages:types",
"//packages/common",
Expand Down
1 change: 0 additions & 1 deletion packages/platform-browser-dynamic/testing/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ ts_library(
testonly = 1,
srcs = glob(["**/*.ts"]),
module_name = "@angular/platform-browser-dynamic/testing",
tsconfig = "//packages:tsconfig",
deps = [
"//packages/compiler",
"//packages/compiler/testing",
Expand Down
1 change: 0 additions & 1 deletion packages/platform-browser/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ ts_library(
],
),
module_name = "@angular/platform-browser",
tsconfig = "//packages:tsconfig",
deps = [
"//packages:types",
"//packages/common",
Expand Down
1 change: 0 additions & 1 deletion packages/platform-browser/animations/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ ts_library(
],
),
module_name = "@angular/platform-browser/animations",
tsconfig = "//packages:tsconfig",
deps = [
"//packages/animations",
"//packages/animations/browser",
Expand Down
1 change: 0 additions & 1 deletion packages/platform-browser/testing/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ ts_library(
testonly = 1,
srcs = glob(["**/*.ts"]),
module_name = "@angular/platform-browser/testing",
tsconfig = "//packages:tsconfig",
deps = [
"//packages/core",
"//packages/platform-browser",
Expand Down
1 change: 0 additions & 1 deletion packages/platform-server/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ ts_library(
],
),
module_name = "@angular/platform-server",
tsconfig = "//packages:tsconfig",
deps = [
"//packages/animations/browser",
"//packages/common",
Expand Down
1 change: 0 additions & 1 deletion packages/platform-server/testing/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ ts_library(
testonly = 1,
srcs = glob(["**/*.ts"]),
module_name = "@angular/platform-server/testing",
tsconfig = "//packages:tsconfig",
deps = [
"//packages/core",
"//packages/platform-browser-dynamic/testing",
Expand Down
1 change: 0 additions & 1 deletion packages/router/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ ts_library(
],
),
module_name = "@angular/router",
tsconfig = "//packages:tsconfig",
deps = [
"//packages/common",
"//packages/core",
Expand Down
1 change: 0 additions & 1 deletion packages/router/testing/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ ts_library(
testonly = 1,
srcs = glob(["**/*.ts"]),
module_name = "@angular/router/testing",
tsconfig = "//packages:tsconfig",
deps = [
"//packages/common",
"//packages/common/testing",
Expand Down
1 change: 0 additions & 1 deletion packages/service-worker/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ ts_library(
],
),
module_name = "@angular/service-worker",
tsconfig = "//packages:tsconfig",
deps = [
"//packages/common",
"//packages/core",
Expand Down
1 change: 0 additions & 1 deletion packages/service-worker/worker/test/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ ts_library(
srcs = glob(
["**/*.ts"],
),
tsconfig = "//packages:tsconfig",
deps = [
"//packages:types",
"//packages/service-worker/worker",
Expand Down
1 change: 0 additions & 1 deletion packages/service-worker/worker/testing/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ ts_library(
name = "testing",
testonly = 1,
srcs = glob(["**/*.ts"]),
tsconfig = "//packages:tsconfig",
deps = [
"//packages:types",
"//packages/service-worker/worker",
Expand Down
1 change: 0 additions & 1 deletion packages/upgrade/static/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ ts_library(
name = "static",
srcs = glob(["**/*.ts"]),
module_name = "@angular/upgrade/static",
tsconfig = "//packages:tsconfig",
deps = [
"//packages/core",
"//packages/platform-browser",
Expand Down

0 comments on commit 120962f

Please sign in to comment.