Skip to content

Commit 11e0a51

Browse files
committed
build: minor cleanup of bazel build rules
BUILD files for each package have had outdated glob excludes removed. Additionally, some src args have been reduced to a single file where possible. The root bazel ignore file has also been expanded to include all node module directories in each package. The ignore file does not appear to currently support globs so each path has been individually specified.
1 parent b628cff commit 11e0a51

File tree

14 files changed

+28
-50
lines changed

14 files changed

+28
-50
lines changed

.bazelignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
11
.git
22
dist
33
node_modules
4+
packages/angular/cli/node_modules
5+
packages/angular/create/node_modules
6+
packages/angular/pwa/node_modules
7+
packages/angular_devkit/architect/node_modules
8+
packages/angular_devkit/architect_cli/node_modules
9+
packages/angular_devkit/benchmark/node_modules
10+
packages/angular_devkit/build_angular/node_modules
11+
packages/angular_devkit/build_webpack/node_modules
12+
packages/angular_devkit/core/node_modules
13+
packages/angular_devkit/schematics/node_modules
14+
packages/angular_devkit/schematics_cli/node_modules
15+
packages/ngtools/webpack/node_modules
16+
packages/schematics/angular/node_modules

packages/angular/cli/BUILD.bazel

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ ts_library(
1717
name = "angular-cli",
1818
package_name = "@angular/cli",
1919
srcs = glob(
20-
include = ["**/*.ts"],
20+
include = [
21+
"lib/**/*.ts",
22+
"src/**/*.ts",
23+
],
2124
exclude = [
2225
"**/*_spec.ts",
23-
# NB: we need to exclude the nested node_modules that is laid out by yarn workspaces
24-
"node_modules/**",
2526
],
2627
) + [
2728
# @external_begin
@@ -33,12 +34,10 @@ ts_library(
3334
data = glob(
3435
include = [
3536
"bin/**/*",
36-
"**/*.json",
37-
"**/*.md",
37+
"src/**/*.md",
38+
"src/**/*.json",
3839
],
3940
exclude = [
40-
# NB: we need to exclude the nested node_modules that is laid out by yarn workspaces
41-
"node_modules/**",
4241
"lib/config/workspace-schema.json",
4342
],
4443
) + [

packages/angular/create/BUILD.bazel

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,7 @@ licenses(["notice"])
1010
ts_library(
1111
name = "create",
1212
package_name = "@angular/create",
13-
srcs = glob(
14-
["**/*.ts"],
15-
exclude = [
16-
# NB: we need to exclude the nested node_modules that is laid out by yarn workspaces
17-
"node_modules/**",
18-
],
19-
),
13+
srcs = ["src/index.ts"],
2014
deps = [
2115
"//packages/angular/cli:angular-cli",
2216
"@npm//@types/node",

packages/angular/pwa/BUILD.bazel

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,8 @@ package(default_visibility = ["//visibility:public"])
1515
ts_library(
1616
name = "pwa",
1717
package_name = "@angular/pwa",
18-
srcs = glob(
19-
["**/*.ts"],
20-
# Currently, this library is used only with the rollup plugin.
21-
# To make it simpler for downstream repositories to compile this, we
22-
# neither provide compile-time deps as an `npm_install` rule, nor do we
23-
# expect the downstream repository to install @types/webpack[-*]
24-
# So we exclude files that depend on webpack typings.
25-
exclude = [
26-
"pwa/files/**/*",
27-
"**/*_spec.ts",
28-
# NB: we need to exclude the nested node_modules that is laid out by yarn workspaces
29-
"node_modules/**",
30-
],
31-
) + [
18+
srcs = [
19+
"pwa/index.ts",
3220
"//packages/angular/pwa:pwa/schema.ts",
3321
],
3422
data = glob(

packages/angular_devkit/benchmark/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ ts_library(
1818
include = ["src/**/*.ts"],
1919
exclude = [
2020
"src/**/*_spec.ts",
21-
"src/**/*_benchmark.ts",
2221
],
2322
),
2423
module_name = "@angular-devkit/benchmark",

packages/angular_devkit/core/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ ts_library(
2020
include = ["src/**/*.ts"],
2121
exclude = [
2222
"src/**/*_spec.ts",
23-
"src/**/*_benchmark.ts",
2423
],
2524
),
2625
data = glob(

packages/angular_devkit/core/node/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ ts_library(
1818
exclude = [
1919
"testing/**/*.ts",
2020
"**/*_spec.ts",
21-
"**/*_benchmark.ts",
2221
],
2322
),
2423
data = ["package.json"],

packages/angular_devkit/core/node/testing/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ ts_library(
1414
include = ["**/*.ts"],
1515
exclude = [
1616
"**/*_spec.ts",
17-
"**/*_benchmark.ts",
1817
],
1918
),
2019
module_name = "@angular-devkit/core/node/testing",

packages/angular_devkit/schematics/BUILD.bazel

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,11 @@ ts_library(
2020
include = ["src/**/*.ts"],
2121
exclude = [
2222
"src/**/*_spec.ts",
23-
"src/**/*_benchmark.ts",
24-
],
25-
),
26-
data = glob(
27-
include = ["**/*.json"],
28-
exclude = [
29-
# NB: we need to exclude the nested node_modules that is laid out by yarn workspaces
30-
"node_modules/**",
3123
],
3224
),
25+
data = [
26+
"package.json",
27+
],
3328
module_name = "@angular-devkit/schematics",
3429
module_root = "src/index.d.ts",
3530
deps = [

packages/angular_devkit/schematics/tasks/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ ts_library(
1515
exclude = [
1616
"node/**/*.ts",
1717
"**/*_spec.ts",
18-
"**/*_benchmark.ts",
1918
],
2019
),
2120
data = ["package.json"],

0 commit comments

Comments
 (0)