1# Copyright 2016-17, OpenCensus Authors
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#     http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15workspace(name = "opencensus_proto")
16
17load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
18load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
19
20# Import rules_proto for proto_library().
21http_archive(
22    name = "rules_proto",
23    sha256 = "602e7161d9195e50246177e7c55b2f39950a9cf7366f74ed5f22fd45750cd208",
24    strip_prefix = "rules_proto-97d8af4dc474595af3900dd85cb3a29ad28cc313",
25    urls = [
26        "https://mirror.bazel.build/github.com/bazelbuild/rules_proto/archive/97d8af4dc474595af3900dd85cb3a29ad28cc313.tar.gz",
27        "https://github.com/bazelbuild/rules_proto/archive/97d8af4dc474595af3900dd85cb3a29ad28cc313.tar.gz",
28    ],
29)
30load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")
31rules_proto_dependencies()
32rules_proto_toolchains()
33
34# Import grpc for cc_grpc_library().
35http_archive(
36    name = "com_github_grpc_grpc",
37    sha256 = "bbda0588df1b31aca41b83d09cf69816df653b5a89f820d16ab95af8eb1f9072",
38    strip_prefix = "grpc-b1547c9d19034740b1e5b4d73cb91d068dc0acb4",
39    urls = ["https://github.com/grpc/grpc/archive/b1547c9d19034740b1e5b4d73cb91d068dc0acb4.zip"],
40)
41
42load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
43grpc_deps()
44
45# grpc_deps() cannot load() its deps, this WORKSPACE has to do it.
46# See also: https://github.com/bazelbuild/bazel/issues/1943
47load(
48    "@build_bazel_rules_apple//apple:repositories.bzl",
49    "apple_rules_dependencies",
50)
51
52apple_rules_dependencies()
53
54load(
55    "@build_bazel_apple_support//lib:repositories.bzl",
56    "apple_support_dependencies",
57)
58
59apple_support_dependencies()
60
61load("@upb//bazel:repository_defs.bzl", "bazel_version_repository")
62
63bazel_version_repository(name = "bazel_version")
64
65# go rules related
66git_repository(
67    name = "io_bazel_rules_go",
68    remote = "https://github.com/bazelbuild/rules_go.git",
69    # we need rules_go of tag 0.12.0 or greater
70    # which includes golang protobuf that supports "paths=source_relative"
71    # the "paths=source_relative" option for protoc-gen-go makes bazel works as expect
72    # when go_package was declared in proto files
73    # see https://github.com/bazelbuild/rules_go/blob/release-0.12/go/private/repositories.bzl#L75
74    # for the included golang protobuf version and
75    # see https://github.com/golang/protobuf/pull/544 for "paths=source_relative" usage
76    tag = "v0.19.9",
77)
78
79load("@io_bazel_rules_go//go:deps.bzl", "go_rules_dependencies", "go_register_toolchains")
80go_rules_dependencies()
81go_register_toolchains()
82
83# py rules related
84http_archive(
85    name = "six_archive",
86    build_file = "@com_google_protobuf//:six.BUILD",
87    sha256 = "105f8d68616f8248e24bf0e9372ef04d3cc10104f1980f54d57b2ce73a5ad56a",
88    urls = ["https://pypi.python.org/packages/source/s/six/six-1.10.0.tar.gz#md5=34eed507548117b2ab523ab14b2f8b55"],
89)
90
91bind(
92    name = "six",
93    actual = "@six_archive//:six",
94)
95