Skip to content

Commit

Permalink
build: move repeated tsconfig attributes to a macro
Browse files Browse the repository at this point in the history
This helps ensure we use the same tsconfig.json file for all compilations.
Next steps are to make it the same tsconfig.json file used by the editor
  • Loading branch information
alexeagle committed Jan 9, 2018
1 parent 80a5b91 commit 761eb0e
Show file tree
Hide file tree
Showing 52 changed files with 67 additions and 123 deletions.
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("//tools:defaults.bzl", "ts_library")

ts_library(
name = "types",
srcs = glob(["*.ts"]),
tsconfig = ":tsconfig",
)
3 changes: 1 addition & 2 deletions packages/animations/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package(default_visibility = ["//visibility:public"])

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

ts_library(
name = "animations",
Expand All @@ -11,7 +11,6 @@ ts_library(
],
),
module_name = "@angular/animations",
tsconfig = "//packages:tsconfig",
deps = [
"//packages/core",
],
Expand Down
3 changes: 1 addition & 2 deletions packages/animations/browser/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package(default_visibility = ["//visibility:public"])

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

ts_library(
name = "browser",
Expand All @@ -11,7 +11,6 @@ ts_library(
],
),
module_name = "@angular/animations/browser",
tsconfig = "//packages:tsconfig",
deps = [
"//packages/animations",
],
Expand Down
3 changes: 1 addition & 2 deletions packages/animations/browser/test/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
load("//tools:defaults.bzl", "ts_library")

