blob: aaafba1505d2b0b4d827931bcb4f9772ad071d28 [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"],
5 "@gui2_npm": ["web/gui2-fw-lib/node_modules"],
6 },
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
Thomas Vachuskac4d03772018-11-26 10:53:58 -080013load("//tools/build/bazel:local_jar.bzl", "local_atomix", "local_jar", "local_yang_tools")
Thomas Vachuska9379a072018-08-21 14:19:02 -070014
15# Use this to build against locally built arbitrary 3rd party artifacts
16#local_jar(
17# name = "atomix",
Thomas Vachuskad389a6e2018-10-29 15:17:17 -070018# path = "/Users/tom/atomix/core/target/atomix-3.0.8-SNAPSHOT.jar",
Thomas Vachuska9379a072018-08-21 14:19:02 -070019#)
20
21# Use this to build against locally built Atomix
22#local_atomix(
Thomas Vachuskad389a6e2018-10-29 15:17:17 -070023# path = "/Users/tom/atomix",
24# version = "3.0.8-SNAPSHOT",
Thomas Vachuska9379a072018-08-21 14:19:02 -070025#)
26
Thomas Vachuskac4d03772018-11-26 10:53:58 -080027# Use this to build against locally built YANG tools
28#local_yang_tools(
29# path = "/Users/andrea/onos-yang-tools",
30# version = "2.6-SNAPSHOT",
31#)
32
Carmelo Cascone72893b72018-08-09 00:59:06 -070033load("//tools/build/bazel:generate_workspace.bzl", "generated_maven_jars")
Ray Milkey5063f5b2018-08-15 16:22:30 -070034
Ray Milkey7dac7da2017-08-01 16:56:05 -070035generated_maven_jars()
Carmelo Cascone72893b72018-08-09 00:59:06 -070036
37load("//tools/build/bazel:protobuf_workspace.bzl", "generate_protobuf")
Ray Milkey5063f5b2018-08-15 16:22:30 -070038
Carmelo Cascone72893b72018-08-09 00:59:06 -070039generate_protobuf()
40
Carmelo Casconeb9536692019-05-28 18:15:23 -070041load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
42
43protobuf_deps()
44
Carmelo Cascone72893b72018-08-09 00:59:06 -070045load("//tools/build/bazel:grpc_workspace.bzl", "generate_grpc")
Ray Milkey5063f5b2018-08-15 16:22:30 -070046
Ray Milkey30773582018-07-26 15:52:23 -070047generate_grpc()
Ray Milkey7dac7da2017-08-01 16:56:05 -070048
Carmelo Cascone72893b72018-08-09 00:59:06 -070049load("@io_grpc_grpc_java//:repositories.bzl", "grpc_java_repositories")
Carmelo Cascone72893b72018-08-09 00:59:06 -070050
Carmelo Casconeb9536692019-05-28 18:15:23 -070051# We omit as many dependencies as we can and instead import the same via
52# deps.json, so they get wrapped properly for Karaf runtime.
Ray Milkey5063f5b2018-08-15 16:22:30 -070053grpc_java_repositories(
Carmelo Casconeb9536692019-05-28 18:15:23 -070054 omit_bazel_skylib = False,
55 omit_com_google_android_annotations = False,
Carmelo Cascone6a1ae712018-08-10 12:19:47 -070056 omit_com_google_api_grpc_google_common_protos = True,
Carmelo Cascone6a1ae712018-08-10 12:19:47 -070057 omit_com_google_auth_google_auth_library_credentials = True,
Carmelo Casconeef478a62019-01-29 18:45:22 -080058 omit_com_google_auth_google_auth_library_oauth2_http = True,
Carmelo Cascone72893b72018-08-09 00:59:06 -070059 omit_com_google_code_findbugs_jsr305 = True,
60 omit_com_google_code_gson = True,
Ray Milkey5063f5b2018-08-15 16:22:30 -070061 omit_com_google_errorprone_error_prone_annotations = True,
Carmelo Cascone72893b72018-08-09 00:59:06 -070062 omit_com_google_guava = True,
Carmelo Casconeb9536692019-05-28 18:15:23 -070063 omit_com_google_guava_failureaccess = False,
Carmelo Casconeef478a62019-01-29 18:45:22 -080064 omit_com_google_j2objc_j2objc_annotations = True,
Carmelo Cascone72893b72018-08-09 00:59:06 -070065 omit_com_google_protobuf = True,
66 omit_com_google_protobuf_javalite = True,
Carmelo Cascone72893b72018-08-09 00:59:06 -070067 omit_com_google_truth_truth = True,
68 omit_com_squareup_okhttp = True,
69 omit_com_squareup_okio = True,
Carmelo Casconeb9536692019-05-28 18:15:23 -070070 omit_io_grpc_grpc_proto = True,
Carmelo Cascone72893b72018-08-09 00:59:06 -070071 omit_io_netty_buffer = True,
Carmelo Cascone72893b72018-08-09 00:59:06 -070072 omit_io_netty_codec = True,
Carmelo Cascone72893b72018-08-09 00:59:06 -070073 omit_io_netty_codec_http = True,
74 omit_io_netty_codec_http2 = True,
Ray Milkey5063f5b2018-08-15 16:22:30 -070075 omit_io_netty_codec_socks = True,
76 omit_io_netty_common = True,
Carmelo Cascone72893b72018-08-09 00:59:06 -070077 omit_io_netty_handler = True,
78 omit_io_netty_handler_proxy = True,
79 omit_io_netty_resolver = True,
80 omit_io_netty_tcnative_boringssl_static = True,
Ray Milkey5063f5b2018-08-15 16:22:30 -070081 omit_io_netty_transport = True,
82 omit_io_opencensus_api = True,
83 omit_io_opencensus_grpc_metrics = True,
Carmelo Casconecf6a8282019-07-14 20:01:51 -070084 omit_io_perfmark = True,
Carmelo Casconeb9536692019-05-28 18:15:23 -070085 omit_javax_annotation = True,
Carmelo Cascone72893b72018-08-09 00:59:06 -070086 omit_junit_junit = True,
Carmelo Casconeb9536692019-05-28 18:15:23 -070087 omit_net_zlib = True,
Ray Milkey5063f5b2018-08-15 16:22:30 -070088 omit_org_apache_commons_lang3 = True,
Ray Milkeyefb6cc52019-04-24 13:45:18 -070089 omit_org_codehaus_mojo_animal_sniffer_annotations = True,
Carmelo Cascone72893b72018-08-09 00:59:06 -070090)
91
Carmelo Cascone72893b72018-08-09 00:59:06 -070092load("//tools/build/bazel:p4lang_workspace.bzl", "generate_p4lang")
Carmelo Cascone72893b72018-08-09 00:59:06 -070093
Ray Milkey5063f5b2018-08-15 16:22:30 -070094generate_p4lang()
Carmelo Cascone72893b72018-08-09 00:59:06 -070095
Yi Tsenge671fc92018-10-31 15:34:30 -070096load("//tools/build/bazel:gnmi_workspace.bzl", "generate_gnmi")
97
98generate_gnmi()
99
oleksandr.yashchuk@plvision.eu3dbcaaf2019-03-13 14:44:46 +0200100load("//tools/build/bazel:gnoi_workspace.bzl", "generate_gnoi")
101
102generate_gnoi()
103
Sean Condon0a884ad2019-10-28 17:57:21 +0000104load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
Ray Milkey973d11e2018-12-13 15:55:08 -0800105
Sean Condon0a884ad2019-10-28 17:57:21 +0000106http_archive(
Carmelo Cascone72893b72018-08-09 00:59:06 -0700107 name = "build_bazel_rules_nodejs",
Sean Condon0a884ad2019-10-28 17:57:21 +0000108 sha256 = "26c39450ce2d825abee5583a43733863098ed29d3cbaebf084ebaca59a21a1c8",
109 urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.39.0/rules_nodejs-0.39.0.tar.gz"],
Ray Milkey6b3775a2018-06-28 11:18:44 -0700110)
111
Sean Condon0a884ad2019-10-28 17:57:21 +0000112load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories", "npm_install")
Ray Milkey5063f5b2018-08-15 16:22:30 -0700113
Sean Condon2f1fb8d2018-08-31 16:05:02 +0100114node_repositories(
Sean Condon0a884ad2019-10-28 17:57:21 +0000115 node_repositories = {
116 "10.16.0-darwin_amd64": ("node-v10.16.0-darwin-x64.tar.gz", "node-v10.16.0-darwin-x64", "6c009df1b724026d84ae9a838c5b382662e30f6c5563a0995532f2bece39fa9c"),
117 "10.16.0-linux_amd64": ("node-v10.16.0-linux-x64.tar.xz", "node-v10.16.0-linux-x64", "1827f5b99084740234de0c506f4dd2202a696ed60f76059696747c34339b9d48"),
118 "10.16.0-windows_amd64": ("node-v10.16.0-win-x64.zip", "node-v10.16.0-win-x64", "aa22cb357f0fb54ccbc06b19b60e37eefea5d7dd9940912675d3ed988bf9a059"),
119 },
120 node_version = "10.16.0",
121 package_json = ["//web/gui2-fw-lib:package.json"],
Sean Condon2f1fb8d2018-08-31 16:05:02 +0100122)
Ray Milkey6b3775a2018-06-28 11:18:44 -0700123
Sean Condon0a884ad2019-10-28 17:57:21 +0000124# The npm_install rule runs yarn anytime the package.json or package-lock.json file changes.
125# It also extracts any Bazel rules distributed in an npm package.
126load("@build_bazel_rules_nodejs//:index.bzl", "npm_install")
127
128npm_install(
129 # Name this npm so that Bazel Label references look like @npm//package
130 name = "gui1_npm",
131 package_json = "//tools/gui:package.json",
132 package_lock_json = "//tools/gui:package-lock.json",
133)
134
135npm_install(
136 # Name this npm so that Bazel Label references look like @npm//package
137 name = "gui2_npm",
138 package_json = "//web/gui2-fw-lib:package.json",
139 package_lock_json = "//web/gui2-fw-lib:package-lock.json",
140)
141
142# Install any Bazel rules which were extracted earlier by the npm_install rule.
143load("@gui2_npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies")
144
145install_bazel_dependencies()
Ray Milkey5063f5b2018-08-15 16:22:30 -0700146
147# buildifier is written in Go and hence needs rules_go to be built.
148# See https://github.com/bazelbuild/rules_go for the up to date setup instructions.
149http_archive(
150 name = "io_bazel_rules_go",
Thomas Vachuska2bf24532019-10-14 15:41:45 -0700151 sha256 = "9fb16af4d4836c8222142e54c9efa0bb5fc562ffc893ce2abeac3e25daead144",
Carmelo Cascone21eb0422019-06-17 12:00:33 -0700152 urls = [
Thomas Vachuska2bf24532019-10-14 15:41:45 -0700153 "https://storage.googleapis.com/bazel-mirror/github.com/bazelbuild/rules_go/releases/download/0.19.0/rules_go-0.19.0.tar.gz",
154 "https://github.com/bazelbuild/rules_go/releases/download/0.19.0/rules_go-0.19.0.tar.gz",
Carmelo Cascone21eb0422019-06-17 12:00:33 -0700155 ],
Ray Milkey5063f5b2018-08-15 16:22:30 -0700156)
157
Carmelo Cascone21eb0422019-06-17 12:00:33 -0700158load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
159
160go_rules_dependencies()
161
162go_register_toolchains()
163
Ray Milkey5063f5b2018-08-15 16:22:30 -0700164http_archive(
Thomas Vachuska2bf24532019-10-14 15:41:45 -0700165 name = "bazel_gazelle",
166 sha256 = "be9296bfd64882e3c08e3283c58fcb461fa6dd3c171764fcc4cf322f60615a9b",
167 urls = [
168 "https://storage.googleapis.com/bazel-mirror/github.com/bazelbuild/bazel-gazelle/releases/download/0.18.1/bazel-gazelle-0.18.1.tar.gz",
169 "https://github.com/bazelbuild/bazel-gazelle/releases/download/0.18.1/bazel-gazelle-0.18.1.tar.gz",
170 ],
Ray Milkey5063f5b2018-08-15 16:22:30 -0700171)
172
Thomas Vachuska2bf24532019-10-14 15:41:45 -0700173load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
Ray Milkey5063f5b2018-08-15 16:22:30 -0700174
Thomas Vachuska2bf24532019-10-14 15:41:45 -0700175gazelle_dependencies()
176
177http_archive(
Thomas Vachuska2bf24532019-10-14 15:41:45 -0700178 name = "com_github_bazelbuild_buildtools",
Carmelo Cascone71ba99f2019-10-24 16:34:02 -0700179 sha256 = "05eb52437fb250c7591dd6cbcfd1f9b5b61d85d6b20f04b041e0830dd1ab39b3",
180 strip_prefix = "buildtools-0.29.0",
181 url = "https://github.com/bazelbuild/buildtools/archive/0.29.0.zip",
Thomas Vachuska2bf24532019-10-14 15:41:45 -0700182)