-
Notifications
You must be signed in to change notification settings - Fork 314
/
repo.bzl
157 lines (139 loc) · 6.46 KB
/
repo.bzl
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
"""Skylark rules to setup the WORKSPACE in the opensource bazel world."""
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# These dependencies are required for *developing* this project.
def _development_repositories():
# Needed by @com_google_protobuf//:protobuf_java_util
native.bind(
name = "guava",
actual = "@maven//:com_google_guava_guava",
)
# Needed by @com_google_protobuf//:protobuf_java_util
native.bind(
name = "gson",
actual = "@maven//:com_google_code_gson_gson",
)
http_archive(
name = "robolectric",
strip_prefix = "robolectric-bazel-4.13",
sha256 = "a270fd6fd83f9f024623e787696e6b73c44664b7c95f3d937ed35bf0a94a67ae",
urls = ["https://github.com/robolectric/robolectric-bazel/releases/download/4.13/robolectric-bazel-4.13.tar.gz"],
)
# uncomment to test with new robolectric version. Change path to point to local filesystem
# clone of https://github.com/robolectric/robolectric-bazel
# native.local_repository(
# name = "robolectric",
# path = "~/github/robolectric-bazel/",
# )
# These dependencies are for *users* of the Android Test repo,
# i.e. specifying this repository as @androidx_test in their
# WORKSPACE using a repository_rule like git_repository or http_archive.
# Use parameter `with_dev_repositories = True` to download the dev
# repositories as well.
def android_test_repositories(with_dev_repositories = False):
"""Loads the workspace by downloading the required dependencies."""
if with_dev_repositories:
_development_repositories()
# Several of the repositories here end in _archive. This is due to an issue
# with the Bazel python rules that occurs if the repository name is the same
# as the top level directory of that repository. For example, suppose //:a
# depends on @b//:b and @b//:b is defined by
#
# filegroup(
# name = "b",
# srcs = ["b/c.py"],
# )
#
# Then the execroot looks like
#
# bazel-bin/
# - a
# - a.runfiles/
# - b/
# - b/
# - c.py
# - __init__.py
# - __init__.py
# - __main__/
# - a
# - a.py
# - __init__.py
#
# The Python path for a.py contains, in order, the following:
#
# [a.runfiles, a.runfiles/b, a.runfiles/__main__]
#
# If a.py contains `from b import c`, then python will find a.runfiles on
# the Python path, see that it contains both __init__.py and b/ but does not
# contain c.py and will error out.
#
# On the other hand, if we call @b//:b @b_archive//:b, then the first entry on
# the python path containing b/ is a.runfiles/b_archive which contains all of
# __init__.py, b/ and b/c.py so the import will succeed.
http_archive(
name = "google_apputils",
build_file = str(Label("//opensource:google-apputils.BUILD")),
sha256 = "47959d0651c32102c10ad919b8a0ffe0ae85f44b8457ddcf2bdc0358fb03dc29",
strip_prefix = "google-apputils-0.4.2",
url = "https://pypi.python.org/packages/69/66/a511c428fef8591c5adfa432a257a333e0d14184b6c5d03f1450827f7fe7/google-apputils-0.4.2.tar.gz",
)
http_archive(
name = "gflags_archive",
build_file = str(Label("//opensource:gflags.BUILD")),
sha256 = "3377d9dbeedb99c0325beb1f535f8fa9fa131d1d8b50db7481006f0a4c6919b4",
strip_prefix = "python-gflags-3.1.0",
url = "https://github.com/google/python-gflags/releases/download/3.1.0/python-gflags-3.1.0.tar.gz",
)
http_archive(
name = "portpicker_archive",
build_file = str(Label("//opensource:portpicker.BUILD")),
sha256 = "2f88edf7c6406034d7577846f224aff6e53c5f4250e3294b1904d8db250f27ec",
strip_prefix = "portpicker-1.1.1/src",
url = "https://pypi.python.org/packages/96/48/0e1f20fdc0b85cc8722284da3c5b80222ae4036ad73210a97d5362beaa6d/portpicker-1.1.1.tar.gz",
)
http_archive(
name = "mox_archive",
build_file = str(Label("//opensource:mox.BUILD")),
sha256 = "424ee725ee12652802b4e86571f816059b0d392401ceae70bf6487d65602cba9",
strip_prefix = "mox-0.5.3",
url = "https://pypi.python.org/packages/0c/a1/64740c638cc5fae807022368f4141700518ee343b53eb3e90bf3cc15a4d4/mox-0.5.3.tar.gz#md5=6de7371e7e8bd9e2dad3fef2646f4a43",
)
# Six provides simple utilities for wrapping over differences between Python 2 and Python 3.
http_archive(
name = "six_archive",
build_file = str(Label("//opensource:six.BUILD")),
sha256 = "105f8d68616f8248e24bf0e9372ef04d3cc10104f1980f54d57b2ce73a5ad56a",
strip_prefix = "six-1.10.0",
url = "https://pypi.python.org/packages/source/s/six/six-1.10.0.tar.gz",
)
# Needed by protobuf
native.bind(name = "six", actual = "@six_archive//:six")
# Protobuf
http_archive(
name = "com_google_protobuf",
sha256 = "d82eb0141ad18e98de47ed7ed415daabead6d5d1bef1b8cccb6aa4d108a9008f",
strip_prefix = "protobuf-b4f193788c9f0f05d7e0879ea96cd738630e5d51",
# Commit from 2019-05-15, update to protobuf 3.8 when available.
url = "https://github.com/protocolbuffers/protobuf/archive/b4f193788c9f0f05d7e0879ea96cd738630e5d51.tar.gz",
)
# Protobuf's dependencies
# Inlined protobuf's deps so we don't need users to add protobuf_deps() to their local WORKSPACE.
# From load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps").
http_archive(
name = "zlib",
build_file = "@com_google_protobuf//:third_party/zlib.BUILD",
sha256 = "91844808532e5ce316b3c010929493c0244f3d37593afd6de04f71821d5136d9",
strip_prefix = "zlib-1.2.12",
urls = ["https://zlib.net/zlib-1.2.12.tar.gz"],
)
http_archive(
name = "bazel_skylib",
url = "https://github.com/bazelbuild/bazel-skylib/releases/download/0.8.0/bazel-skylib.0.8.0.tar.gz",
sha256 = "2ef429f5d7ce7111263289644d233707dba35e39696377ebab8b0bc701f7818e",
)
# Open source version of the google python flags library.
http_archive(
name = "absl_py",
sha256 = "980ce58c34dfa75a9d20d45c355658191c166557f1de41ab52f208bd00604c2b",
strip_prefix = "abseil-py-b347ba6022370f895d3133241ed96965b95ecb40",
urls = ["https://github.com/abseil/abseil-py/archive/b347ba6022370f895d3133241ed96965b95ecb40.tar.gz"],
)