ts_library(
name = "test",
testonly = 1,
srcs = glob(["**/*.ts"]),
tsconfig = "//packages:tsconfig",
deps = [
"//packages:types",
"//packages/animations",
Expand Down
3 changes: 1 addition & 2 deletions packages/animations/browser/testing/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package(default_visibility = ["//visibility:public"])

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

ts_library(
name = "testing",
testonly = 1,
srcs = glob(["**/*.ts"]),
module_name = "@angular/animations/browser/testing",
tsconfig = "//packages:tsconfig",
deps = [
"//packages/animations",
"//packages/animations/browser",
Expand Down
3 changes: 1 addition & 2 deletions packages/animations/test/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
load("//tools:defaults.bzl", "ts_library")

ts_library(
name = "test",
testonly = 1,
srcs = glob(["test/**/*.ts"]),
tsconfig = "//packages:tsconfig",
deps = [
"//packages:types",
"//packages/animations",
Expand Down
3 changes: 1 addition & 2 deletions packages/common/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package(default_visibility = ["//visibility:public"])

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

ts_library(
name = "common",
Expand All @@ -11,7 +11,6 @@ ts_library(
],
),
module_name = "@angular/common",
tsconfig = "//packages:tsconfig",
deps = [
"//packages/core",
"@rxjs",
Expand Down
3 changes: 1 addition & 2 deletions packages/common/http/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package(default_visibility = ["//visibility:public"])

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

ts_library(
name = "http",
Expand All @@ -11,7 +11,6 @@ ts_library(
],
),
module_name = "@angular/common/http",
tsconfig = "//packages:tsconfig",
deps = [
"//packages/common",
"//packages/core",
Expand Down
3 changes: 1 addition & 2 deletions packages/common/http/testing/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package(default_visibility = ["//visibility:public"])

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

ts_library(
name = "testing",
testonly = 1,
srcs = glob(["**/*.ts"]),
module_name = "@angular/common/http/testing",
tsconfig = "//packages:tsconfig",
deps = [
"//packages/common/http",
"//packages/core",
Expand Down
5 changes: 1 addition & 4 deletions packages/common/locales/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package(default_visibility = ["//visibility:public"])

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

ts_library(
name = "locales",
Expand All @@ -9,7 +9,4 @@ ts_library(
exclude = ["closure-locale.ts"],
),
module_name = "@angular/common/locales",
tsconfig = "//packages:tsconfig",
deps = [
],
)
4 changes: 2 additions & 2 deletions packages/common/test/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_web_test")
load("//tools:defaults.bzl", "ts_library")
load("@build_bazel_rules_typescript//:defs.bzl", "ts_web_test")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")

ts_library(
Expand All @@ -8,7 +9,6 @@ ts_library(
["**/*.ts"],
exclude = ["**/*_node_only_spec.ts"],
),
tsconfig = "//packages:tsconfig",
deps = [
"//packages/common",
"//packages/common/locales",
Expand Down
3 changes: 1 addition & 2 deletions packages/common/testing/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package(default_visibility = ["//visibility:public"])

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

ts_library(
name = "testing",
testonly = 1,
srcs = glob(["**/*.ts"]),
module_name = "@angular/common/testing",
tsconfig = "//packages:tsconfig",
deps = [
"//packages/common",
"//packages/core",
Expand Down
3 changes: 1 addition & 2 deletions packages/compiler/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package(default_visibility = ["//visibility:public"])

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

ts_library(
name = "compiler",
Expand All @@ -11,5 +11,4 @@ ts_library(
],
),
module_name = "@angular/compiler",
tsconfig = "//packages:tsconfig",
)
5 changes: 2 additions & 3 deletions packages/compiler/test/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_web_test")
load("//tools:defaults.bzl", "ts_library")
load("@build_bazel_rules_typescript//:defs.bzl", "ts_web_test")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")

ts_library(
Expand All @@ -8,7 +9,6 @@ ts_library(
["**/*.ts"],
exclude = ["**/*_node_only_spec.ts"],
),
tsconfig = "//packages:tsconfig",
deps = [
"//packages:types",
"//packages/common",
Expand All @@ -27,7 +27,6 @@ ts_library(
name = "test_node_only_lib",
testonly = 1,
srcs = glob(["**/*_node_only_spec.ts"]),
tsconfig = "//packages:tsconfig",
deps = [
":test_lib",
"//packages/compiler",
Expand Down
3 changes: 1 addition & 2 deletions packages/compiler/testing/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package(default_visibility = ["//visibility:public"])

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

ts_library(
name = "testing",
testonly = 1,
srcs = glob(["**/*.ts"]),
module_name = "@angular/compiler/testing",
tsconfig = "//packages:tsconfig",
deps = [
"//packages:types",
"//packages/compiler",
Expand Down
4 changes: 1 addition & 3 deletions packages/core/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package(default_visibility = ["//visibility:public"])

load("@angular//:index.bzl", "ng_module")
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
load("//tools:defaults.bzl", "ng_module")

ng_module(
name = "core",
Expand All @@ -12,7 +11,6 @@ ng_module(
],
),
module_name = "@angular/core",
tsconfig = "//packages:tsconfig",
deps = [
"//packages:types",
"@rxjs",
Expand Down
5 changes: 2 additions & 3 deletions packages/core/test/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package(default_visibility = ["//visibility:public"])

load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_web_test")
load("//tools:defaults.bzl", "ts_library")
load("@build_bazel_rules_typescript//:defs.bzl", "ts_web_test")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")

ts_library(
Expand All @@ -13,7 +14,6 @@ ts_library(
"render3/**/*.ts",
],
),
tsconfig = "//packages:tsconfig",
deps = [
"//packages/animations",
"//packages/animations/browser",
Expand All @@ -37,7 +37,6 @@ ts_library(
name = "test_node_only_lib",
testonly = 1,
srcs = glob(["**/*_node_only_spec.ts"]),
tsconfig = "//packages:tsconfig",
deps = [
":test_lib",
"//packages/compiler",
Expand Down
5 changes: 3 additions & 2 deletions packages/core/test/render3/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package(default_visibility = ["//visibility:public"])

load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_web_test")
load("//tools:defaults.bzl", "ts_library")
load("@build_bazel_rules_typescript//:defs.bzl", "ts_web_test")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")

ts_library(
Expand All @@ -14,6 +15,7 @@ ts_library(
"load_domino.ts",
],
),
# TODO(alexeagle): should not be different tsconfig
tsconfig = "//packages:tsconfig.json",
deps = [
"//packages:types",
Expand All @@ -34,7 +36,6 @@ ts_library(
"domino.d.ts",
"load_domino.ts",
],
tsconfig = "//packages:tsconfig",
deps = [
":render3_lib",
"//packages/platform-browser",
Expand Down
3 changes: 1 addition & 2 deletions packages/core/testing/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package(default_visibility = ["//visibility:public"])

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

ts_library(
name = "testing",
testonly = 1,
srcs = glob(["**/*.ts"]),
module_name = "@angular/core/testing",
tsconfig = "//packages:tsconfig",
deps = [
"//packages:types",
"//packages/core",
Expand Down
4 changes: 1 addition & 3 deletions packages/forms/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package(default_visibility = ["//visibility:public"])

load("@angular//:index.bzl", "ng_module")
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
load("//tools:defaults.bzl", "ng_module")

ng_module(
name = "forms",
Expand All @@ -12,7 +11,6 @@ ng_module(
],
),
module_name = "@angular/forms",
tsconfig = "//packages:tsconfig",
deps = [
"//packages/core",
"//packages/platform-browser",
Expand Down
4 changes: 2 additions & 2 deletions packages/forms/test/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_web_test")
load("//tools:defaults.bzl", "ts_library")
load("@build_bazel_rules_typescript//:defs.bzl", "ts_web_test")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")

ts_library(
name = "test_lib",
testonly = 1,
srcs = glob(["**/*.ts"]),
tsconfig = "//packages:tsconfig",
deps = [
"//packages/core",
"//packages/core/testing",
Expand Down
3 changes: 1 addition & 2 deletions packages/http/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package(default_visibility = ["//visibility:public"])

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

ts_library(
name = "http",
Expand All @@ -11,7 +11,6 @@ ts_library(
],
),
module_name = "@angular/http",
tsconfig = "//packages:tsconfig",
deps = [
"//packages/core",
"//packages/platform-browser",
Expand Down
4 changes: 2 additions & 2 deletions packages/http/test/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_web_test")
load("//tools:defaults.bzl", "ts_library")
load("@build_bazel_rules_typescript//:defs.bzl", "ts_web_test")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")

ts_library(
name = "test_lib",
testonly = 1,
srcs = glob(["**/*.ts"]),
tsconfig = "//packages:tsconfig",
deps = [
"//packages/core",
"//packages/core/testing",
Expand Down
3 changes: 1 addition & 2 deletions packages/http/testing/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package(default_visibility = ["//visibility:public"])

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

ts_library(
name = "testing",
testonly = 1,
srcs = glob(["**/*.ts"]),
module_name = "@angular/http/testing",
tsconfig = "//packages:tsconfig",
deps = [
"//packages/core",
"//packages/http",
Expand Down

0 comments on commit 761eb0e

Please sign in to comment.