Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.

Commit 21931e1

Browse files
committed
build: implement the first bazel configuration for DevKit
1 parent 817ef8e commit 21931e1

File tree

11 files changed

+169
-0
lines changed

11 files changed

+169
-0
lines changed

.bazelrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Disable sandboxing because it's too slow.
2+
# https://github.com/bazelbuild/bazel/issues/2424
3+
# TODO(alexeagle): do use the sandbox on CI
4+
#build --spawn_strategy=standalone
5+
6+
# Performance: avoid stat'ing input files
7+
build --watchfs
8+

BUILD

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package(default_visibility = ["//visibility:public"])
2+
exports_files(["tsconfig.json"])
3+
4+
# NOTE: this will move to node_modules/BUILD in a later release
5+
filegroup(name = "node_modules", srcs = glob(["node_modules/**/*"]))

WORKSPACE

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
2+
3+
git_repository(
4+
name = "io_bazel_rules_typescript",
5+
remote = "https://github.com/bazelbuild/rules_typescript.git",
6+
tag = "0.0.2",
7+
)
8+
9+
load("@io_bazel_rules_typescript//:defs.bzl", "node_repositories", "yarn_install")
10+
11+
node_repositories()
12+
yarn_install(package_json = "//:package.json")

packages/schematics/BUILD

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package(default_visibility=["//visibility:private"])
2+
load("@io_bazel_rules_typescript//:defs.bzl", "ts_library")
3+
4+
exports_files(["tsconfig.json"])
5+
6+
7+
ts_library(
8+
name = "schematics",
9+
srcs = [
10+
"src/index.ts",
11+
],
12+
deps = [
13+
"//packages/schematics/src/engine",
14+
"//packages/schematics/src/exception",
15+
"//packages/schematics/src/rules",
16+
"//packages/schematics/src/sink",
17+
"//packages/schematics/src/tree",
18+
],
19+
tsconfig = "//:tsconfig.json",
20+
visibility = [ "//visibility:public" ],
21+
module_name = "@angular/schematics",
22+
module_root = "src"
23+
)

packages/schematics/src/engine/BUILD

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package(default_visibility=["//visibility:public"])
2+
load("@io_bazel_rules_typescript//:defs.bzl", "ts_library")
3+
4+
5+
ts_library(
6+
name = "engine",
7+
srcs = glob(["*.ts"]),
8+
deps = [
9+
"//packages/schematics/src/exception",
10+
"//packages/schematics/src/tree",
11+
],
12+
tsconfig = "//:tsconfig.json",
13+
)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package(default_visibility=["//visibility:public"])
2+
load("@io_bazel_rules_typescript//:defs.bzl", "ts_library")
3+
4+
5+
ts_library(
6+
name = "exception",
7+
srcs = glob(["*.ts"]),
8+
deps = [],
9+
tsconfig = "//:tsconfig.json",
10+
)

packages/schematics/src/rules/BUILD

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package(default_visibility=["//visibility:public"])
2+
load("@io_bazel_rules_typescript//:defs.bzl", "ts_library")
3+
4+
5+
ts_library(
6+
name = "rules",
7+
srcs = glob(["*.ts", "*/*.ts"]),
8+
deps = [
9+
"//packages/schematics/src/engine",
10+
"//packages/schematics/src/exception",
11+
"//packages/schematics/src/tree",
12+
],
13+
tsconfig = "//:tsconfig.json",
14+
)

packages/schematics/src/sink/BUILD

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package(default_visibility=["//visibility:public"])
2+
load("@io_bazel_rules_typescript//:defs.bzl", "ts_library")
3+
4+
5+
ts_library(
6+
name = "sink",
7+
srcs = glob(["*.ts"]),
8+
deps = [
9+
"//packages/schematics/src/exception",
10+
"//packages/schematics/src/tree",
11+
],
12+
tsconfig = "//:tsconfig.json",
13+
)

packages/schematics/src/tree/BUILD

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package(default_visibility=["//visibility:public"])
2+
load("@io_bazel_rules_typescript//:defs.bzl", "ts_library")
3+
4+
5+
ts_library(
6+
name = "tree",
7+
srcs = glob(["*.ts"]),
8+
deps = [
9+
"//packages/schematics/src/exception",
10+
"//packages/schematics/src/utility",
11+
],
12+
tsconfig = "//:tsconfig.json",
13+
)

packages/schematics/src/utility/BUILD

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package(default_visibility=["//visibility:public"])
2+
load("@io_bazel_rules_typescript//:defs.bzl", "ts_library")
3+
4+
5+
ts_library(
6+
name = "utility",
7+
srcs = glob(["*.ts"]),
8+
deps = [
9+
"//packages/schematics/src/exception",
10+
],
11+
tsconfig = "//:tsconfig.json",
12+
)

packages/schematics_cli/BUILD

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
package(default_visibility=["//visibility:public"])
2+
load("@io_bazel_rules_typescript//:defs.bzl", "ts_library")
3+
load("@io_bazel_rules_typescript//internal:node.bzl", "node_binary")
4+
5+
6+
ts_library(
7+
name = "schematics",
8+
srcs = glob([
9+
"schematics/*.ts",
10+
"schematics/*/index.ts",
11+
"schematics/component/utility/*.ts"
12+
]),
13+
deps = [
14+
"//packages/schematics",
15+
],
16+
tsconfig = "//:tsconfig.json",
17+
)
18+
19+
20+
ts_library(
21+
name = "cli_lib",
22+
srcs = glob([ "src/*.ts" ]),
23+
deps = [
24+
"//packages/schematics",
25+
],
26+
tsconfig = "//:tsconfig.json",
27+
)
28+
29+
30+
filegroup(
31+
name = "schematics_data",
32+
srcs = glob([ "schematics/*/files/**/*" ])
33+
)
34+
35+
36+
37+
node_binary(
38+
name = "schematics_cli",
39+
main = "__main__/packages/schematics_cli/bin/schematics.js",
40+
data = [
41+
"bin/schematics.js",
42+
":cli_lib",
43+
":schematics",
44+
":schematics_data",
45+
],
46+
)

0 commit comments

Comments
 (0)