Repository navigation
Expand file tree
/
Copy pathWORKSPACE
More file actions
117 lines (89 loc) · 3.95 KB
/
Copy pathWORKSPACE
File metadata and controls
117 lines (89 loc) · 3.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# The WORKSPACE file tells Bazel that this directory is a "workspace", which is like a project root.
# The content of this file specifies all the external dependencies Bazel needs to perform a build.
####################################
# ESModule imports (and TypeScript imports) can be absolute starting with the workspace name.
# The name of the workspace should match the npm package where we publish, so that these
# imports also make sense when referencing the published package.
workspace(name = "angular_bazel_example")
http_archive(
name = "build_bazel_rules_nodejs",
# These sources are on the web_package branch
url = "https://github.com/alexeagle/rules_nodejs/archive/944ec65f0ce0c0960e44b0910a198bc56cd494ed.zip",
strip_prefix = "rules_nodejs-944ec65f0ce0c0960e44b0910a198bc56cd494ed",
)
http_archive(
name = "build_bazel_rules_typescript",
# These sources are on the web_package branch
url = "https://github.com/alexeagle/rules_typescript/archive/74a8d684886e727100db2254620551dfcff6ecee.zip",
strip_prefix = "rules_typescript-74a8d684886e727100db2254620551dfcff6ecee",
)
# The Bazel buildtools repo contains tools like the BUILD file formatter, buildifier
BAZEL_BUILDTOOLS_VERSION = "49a6c199e3fbf5d94534b2771868677d3f9c6de9"
http_archive(
name = "com_github_bazelbuild_buildtools",
url = "https://github.com/bazelbuild/buildtools/archive/%s.zip" % BAZEL_BUILDTOOLS_VERSION,
strip_prefix = "buildtools-%s" % BAZEL_BUILDTOOLS_VERSION,
sha256 = "edf39af5fc257521e4af4c40829fffe8fba6d0ebff9f4dd69a6f8f1223ae047b",
)
# The @angular repo contains rule for building Angular applications
http_archive(
name = "angular",
url = "https://github.com/angular/angular/archive/7.0.4.zip",
strip_prefix = "angular-7.0.4",
)
# The @rxjs repo contains targets for building rxjs with bazel
http_archive(
name = "rxjs",
url = "https://registry.yarnpkg.com/rxjs/-/rxjs-6.3.3.tgz",
strip_prefix = "package/src",
sha256 = "72b0b4e517f43358f554c125e40e39f67688cd2738a8998b4a266981ed32f403",
)
# Angular material
# Using commit that is compatible with angular 7.0.4
# TODO(gmagolan): Update to https://github.com/angular/material2 v7.0.5 when released
http_archive(
name = "angular_material",
url = "https://github.com/DevVersion/material2/archive/c94e095841b063380b9d2c5611da1ff99445e516.zip",
strip_prefix = "material2-c94e095841b063380b9d2c5611da1ff99445e516",
)
# Rules for compiling sass
http_archive(
name = "io_bazel_rules_sass",
url = "https://github.com/bazelbuild/rules_sass/archive/1.15.1.zip",
strip_prefix = "rules_sass-1.15.1",
)
####################################
# Load and install our dependencies downloaded above.
load("@angular//packages/bazel:package.bzl", "rules_angular_dependencies")
rules_angular_dependencies()
load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_repositories", "yarn_install")
# The minimum bazel version to use with this example repo
# Bazel 0.19 supports the .bazelignore file
check_bazel_version("0.19.0")
node_repositories(
node_version = "10.9.0",
yarn_version = "1.9.2",
)
yarn_install(
name = "npm",
package_json = "//:package.json",
yarn_lock = "//:yarn.lock",
data = ["//:postinstall.tsconfig.json"],
)
load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains")
go_rules_dependencies()
go_register_toolchains()
load("@io_bazel_rules_webtesting//web:repositories.bzl", "browser_repositories", "web_test_repositories")
web_test_repositories()
browser_repositories(
chromium = True,
firefox = True,
)
load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace", "check_rules_typescript_version")
ts_setup_workspace()
load("@io_bazel_rules_sass//:defs.bzl", "sass_repositories")
sass_repositories()
load("@angular//:index.bzl", "ng_setup_workspace")
ng_setup_workspace()
load("@angular_material//:index.bzl", "angular_material_setup_workspace")
angular_material_setup_workspace()