blob: 295c6d5c39df92050a570768a6db3e683e9ebef1 [file] [log] [blame]
Sean Condon0a884ad2019-10-28 17:57:21 +00001workspace(
2 name = "org_onosproject_onos",
3 managed_directories = {
4 "@gui1_npm": ["tools/gui/node_modules"],
Sean Condondfc6dba2019-11-09 11:50:23 +00005 "@npm": ["web/gui2-fw-lib/node_modules"],
Sean Condon0a884ad2019-10-28 17:57:21 +00006 },
7)
Ray Milkey6b3775a2018-06-28 11:18:44 -07008
Thomas Vachuska46848a82018-08-13 14:32:05 -07009load("//tools/build/bazel:bazel_version.bzl", "check_bazel_version")
Ray Milkey5063f5b2018-08-15 16:22:30 -070010
Thomas Vachuska46848a82018-08-13 14:32:05 -070011check_bazel_version()
12
Sean Condondfc6dba2019-11-09 11:50:23 +000013load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
14
15# It is necessary to explicitly load this version of bazel-skylib for the
16# GUI build with native bazel e.g. ts_web_test_suite or ts_library. If not specified
17# here an older version is pulled in by something else. It may be possible to update
18# this once other tools are updated
19BAZEL_SKYLIB_VERSION = "1.0.2"
20
21BAZEL_SKYLIB_SHA256 = "97e70364e9249702246c0e9444bccdc4b847bed1eb03c5a3ece4f83dfe6abc44"
22
23http_archive(
24 name = "bazel_skylib",
25 sha256 = BAZEL_SKYLIB_SHA256,
26 urls = [
27 "https://github.com/bazelbuild/bazel-skylib/releases/download/%s/bazel-skylib-%s.tar.gz" % (BAZEL_SKYLIB_VERSION, BAZEL_SKYLIB_VERSION),
28 ],
29)
30
31load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
32
33bazel_skylib_workspace()
34
Thomas Vachuskac4d03772018-11-26 10:53:58 -080035load("//tools/build/bazel:local_jar.bzl", "local_atomix", "local_jar", "local_yang_tools")
Thomas Vachuska9379a072018-08-21 14:19:02 -070036
37# Use this to build against locally built arbitrary 3rd party artifacts
38#local_jar(
39# name = "atomix",
Thomas Vachuskad389a6e2018-10-29 15:17:17 -070040# path = "/Users/tom/atomix/core/target/atomix-3.0.8-SNAPSHOT.jar",
Thomas Vachuska9379a072018-08-21 14:19:02 -070041#)
42
43# Use this to build against locally built Atomix
44#local_atomix(
Thomas Vachuskad389a6e2018-10-29 15:17:17 -070045# path = "/Users/tom/atomix",
46# version = "3.0.8-SNAPSHOT",
Thomas Vachuska9379a072018-08-21 14:19:02 -070047#)
48
Thomas Vachuskac4d03772018-11-26 10:53:58 -080049# Use this to build against locally built YANG tools
50#local_yang_tools(
51# path = "/Users/andrea/onos-yang-tools",
52# version = "2.6-SNAPSHOT",
53#)
54
Carmelo Cascone72893b72018-08-09 00:59:06 -070055load("//tools/build/bazel:generate_workspace.bzl", "generated_maven_jars")
Ray Milkey5063f5b2018-08-15 16:22:30 -070056
Ray Milkey7dac7da2017-08-01 16:56:05 -070057generated_maven_jars()
Carmelo Cascone72893b72018-08-09 00:59:06 -070058
59load("//tools/build/bazel:protobuf_workspace.bzl", "generate_protobuf")
Ray Milkey5063f5b2018-08-15 16:22:30 -070060
Carmelo Cascone72893b72018-08-09 00:59:06 -070061generate_protobuf()
62
Carmelo Casconeb9536692019-05-28 18:15:23 -070063load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
64
65protobuf_deps()
66
Carmelo Cascone72893b72018-08-09 00:59:06 -070067load("//tools/build/bazel:grpc_workspace.bzl", "generate_grpc")
Ray Milkey5063f5b2018-08-15 16:22:30 -070068
Ray Milkey30773582018-07-26 15:52:23 -070069generate_grpc()
Ray Milkey7dac7da2017-08-01 16:56:05 -070070
Carmelo Cascone72893b72018-08-09 00:59:06 -070071load("@io_grpc_grpc_java//:repositories.bzl", "grpc_java_repositories")
Carmelo Cascone72893b72018-08-09 00:59:06 -070072
Carmelo Casconeb9536692019-05-28 18:15:23 -070073# We omit as many dependencies as we can and instead import the same via
74# deps.json, so they get wrapped properly for Karaf runtime.
Ray Milkey5063f5b2018-08-15 16:22:30 -070075grpc_java_repositories(
Carmelo Casconeb9536692019-05-28 18:15:23 -070076 omit_bazel_skylib = False,
77 omit_com_google_android_annotations = False,
Carmelo Cascone6a1ae712018-08-10 12:19:47 -070078 omit_com_google_api_grpc_google_common_protos = True,
Carmelo Cascone6a1ae712018-08-10 12:19:47 -070079 omit_com_google_auth_google_auth_library_credentials = True,
Carmelo Casconeef478a62019-01-29 18:45:22 -080080 omit_com_google_auth_google_auth_library_oauth2_http = True,
Carmelo Cascone72893b72018-08-09 00:59:06 -070081 omit_com_google_code_findbugs_jsr305 = True,
82 omit_com_google_code_gson = True,
Ray Milkey5063f5b2018-08-15 16:22:30 -070083 omit_com_google_errorprone_error_prone_annotations = True,
Carmelo Cascone72893b72018-08-09 00:59:06 -070084 omit_com_google_guava = True,
Carmelo Casconeb9536692019-05-28 18:15:23 -070085 omit_com_google_guava_failureaccess = False,
Carmelo Casconeef478a62019-01-29 18:45:22 -080086 omit_com_google_j2objc_j2objc_annotations = True,
Carmelo Cascone72893b72018-08-09 00:59:06 -070087 omit_com_google_protobuf = True,
88 omit_com_google_protobuf_javalite = True,
Carmelo Cascone72893b72018-08-09 00:59:06 -070089 omit_com_google_truth_truth = True,
90 omit_com_squareup_okhttp = True,
91 omit_com_squareup_okio = True,
Carmelo Casconeb9536692019-05-28 18:15:23 -070092 omit_io_grpc_grpc_proto = True,
Carmelo Cascone72893b72018-08-09 00:59:06 -070093 omit_io_netty_buffer = True,
Carmelo Cascone72893b72018-08-09 00:59:06 -070094 omit_io_netty_codec = True,
Carmelo Cascone72893b72018-08-09 00:59:06 -070095 omit_io_netty_codec_http = True,
96 omit_io_netty_codec_http2 = True,
Ray Milkey5063f5b2018-08-15 16:22:30 -070097 omit_io_netty_codec_socks = True,
98 omit_io_netty_common = True,
Carmelo Cascone72893b72018-08-09 00:59:06 -070099 omit_io_netty_handler = True,
100 omit_io_netty_handler_proxy = True,
101 omit_io_netty_resolver = True,
102 omit_io_netty_tcnative_boringssl_static = True,
Ray Milkey5063f5b2018-08-15 16:22:30 -0700103 omit_io_netty_transport = True,
104 omit_io_opencensus_api = True,
105 omit_io_opencensus_grpc_metrics = True,
Carmelo Casconecf6a8282019-07-14 20:01:51 -0700106 omit_io_perfmark = True,
Carmelo Casconeb9536692019-05-28 18:15:23 -0700107 omit_javax_annotation = True,
Carmelo Cascone72893b72018-08-09 00:59:06 -0700108 omit_junit_junit = True,
Carmelo Casconeb9536692019-05-28 18:15:23 -0700109 omit_net_zlib = True,
Ray Milkey5063f5b2018-08-15 16:22:30 -0700110 omit_org_apache_commons_lang3 = True,
Ray Milkeyefb6cc52019-04-24 13:45:18 -0700111 omit_org_codehaus_mojo_animal_sniffer_annotations = True,
Carmelo Cascone72893b72018-08-09 00:59:06 -0700112)
113
Carmelo Cascone72893b72018-08-09 00:59:06 -0700114load("//tools/build/bazel:p4lang_workspace.bzl", "generate_p4lang")
Carmelo Cascone72893b72018-08-09 00:59:06 -0700115
Ray Milkey5063f5b2018-08-15 16:22:30 -0700116generate_p4lang()
Carmelo Cascone72893b72018-08-09 00:59:06 -0700117
Yi Tsenge671fc92018-10-31 15:34:30 -0700118load("//tools/build/bazel:gnmi_workspace.bzl", "generate_gnmi")
119
120generate_gnmi()
121
oleksandr.yashchuk@plvision.eu3dbcaaf2019-03-13 14:44:46 +0200122load("//tools/build/bazel:gnoi_workspace.bzl", "generate_gnoi")
123
124generate_gnoi()
125
Sean Condondfc6dba2019-11-09 11:50:23 +0000126# For GUI2 build
127RULES_NODEJS_VERSION = "0.37.0"
128
129RULES_NODEJS_SHA256 = "0d9660cf0894f1fe1e9840818553e0080fbce0851169812d77a70bdb9981c946"
Ray Milkey973d11e2018-12-13 15:55:08 -0800130
Sean Condon0a884ad2019-10-28 17:57:21 +0000131http_archive(
Carmelo Cascone72893b72018-08-09 00:59:06 -0700132 name = "build_bazel_rules_nodejs",
Sean Condondfc6dba2019-11-09 11:50:23 +0000133 sha256 = RULES_NODEJS_SHA256,
134 urls = [
135 "https://github.com/bazelbuild/rules_nodejs/releases/download/%s/rules_nodejs-%s.tar.gz" % (RULES_NODEJS_VERSION, RULES_NODEJS_VERSION),
136 ],
Ray Milkey6b3775a2018-06-28 11:18:44 -0700137)
138
Sean Condondfc6dba2019-11-09 11:50:23 +0000139# Rules for compiling sass
140RULES_SASS_VERSION = "86ca977cf2a8ed481859f83a286e164d07335116"
Ray Milkey5063f5b2018-08-15 16:22:30 -0700141
Sean Condondfc6dba2019-11-09 11:50:23 +0000142RULES_SASS_SHA256 = "4f05239080175a3f4efa8982d2b7775892d656bb47e8cf56914d5f9441fb5ea6"
143
144http_archive(
145 name = "io_bazel_rules_sass",
146 sha256 = RULES_SASS_SHA256,
147 strip_prefix = "rules_sass-%s" % RULES_SASS_VERSION,
148 url = "https://github.com/bazelbuild/rules_sass/archive/%s.zip" % RULES_SASS_VERSION,
149)
150
151load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "npm_install", "yarn_install")
152
153# Setup the Node repositories. We need a NodeJS version that is more recent than v10.15.0
154# because "selenium-webdriver" which is required for "ng e2e" cannot be installed.
Sean Condon2f1fb8d2018-08-31 16:05:02 +0100155node_repositories(
Sean Condon0a884ad2019-10-28 17:57:21 +0000156 node_repositories = {
157 "10.16.0-darwin_amd64": ("node-v10.16.0-darwin-x64.tar.gz", "node-v10.16.0-darwin-x64", "6c009df1b724026d84ae9a838c5b382662e30f6c5563a0995532f2bece39fa9c"),
158 "10.16.0-linux_amd64": ("node-v10.16.0-linux-x64.tar.xz", "node-v10.16.0-linux-x64", "1827f5b99084740234de0c506f4dd2202a696ed60f76059696747c34339b9d48"),
159 "10.16.0-windows_amd64": ("node-v10.16.0-win-x64.zip", "node-v10.16.0-win-x64", "aa22cb357f0fb54ccbc06b19b60e37eefea5d7dd9940912675d3ed988bf9a059"),
160 },
161 node_version = "10.16.0",
Sean Condon2f1fb8d2018-08-31 16:05:02 +0100162)
Ray Milkey6b3775a2018-06-28 11:18:44 -0700163
Sean Condondfc6dba2019-11-09 11:50:23 +0000164# TODO give this a name like `gui2_npm` once the @bazel/karma tools can tolerate a name other than `npm`
165yarn_install(
166 name = "npm",
167 package_json = "//web/gui2-fw-lib:package.json",
168 yarn_lock = "//web/gui2-fw-lib:yarn.lock",
169)
Sean Condon0a884ad2019-10-28 17:57:21 +0000170
171npm_install(
172 # Name this npm so that Bazel Label references look like @npm//package
173 name = "gui1_npm",
174 package_json = "//tools/gui:package.json",
175 package_lock_json = "//tools/gui:package-lock.json",
176)
177
Sean Condon0a884ad2019-10-28 17:57:21 +0000178# Install any Bazel rules which were extracted earlier by the npm_install rule.
Sean Condondfc6dba2019-11-09 11:50:23 +0000179# Versions are set in web/gui2-fw-lib/package.json
180load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies")
Sean Condon0a884ad2019-10-28 17:57:21 +0000181
182install_bazel_dependencies()
Ray Milkey5063f5b2018-08-15 16:22:30 -0700183
Sean Condondfc6dba2019-11-09 11:50:23 +0000184RULES_WEBTESTING_VERSION = "0.3.1"
185
186RULES_WEBTESTING_SHA256 = "f89ca8e91ac53b3c61da356c685bf03e927f23b97b086cc593db8edc088c143f"
187
188http_archive(
189 name = "io_bazel_rules_webtesting",
190 sha256 = RULES_WEBTESTING_SHA256,
191 urls = [
192 "https://github.com/bazelbuild/rules_webtesting/releases/download/%s/rules_webtesting.tar.gz" % RULES_WEBTESTING_VERSION,
193 ],
194)
195
196load("//tools/build/bazel:angular_workspace.bzl", "load_angular")
197
198load_angular()
199
Ray Milkey5063f5b2018-08-15 16:22:30 -0700200# buildifier is written in Go and hence needs rules_go to be built.
201# See https://github.com/bazelbuild/rules_go for the up to date setup instructions.
Sean Condondfc6dba2019-11-09 11:50:23 +0000202RULES_GO_VERSION = "v0.19.8"
203
204RULES_GO_SHA256 = "9976c2572587aa71f81b502cc870ef8058f6de37f5fcfaade6a5996934b4a324"
205
Ray Milkey5063f5b2018-08-15 16:22:30 -0700206http_archive(
207 name = "io_bazel_rules_go",
Sean Condondfc6dba2019-11-09 11:50:23 +0000208 sha256 = RULES_GO_SHA256,
Carmelo Cascone21eb0422019-06-17 12:00:33 -0700209 urls = [
Sean Condondfc6dba2019-11-09 11:50:23 +0000210 "https://storage.googleapis.com/bazel-mirror/github.com/bazelbuild/rules_go/releases/download/%s/rules_go-%s.tar.gz" % (RULES_GO_VERSION, RULES_GO_VERSION),
211 "https://github.com/bazelbuild/rules_go/releases/download/%s/rules_go-%s.tar.gz" % (RULES_GO_VERSION, RULES_GO_VERSION),
Carmelo Cascone21eb0422019-06-17 12:00:33 -0700212 ],
Ray Milkey5063f5b2018-08-15 16:22:30 -0700213)
214
Carmelo Cascone21eb0422019-06-17 12:00:33 -0700215load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
216
217go_rules_dependencies()
218
219go_register_toolchains()
220
Sean Condondfc6dba2019-11-09 11:50:23 +0000221GAZELLE_VERSION = "0.18.1"
222
223GAZELLE_SHA256 = "be9296bfd64882e3c08e3283c58fcb461fa6dd3c171764fcc4cf322f60615a9b"
224
Ray Milkey5063f5b2018-08-15 16:22:30 -0700225http_archive(
Thomas Vachuska2bf24532019-10-14 15:41:45 -0700226 name = "bazel_gazelle",
Sean Condondfc6dba2019-11-09 11:50:23 +0000227 sha256 = GAZELLE_SHA256,
Thomas Vachuska2bf24532019-10-14 15:41:45 -0700228 urls = [
Sean Condondfc6dba2019-11-09 11:50:23 +0000229 "https://storage.googleapis.com/bazel-mirror/github.com/bazelbuild/bazel-gazelle/releases/download/%s/bazel-gazelle-%s.tar.gz" % (GAZELLE_VERSION, GAZELLE_VERSION),
230 "https://github.com/bazelbuild/bazel-gazelle/releases/download/%s/bazel-gazelle-%s.tar.gz" % (GAZELLE_VERSION, GAZELLE_VERSION),
Thomas Vachuska2bf24532019-10-14 15:41:45 -0700231 ],
Ray Milkey5063f5b2018-08-15 16:22:30 -0700232)
233
Thomas Vachuska2bf24532019-10-14 15:41:45 -0700234load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
Ray Milkey5063f5b2018-08-15 16:22:30 -0700235
Thomas Vachuska2bf24532019-10-14 15:41:45 -0700236gazelle_dependencies()
237
Sean Condondfc6dba2019-11-09 11:50:23 +0000238BUILDTOOLS_VERSION = "0.29.0"
239
240BUILDTOOLS_SHA256 = "05eb52437fb250c7591dd6cbcfd1f9b5b61d85d6b20f04b041e0830dd1ab39b3"
241
Thomas Vachuska2bf24532019-10-14 15:41:45 -0700242http_archive(
Thomas Vachuska2bf24532019-10-14 15:41:45 -0700243 name = "com_github_bazelbuild_buildtools",
Sean Condondfc6dba2019-11-09 11:50:23 +0000244 sha256 = BUILDTOOLS_SHA256,
245 strip_prefix = "buildtools-" + BUILDTOOLS_VERSION,
246 url = "https://github.com/bazelbuild/buildtools/archive/%s.zip" % BUILDTOOLS_VERSION,
Thomas Vachuska2bf24532019-10-14 15:41:45 -0700247)