xref: /aosp_15_r20/external/tflite-support/WORKSPACE (revision b16991f985baa50654c05c5adbb3c8bbcfb40082)
1*b16991f9SAndroid Build Coastguard Workerworkspace(name = "org_tensorflow_lite_support")
2*b16991f9SAndroid Build Coastguard Worker
3*b16991f9SAndroid Build Coastguard Workerload("@bazel_tools//tools/build_defs/repo:java.bzl", "java_import_external")
4*b16991f9SAndroid Build Coastguard Workerload("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
5*b16991f9SAndroid Build Coastguard Workerload("@//third_party/py:python_configure.bzl", "python_configure")
6*b16991f9SAndroid Build Coastguard Worker
7*b16991f9SAndroid Build Coastguard Workerhttp_archive(
8*b16991f9SAndroid Build Coastguard Worker    name = "io_bazel_rules_closure",
9*b16991f9SAndroid Build Coastguard Worker    sha256 = "5b00383d08dd71f28503736db0500b6fb4dda47489ff5fc6bed42557c07c6ba9",
10*b16991f9SAndroid Build Coastguard Worker    strip_prefix = "rules_closure-308b05b2419edb5c8ee0471b67a40403df940149",
11*b16991f9SAndroid Build Coastguard Worker    urls = [
12*b16991f9SAndroid Build Coastguard Worker        "https://storage.googleapis.com/mirror.tensorflow.org/github.com/bazelbuild/rules_closure/archive/308b05b2419edb5c8ee0471b67a40403df940149.tar.gz",
13*b16991f9SAndroid Build Coastguard Worker        "https://github.com/bazelbuild/rules_closure/archive/308b05b2419edb5c8ee0471b67a40403df940149.tar.gz",  # 2019-06-13
14*b16991f9SAndroid Build Coastguard Worker    ],
15*b16991f9SAndroid Build Coastguard Worker)
16*b16991f9SAndroid Build Coastguard Worker
17*b16991f9SAndroid Build Coastguard Worker# Apple and Swift rules.
18*b16991f9SAndroid Build Coastguard Worker# https://github.com/bazelbuild/rules_apple/releases
19*b16991f9SAndroid Build Coastguard Workerhttp_archive(
20*b16991f9SAndroid Build Coastguard Worker    name = "build_bazel_rules_apple",
21*b16991f9SAndroid Build Coastguard Worker    sha256 = "ee9e6073aeb5a65c100cb9c44b0017c937706a4ae03176e14a7e78620a198079",
22*b16991f9SAndroid Build Coastguard Worker    strip_prefix = "rules_apple-5131f3d46794bf227d296c82f30c2499c9de3c5b",
23*b16991f9SAndroid Build Coastguard Worker    urls = [
24*b16991f9SAndroid Build Coastguard Worker        "https://storage.googleapis.com/mirror.tensorflow.org/github.com/bazelbuild/rules_apple/archive/5131f3d46794bf227d296c82f30c2499c9de3c5b.tar.gz",
25*b16991f9SAndroid Build Coastguard Worker        "https://github.com/bazelbuild/rules_apple/archive/5131f3d46794bf227d296c82f30c2499c9de3c5b.tar.gz",
26*b16991f9SAndroid Build Coastguard Worker    ],
27*b16991f9SAndroid Build Coastguard Worker)
28*b16991f9SAndroid Build Coastguard Worker
29*b16991f9SAndroid Build Coastguard Worker# https://github.com/bazelbuild/rules_swift/releases
30*b16991f9SAndroid Build Coastguard Workerhttp_archive(
31*b16991f9SAndroid Build Coastguard Worker    name = "build_bazel_rules_swift",
32*b16991f9SAndroid Build Coastguard Worker    sha256 = "d0833bc6dad817a367936a5f902a0c11318160b5e80a20ece35fb85a5675c886",
33*b16991f9SAndroid Build Coastguard Worker    strip_prefix = "rules_swift-3eeeb53cebda55b349d64c9fc144e18c5f7c0eb8",
34*b16991f9SAndroid Build Coastguard Worker    urls = [
35*b16991f9SAndroid Build Coastguard Worker        "https://storage.googleapis.com/mirror.tensorflow.org/github.com/bazelbuild/rules_swift/archive/3eeeb53cebda55b349d64c9fc144e18c5f7c0eb8.tar.gz",
36*b16991f9SAndroid Build Coastguard Worker        "https://github.com/bazelbuild/rules_swift/archive/3eeeb53cebda55b349d64c9fc144e18c5f7c0eb8.tar.gz",
37*b16991f9SAndroid Build Coastguard Worker    ],
38*b16991f9SAndroid Build Coastguard Worker)
39*b16991f9SAndroid Build Coastguard Worker
40*b16991f9SAndroid Build Coastguard Worker# tf-nightly-20200810
41*b16991f9SAndroid Build Coastguard Workerhttp_archive(
42*b16991f9SAndroid Build Coastguard Worker    name = "org_tensorflow",
43*b16991f9SAndroid Build Coastguard Worker    sha256 = "26c833b7e1873936379e810a39d14700281125257ddda8cd822c89111db6f6ae",
44*b16991f9SAndroid Build Coastguard Worker    strip_prefix = "tensorflow-2.4.0",
45*b16991f9SAndroid Build Coastguard Worker    urls = [
46*b16991f9SAndroid Build Coastguard Worker        "https://github.com/tensorflow/tensorflow/archive/v2.4.0.tar.gz",
47*b16991f9SAndroid Build Coastguard Worker    ],
48*b16991f9SAndroid Build Coastguard Worker    patches = ["@//third_party:tensorflow_lite_ios_build.patch"],
49*b16991f9SAndroid Build Coastguard Worker    patch_args = ["-p1"],
50*b16991f9SAndroid Build Coastguard Worker)
51*b16991f9SAndroid Build Coastguard Worker
52*b16991f9SAndroid Build Coastguard Worker# Set up dependencies. Need to do this before set up TF so that our modification
53*b16991f9SAndroid Build Coastguard Worker# could take effects.
54*b16991f9SAndroid Build Coastguard Workerload("//third_party:repo.bzl", "third_party_http_archive")
55*b16991f9SAndroid Build Coastguard Worker
56*b16991f9SAndroid Build Coastguard Worker# Use our patched gflags which fixes a linking issue.
57*b16991f9SAndroid Build Coastguard Workerload("//third_party/gflags:workspace.bzl", gflags = "repo")
58*b16991f9SAndroid Build Coastguard Workergflags()
59*b16991f9SAndroid Build Coastguard Worker
60*b16991f9SAndroid Build Coastguard Workerthird_party_http_archive(
61*b16991f9SAndroid Build Coastguard Worker    name = "pybind11",
62*b16991f9SAndroid Build Coastguard Worker    urls = [
63*b16991f9SAndroid Build Coastguard Worker        "https://storage.googleapis.com/mirror.tensorflow.org/github.com/pybind/pybind11/archive/v2.6.0.tar.gz",
64*b16991f9SAndroid Build Coastguard Worker        "https://github.com/pybind/pybind11/archive/v2.6.0.tar.gz",
65*b16991f9SAndroid Build Coastguard Worker    ],
66*b16991f9SAndroid Build Coastguard Worker    sha256 = "90b705137b69ee3b5fc655eaca66d0dc9862ea1759226f7ccd3098425ae69571",
67*b16991f9SAndroid Build Coastguard Worker    strip_prefix = "pybind11-2.6.0",
68*b16991f9SAndroid Build Coastguard Worker    build_file = "//third_party:pybind11.BUILD",
69*b16991f9SAndroid Build Coastguard Worker)
70*b16991f9SAndroid Build Coastguard Worker
71*b16991f9SAndroid Build Coastguard Workerhttp_archive(
72*b16991f9SAndroid Build Coastguard Worker    name = "absl_py",
73*b16991f9SAndroid Build Coastguard Worker    sha256 = "603febc9b95a8f2979a7bdb77d2f5e4d9b30d4e0d59579f88eba67d4e4cc5462",
74*b16991f9SAndroid Build Coastguard Worker    strip_prefix = "abseil-py-pypi-v0.9.0",
75*b16991f9SAndroid Build Coastguard Worker    urls = [
76*b16991f9SAndroid Build Coastguard Worker        "https://storage.googleapis.com/mirror.tensorflow.org/github.com/abseil/abseil-py/archive/pypi-v0.9.0.tar.gz",
77*b16991f9SAndroid Build Coastguard Worker        "https://github.com/abseil/abseil-py/archive/pypi-v0.9.0.tar.gz",
78*b16991f9SAndroid Build Coastguard Worker    ],
79*b16991f9SAndroid Build Coastguard Worker)
80*b16991f9SAndroid Build Coastguard Worker
81*b16991f9SAndroid Build Coastguard Workerhttp_archive(
82*b16991f9SAndroid Build Coastguard Worker    name = "six_archive",
83*b16991f9SAndroid Build Coastguard Worker    build_file = "//third_party:six.BUILD",
84*b16991f9SAndroid Build Coastguard Worker    sha256 = "d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73",
85*b16991f9SAndroid Build Coastguard Worker    strip_prefix = "six-1.12.0",
86*b16991f9SAndroid Build Coastguard Worker    urls = [
87*b16991f9SAndroid Build Coastguard Worker        "https://storage.googleapis.com/mirror.tensorflow.org/pypi.python.org/packages/source/s/six/six-1.12.0.tar.gz",
88*b16991f9SAndroid Build Coastguard Worker        "https://pypi.python.org/packages/source/s/six/six-1.12.0.tar.gz",
89*b16991f9SAndroid Build Coastguard Worker    ],
90*b16991f9SAndroid Build Coastguard Worker)
91*b16991f9SAndroid Build Coastguard Worker
92*b16991f9SAndroid Build Coastguard Workerhttp_archive(
93*b16991f9SAndroid Build Coastguard Worker    name = "com_google_sentencepiece",
94*b16991f9SAndroid Build Coastguard Worker    strip_prefix = "sentencepiece-1.0.0",
95*b16991f9SAndroid Build Coastguard Worker    sha256 = "c05901f30a1d0ed64cbcf40eba08e48894e1b0e985777217b7c9036cac631346",
96*b16991f9SAndroid Build Coastguard Worker    urls = [
97*b16991f9SAndroid Build Coastguard Worker        "https://github.com/google/sentencepiece/archive/1.0.0.zip",
98*b16991f9SAndroid Build Coastguard Worker    ],
99*b16991f9SAndroid Build Coastguard Worker)
100*b16991f9SAndroid Build Coastguard Worker
101*b16991f9SAndroid Build Coastguard Workerhttp_archive(
102*b16991f9SAndroid Build Coastguard Worker    name = "org_tensorflow_text",
103*b16991f9SAndroid Build Coastguard Worker    sha256 = "f64647276f7288d1b1fe4c89581d51404d0ce4ae97f2bcc4c19bd667549adca8",
104*b16991f9SAndroid Build Coastguard Worker    strip_prefix = "text-2.2.0",
105*b16991f9SAndroid Build Coastguard Worker    urls = [
106*b16991f9SAndroid Build Coastguard Worker        "https://github.com/tensorflow/text/archive/v2.2.0.zip",
107*b16991f9SAndroid Build Coastguard Worker    ],
108*b16991f9SAndroid Build Coastguard Worker    patches = ["@//third_party:tensorflow_text_remove_tf_deps.patch"],
109*b16991f9SAndroid Build Coastguard Worker    patch_args = ["-p1"],
110*b16991f9SAndroid Build Coastguard Worker    repo_mapping = {"@com_google_re2": "@com_googlesource_code_re2"},
111*b16991f9SAndroid Build Coastguard Worker)
112*b16991f9SAndroid Build Coastguard Worker
113*b16991f9SAndroid Build Coastguard Workerhttp_archive(
114*b16991f9SAndroid Build Coastguard Worker    name = "com_googlesource_code_re2",
115*b16991f9SAndroid Build Coastguard Worker    sha256 = "d070e2ffc5476c496a6a872a6f246bfddce8e7797d6ba605a7c8d72866743bf9",
116*b16991f9SAndroid Build Coastguard Worker    strip_prefix = "re2-506cfa4bffd060c06ec338ce50ea3468daa6c814",
117*b16991f9SAndroid Build Coastguard Worker    urls = [
118*b16991f9SAndroid Build Coastguard Worker        "https://github.com/google/re2/archive/506cfa4bffd060c06ec338ce50ea3468daa6c814.tar.gz",
119*b16991f9SAndroid Build Coastguard Worker    ],
120*b16991f9SAndroid Build Coastguard Worker)
121*b16991f9SAndroid Build Coastguard Worker
122*b16991f9SAndroid Build Coastguard Worker# ABSL cpp library lts_2020_02_25
123*b16991f9SAndroid Build Coastguard Worker# Needed for absl/status
124*b16991f9SAndroid Build Coastguard Workerhttp_archive(
125*b16991f9SAndroid Build Coastguard Worker    name = "com_google_absl",
126*b16991f9SAndroid Build Coastguard Worker    build_file = "//third_party:com_google_absl.BUILD",
127*b16991f9SAndroid Build Coastguard Worker    urls = [
128*b16991f9SAndroid Build Coastguard Worker        "https://github.com/abseil/abseil-cpp/archive/20200225.tar.gz",
129*b16991f9SAndroid Build Coastguard Worker    ],
130*b16991f9SAndroid Build Coastguard Worker    # Remove after https://github.com/abseil/abseil-cpp/issues/326 is solved.
131*b16991f9SAndroid Build Coastguard Worker    patches = [
132*b16991f9SAndroid Build Coastguard Worker        "@//third_party:com_google_absl_f863b622fe13612433fdf43f76547d5edda0c93001.diff"
133*b16991f9SAndroid Build Coastguard Worker    ],
134*b16991f9SAndroid Build Coastguard Worker    patch_args = [
135*b16991f9SAndroid Build Coastguard Worker        "-p1",
136*b16991f9SAndroid Build Coastguard Worker    ],
137*b16991f9SAndroid Build Coastguard Worker    strip_prefix = "abseil-cpp-20200225",
138*b16991f9SAndroid Build Coastguard Worker    sha256 = "728a813291bdec2aa46eab8356ace9f75ac2ed9dfe2df5ab603c4e6c09f1c353"
139*b16991f9SAndroid Build Coastguard Worker)
140*b16991f9SAndroid Build Coastguard Worker
141*b16991f9SAndroid Build Coastguard Workerhttp_archive(
142*b16991f9SAndroid Build Coastguard Worker    name = "com_google_glog",
143*b16991f9SAndroid Build Coastguard Worker    sha256 = "1ee310e5d0a19b9d584a855000434bb724aa744745d5b8ab1855c85bff8a8e21",
144*b16991f9SAndroid Build Coastguard Worker    strip_prefix = "glog-028d37889a1e80e8a07da1b8945ac706259e5fd8",
145*b16991f9SAndroid Build Coastguard Worker    urls = [
146*b16991f9SAndroid Build Coastguard Worker        "https://mirror.bazel.build/github.com/google/glog/archive/028d37889a1e80e8a07da1b8945ac706259e5fd8.tar.gz",
147*b16991f9SAndroid Build Coastguard Worker        "https://github.com/google/glog/archive/028d37889a1e80e8a07da1b8945ac706259e5fd8.tar.gz",
148*b16991f9SAndroid Build Coastguard Worker    ],
149*b16991f9SAndroid Build Coastguard Worker)
150*b16991f9SAndroid Build Coastguard Worker
151*b16991f9SAndroid Build Coastguard Worker
152*b16991f9SAndroid Build Coastguard Workerhttp_archive(
153*b16991f9SAndroid Build Coastguard Worker    name = "zlib",
154*b16991f9SAndroid Build Coastguard Worker    build_file = "//third_party:zlib.BUILD",
155*b16991f9SAndroid Build Coastguard Worker    sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1",
156*b16991f9SAndroid Build Coastguard Worker    strip_prefix = "zlib-1.2.11",
157*b16991f9SAndroid Build Coastguard Worker    urls = [
158*b16991f9SAndroid Build Coastguard Worker        "http://mirror.bazel.build/zlib.net/fossils/zlib-1.2.11.tar.gz",
159*b16991f9SAndroid Build Coastguard Worker        "http://zlib.net/fossils/zlib-1.2.11.tar.gz",  # 2017-01-15
160*b16991f9SAndroid Build Coastguard Worker    ],
161*b16991f9SAndroid Build Coastguard Worker)
162*b16991f9SAndroid Build Coastguard Worker
163*b16991f9SAndroid Build Coastguard Workerhttp_archive(
164*b16991f9SAndroid Build Coastguard Worker    name = "org_libzip",
165*b16991f9SAndroid Build Coastguard Worker    build_file = "//third_party:libzip.BUILD",
166*b16991f9SAndroid Build Coastguard Worker    sha256 = "a5d22f0c87a2625450eaa5e10db18b8ee4ef17042102d04c62e311993a2ba363",
167*b16991f9SAndroid Build Coastguard Worker    strip_prefix = "libzip-rel-1-5-1",
168*b16991f9SAndroid Build Coastguard Worker    urls = [
169*b16991f9SAndroid Build Coastguard Worker        # Bazel does not like the official download link at libzip.org,
170*b16991f9SAndroid Build Coastguard Worker        # so use the GitHub release tag.
171*b16991f9SAndroid Build Coastguard Worker        "https://mirror.bazel.build/github.com/nih-at/libzip/archive/rel-1-5-1.zip",
172*b16991f9SAndroid Build Coastguard Worker        "https://github.com/nih-at/libzip/archive/rel-1-5-1.zip",
173*b16991f9SAndroid Build Coastguard Worker    ],
174*b16991f9SAndroid Build Coastguard Worker)
175*b16991f9SAndroid Build Coastguard Worker
176*b16991f9SAndroid Build Coastguard Workerhttp_archive(
177*b16991f9SAndroid Build Coastguard Worker    name = "libyuv",
178*b16991f9SAndroid Build Coastguard Worker    urls = ["https://chromium.googlesource.com/libyuv/libyuv/+archive/6d603ec3f57dafddc424ef895e5d903915e94ba6.tar.gz"],
179*b16991f9SAndroid Build Coastguard Worker    # Adding the constrain of sha256 and strip_prefix will cause failure.
180*b16991f9SAndroid Build Coastguard Worker    # It seems that the downloaded libyuv was different every time, so that
181*b16991f9SAndroid Build Coastguard Worker    # the specified sha256 and strip_prefix cannot match.
182*b16991f9SAndroid Build Coastguard Worker    # sha256 = "ce196c72858456baa8022fa4a0dc18b77d619265dbc0e3d58e25ad15ca402522",
183*b16991f9SAndroid Build Coastguard Worker    # strip_prefix = "libyuv-6d603ec3f57dafddc424ef895e5d903915e94ba6",
184*b16991f9SAndroid Build Coastguard Worker    build_file = "//third_party:libyuv.BUILD",
185*b16991f9SAndroid Build Coastguard Worker)
186*b16991f9SAndroid Build Coastguard Worker
187*b16991f9SAndroid Build Coastguard Workerhttp_archive(
188*b16991f9SAndroid Build Coastguard Worker    name = "stblib",
189*b16991f9SAndroid Build Coastguard Worker    strip_prefix = "stb-b42009b3b9d4ca35bc703f5310eedc74f584be58",
190*b16991f9SAndroid Build Coastguard Worker    sha256 = "13a99ad430e930907f5611325ec384168a958bf7610e63e60e2fd8e7b7379610",
191*b16991f9SAndroid Build Coastguard Worker    urls = ["https://github.com/nothings/stb/archive/b42009b3b9d4ca35bc703f5310eedc74f584be58.tar.gz"],
192*b16991f9SAndroid Build Coastguard Worker    build_file = "//third_party:stblib.BUILD",
193*b16991f9SAndroid Build Coastguard Worker)
194*b16991f9SAndroid Build Coastguard Worker
195*b16991f9SAndroid Build Coastguard Workerhttp_archive(
196*b16991f9SAndroid Build Coastguard Worker    name = "google_toolbox_for_mac",
197*b16991f9SAndroid Build Coastguard Worker    url = "https://github.com/google/google-toolbox-for-mac/archive/v2.2.1.zip",
198*b16991f9SAndroid Build Coastguard Worker    sha256 = "e3ac053813c989a88703556df4dc4466e424e30d32108433ed6beaec76ba4fdc",
199*b16991f9SAndroid Build Coastguard Worker    strip_prefix = "google-toolbox-for-mac-2.2.1",
200*b16991f9SAndroid Build Coastguard Worker    build_file = "@//third_party:google_toolbox_for_mac.BUILD",
201*b16991f9SAndroid Build Coastguard Worker)
202*b16991f9SAndroid Build Coastguard Worker
203*b16991f9SAndroid Build Coastguard Workerhttp_archive(
204*b16991f9SAndroid Build Coastguard Worker    name = "utf_archive",
205*b16991f9SAndroid Build Coastguard Worker    build_file = "@//third_party:utf.BUILD",
206*b16991f9SAndroid Build Coastguard Worker    sha256 = "262a902f622dcd28e05b8a4be10da0aa3899050d0be8f4a71780eed6b2ea65ca",
207*b16991f9SAndroid Build Coastguard Worker    urls = [
208*b16991f9SAndroid Build Coastguard Worker        "https://mirror.bazel.build/9fans.github.io/plan9port/unix/libutf.tgz",
209*b16991f9SAndroid Build Coastguard Worker        "https://9fans.github.io/plan9port/unix/libutf.tgz",
210*b16991f9SAndroid Build Coastguard Worker    ],
211*b16991f9SAndroid Build Coastguard Worker)
212*b16991f9SAndroid Build Coastguard Worker
213*b16991f9SAndroid Build Coastguard Workerhttp_archive(
214*b16991f9SAndroid Build Coastguard Worker    name = "icu",
215*b16991f9SAndroid Build Coastguard Worker    strip_prefix = "icu-release-64-2",
216*b16991f9SAndroid Build Coastguard Worker    sha256 = "dfc62618aa4bd3ca14a3df548cd65fe393155edd213e49c39f3a30ccd618fc27",
217*b16991f9SAndroid Build Coastguard Worker    urls = [
218*b16991f9SAndroid Build Coastguard Worker        "https://storage.googleapis.com/mirror.tensorflow.org/github.com/unicode-org/icu/archive/release-64-2.zip",
219*b16991f9SAndroid Build Coastguard Worker        "https://github.com/unicode-org/icu/archive/release-64-2.zip",
220*b16991f9SAndroid Build Coastguard Worker    ],
221*b16991f9SAndroid Build Coastguard Worker    build_file = "@//third_party:icu.BUILD",
222*b16991f9SAndroid Build Coastguard Worker)
223*b16991f9SAndroid Build Coastguard Worker
224*b16991f9SAndroid Build Coastguard Workerhttp_archive(
225*b16991f9SAndroid Build Coastguard Worker    name = "fft2d",
226*b16991f9SAndroid Build Coastguard Worker    build_file = "@//third_party/fft2d:fft2d.BUILD",
227*b16991f9SAndroid Build Coastguard Worker    sha256 = "5f4dabc2ae21e1f537425d58a49cdca1c49ea11db0d6271e2a4b27e9697548eb",
228*b16991f9SAndroid Build Coastguard Worker    strip_prefix = "OouraFFT-1.0",
229*b16991f9SAndroid Build Coastguard Worker    urls = [
230*b16991f9SAndroid Build Coastguard Worker        "https://storage.googleapis.com/mirror.tensorflow.org/github.com/petewarden/OouraFFT/archive/v1.0.tar.gz",
231*b16991f9SAndroid Build Coastguard Worker        "https://github.com/petewarden/OouraFFT/archive/v1.0.tar.gz",
232*b16991f9SAndroid Build Coastguard Worker    ],
233*b16991f9SAndroid Build Coastguard Worker)
234*b16991f9SAndroid Build Coastguard Worker
235*b16991f9SAndroid Build Coastguard Workerhttp_archive(
236*b16991f9SAndroid Build Coastguard Worker    name = "darts_clone",
237*b16991f9SAndroid Build Coastguard Worker    build_file = "@//third_party:darts_clone.BUILD",
238*b16991f9SAndroid Build Coastguard Worker    sha256 = "c97f55d05c98da6fcaf7f9ecc6a6dc6bc5b18b8564465f77abff8879d446491c",
239*b16991f9SAndroid Build Coastguard Worker    strip_prefix = "darts-clone-e40ce4627526985a7767444b6ed6893ab6ff8983",
240*b16991f9SAndroid Build Coastguard Worker    urls = [
241*b16991f9SAndroid Build Coastguard Worker        "https://github.com/s-yata/darts-clone/archive/e40ce4627526985a7767444b6ed6893ab6ff8983.zip",
242*b16991f9SAndroid Build Coastguard Worker    ],
243*b16991f9SAndroid Build Coastguard Worker)
244*b16991f9SAndroid Build Coastguard Worker
245*b16991f9SAndroid Build Coastguard Workerhttp_archive(
246*b16991f9SAndroid Build Coastguard Worker    name = "com_google_protobuf",
247*b16991f9SAndroid Build Coastguard Worker    sha256 = "a79d19dcdf9139fa4b81206e318e33d245c4c9da1ffed21c87288ed4380426f9",
248*b16991f9SAndroid Build Coastguard Worker    strip_prefix = "protobuf-3.11.4",
249*b16991f9SAndroid Build Coastguard Worker    urls = ["https://github.com/protocolbuffers/protobuf/archive/v3.11.4.tar.gz"],
250*b16991f9SAndroid Build Coastguard Worker    patches = [
251*b16991f9SAndroid Build Coastguard Worker        "@//third_party:com_google_protobuf_fixes.diff"
252*b16991f9SAndroid Build Coastguard Worker    ],
253*b16991f9SAndroid Build Coastguard Worker    patch_args = [
254*b16991f9SAndroid Build Coastguard Worker        "-p1",
255*b16991f9SAndroid Build Coastguard Worker    ],
256*b16991f9SAndroid Build Coastguard Worker)
257*b16991f9SAndroid Build Coastguard Worker
258*b16991f9SAndroid Build Coastguard Worker# AutoValue 1.6+ shades Guava, Auto Common, and JavaPoet. That's OK
259*b16991f9SAndroid Build Coastguard Worker# because none of these jars become runtime dependencies.
260*b16991f9SAndroid Build Coastguard Workerjava_import_external(
261*b16991f9SAndroid Build Coastguard Worker    name = "com_google_auto_value",
262*b16991f9SAndroid Build Coastguard Worker    jar_sha256 = "fd811b92bb59ae8a4cf7eb9dedd208300f4ea2b6275d726e4df52d8334aaae9d",
263*b16991f9SAndroid Build Coastguard Worker    jar_urls = [
264*b16991f9SAndroid Build Coastguard Worker        "https://mirror.bazel.build/repo1.maven.org/maven2/com/google/auto/value/auto-value/1.6/auto-value-1.6.jar",
265*b16991f9SAndroid Build Coastguard Worker        "https://repo1.maven.org/maven2/com/google/auto/value/auto-value/1.6/auto-value-1.6.jar",
266*b16991f9SAndroid Build Coastguard Worker    ],
267*b16991f9SAndroid Build Coastguard Worker    licenses = ["notice"],  # Apache 2.0
268*b16991f9SAndroid Build Coastguard Worker    generated_rule_name = "processor",
269*b16991f9SAndroid Build Coastguard Worker    exports = ["@com_google_auto_value_annotations"],
270*b16991f9SAndroid Build Coastguard Worker    extra_build_file_content = "\n".join([
271*b16991f9SAndroid Build Coastguard Worker        "java_plugin(",
272*b16991f9SAndroid Build Coastguard Worker        "    name = \"AutoAnnotationProcessor\",",
273*b16991f9SAndroid Build Coastguard Worker        "    output_licenses = [\"unencumbered\"],",
274*b16991f9SAndroid Build Coastguard Worker        "    processor_class = \"com.google.auto.value.processor.AutoAnnotationProcessor\",",
275*b16991f9SAndroid Build Coastguard Worker        "    tags = [\"annotation=com.google.auto.value.AutoAnnotation;genclass=${package}.AutoAnnotation_${outerclasses}${classname}_${methodname}\"],",
276*b16991f9SAndroid Build Coastguard Worker        "    deps = [\":processor\"],",
277*b16991f9SAndroid Build Coastguard Worker        ")",
278*b16991f9SAndroid Build Coastguard Worker        "",
279*b16991f9SAndroid Build Coastguard Worker        "java_plugin(",
280*b16991f9SAndroid Build Coastguard Worker        "    name = \"AutoOneOfProcessor\",",
281*b16991f9SAndroid Build Coastguard Worker        "    output_licenses = [\"unencumbered\"],",
282*b16991f9SAndroid Build Coastguard Worker        "    processor_class = \"com.google.auto.value.processor.AutoOneOfProcessor\",",
283*b16991f9SAndroid Build Coastguard Worker        "    tags = [\"annotation=com.google.auto.value.AutoValue;genclass=${package}.AutoOneOf_${outerclasses}${classname}\"],",
284*b16991f9SAndroid Build Coastguard Worker        "    deps = [\":processor\"],",
285*b16991f9SAndroid Build Coastguard Worker        ")",
286*b16991f9SAndroid Build Coastguard Worker        "",
287*b16991f9SAndroid Build Coastguard Worker        "java_plugin(",
288*b16991f9SAndroid Build Coastguard Worker        "    name = \"AutoValueProcessor\",",
289*b16991f9SAndroid Build Coastguard Worker        "    output_licenses = [\"unencumbered\"],",
290*b16991f9SAndroid Build Coastguard Worker        "    processor_class = \"com.google.auto.value.processor.AutoValueProcessor\",",
291*b16991f9SAndroid Build Coastguard Worker        "    tags = [\"annotation=com.google.auto.value.AutoValue;genclass=${package}.AutoValue_${outerclasses}${classname}\"],",
292*b16991f9SAndroid Build Coastguard Worker        "    deps = [\":processor\"],",
293*b16991f9SAndroid Build Coastguard Worker        ")",
294*b16991f9SAndroid Build Coastguard Worker        "",
295*b16991f9SAndroid Build Coastguard Worker        "java_library(",
296*b16991f9SAndroid Build Coastguard Worker        "    name = \"com_google_auto_value\",",
297*b16991f9SAndroid Build Coastguard Worker        "    exported_plugins = [",
298*b16991f9SAndroid Build Coastguard Worker        "        \":AutoAnnotationProcessor\",",
299*b16991f9SAndroid Build Coastguard Worker        "        \":AutoOneOfProcessor\",",
300*b16991f9SAndroid Build Coastguard Worker        "        \":AutoValueProcessor\",",
301*b16991f9SAndroid Build Coastguard Worker        "    ],",
302*b16991f9SAndroid Build Coastguard Worker        "    exports = [\"@com_google_auto_value_annotations\"],",
303*b16991f9SAndroid Build Coastguard Worker        ")",
304*b16991f9SAndroid Build Coastguard Worker    ]),
305*b16991f9SAndroid Build Coastguard Worker)
306*b16991f9SAndroid Build Coastguard Worker
307*b16991f9SAndroid Build Coastguard Worker# Auto value annotations
308*b16991f9SAndroid Build Coastguard Workerjava_import_external(
309*b16991f9SAndroid Build Coastguard Worker    name = "com_google_auto_value_annotations",
310*b16991f9SAndroid Build Coastguard Worker    jar_sha256 = "d095936c432f2afc671beaab67433e7cef50bba4a861b77b9c46561b801fae69",
311*b16991f9SAndroid Build Coastguard Worker    jar_urls = [
312*b16991f9SAndroid Build Coastguard Worker        "https://mirror.bazel.build/repo1.maven.org/maven2/com/google/auto/value/auto-value-annotations/1.6/auto-value-annotations-1.6.jar",
313*b16991f9SAndroid Build Coastguard Worker        "https://repo1.maven.org/maven2/com/google/auto/value/auto-value-annotations/1.6/auto-value-annotations-1.6.jar",
314*b16991f9SAndroid Build Coastguard Worker    ],
315*b16991f9SAndroid Build Coastguard Worker    licenses = ["notice"],  # Apache 2.0
316*b16991f9SAndroid Build Coastguard Worker    neverlink = True,
317*b16991f9SAndroid Build Coastguard Worker    default_visibility = ["@com_google_auto_value//:__pkg__"],
318*b16991f9SAndroid Build Coastguard Worker)
319*b16991f9SAndroid Build Coastguard Worker
320*b16991f9SAndroid Build Coastguard Workerload("//third_party/flatbuffers:workspace.bzl", flatbuffers = "repo")
321*b16991f9SAndroid Build Coastguard Worker
322*b16991f9SAndroid Build Coastguard Workerflatbuffers()
323*b16991f9SAndroid Build Coastguard Worker# Set up TF.
324*b16991f9SAndroid Build Coastguard Workerload("@org_tensorflow//tensorflow:workspace.bzl", "tf_workspace")
325*b16991f9SAndroid Build Coastguard Workertf_workspace(tf_repo_name="@org_tensorflow")
326*b16991f9SAndroid Build Coastguard Worker
327*b16991f9SAndroid Build Coastguard Workerload("//third_party/tensorflow:tf_configure.bzl", "tf_configure")
328*b16991f9SAndroid Build Coastguard Workertf_configure(name = "local_config_tf")
329*b16991f9SAndroid Build Coastguard Worker
330*b16991f9SAndroid Build Coastguard Worker# TF submodule compilation doesn't take care of grpc deps. Do it manually here.
331*b16991f9SAndroid Build Coastguard Workerload("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
332*b16991f9SAndroid Build Coastguard Workergrpc_deps()
333*b16991f9SAndroid Build Coastguard Worker
334*b16991f9SAndroid Build Coastguard Workerload(
335*b16991f9SAndroid Build Coastguard Worker    "@build_bazel_rules_apple//apple:repositories.bzl",
336*b16991f9SAndroid Build Coastguard Worker    "apple_rules_dependencies",
337*b16991f9SAndroid Build Coastguard Worker)
338*b16991f9SAndroid Build Coastguard Workerapple_rules_dependencies()
339*b16991f9SAndroid Build Coastguard Worker
340*b16991f9SAndroid Build Coastguard Workerload(
341*b16991f9SAndroid Build Coastguard Worker    "@build_bazel_apple_support//lib:repositories.bzl",
342*b16991f9SAndroid Build Coastguard Worker    "apple_support_dependencies",
343*b16991f9SAndroid Build Coastguard Worker)
344*b16991f9SAndroid Build Coastguard Workerapple_support_dependencies()
345*b16991f9SAndroid Build Coastguard Worker
346*b16991f9SAndroid Build Coastguard Workerload("@upb//bazel:repository_defs.bzl", "bazel_version_repository")
347*b16991f9SAndroid Build Coastguard Workerbazel_version_repository(name = "bazel_version")
348*b16991f9SAndroid Build Coastguard Worker
349*b16991f9SAndroid Build Coastguard Worker
350*b16991f9SAndroid Build Coastguard Worker# Set up Android.
351*b16991f9SAndroid Build Coastguard Workerload("//third_party/android:android_configure.bzl", "android_configure")
352*b16991f9SAndroid Build Coastguard Workerandroid_configure(name="local_config_android")
353*b16991f9SAndroid Build Coastguard Workerload("@local_config_android//:android.bzl", "android_workspace")
354*b16991f9SAndroid Build Coastguard Workerandroid_workspace()
355*b16991f9SAndroid Build Coastguard Worker
356*b16991f9SAndroid Build Coastguard Workerpython_configure(name = "local_config_python")
357*b16991f9SAndroid Build Coastguard Worker
358*b16991f9SAndroid Build Coastguard Worker
359*b16991f9SAndroid Build Coastguard Worker# Maven dependencies.
360*b16991f9SAndroid Build Coastguard Worker
361*b16991f9SAndroid Build Coastguard WorkerRULES_JVM_EXTERNAL_TAG = "3.2"
362*b16991f9SAndroid Build Coastguard Worker
363*b16991f9SAndroid Build Coastguard Workerhttp_archive(
364*b16991f9SAndroid Build Coastguard Worker    name = "rules_jvm_external",
365*b16991f9SAndroid Build Coastguard Worker    strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG,
366*b16991f9SAndroid Build Coastguard Worker    sha256 = "82262ff4223c5fda6fb7ff8bd63db8131b51b413d26eb49e3131037e79e324af",
367*b16991f9SAndroid Build Coastguard Worker    url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % RULES_JVM_EXTERNAL_TAG,
368*b16991f9SAndroid Build Coastguard Worker)
369*b16991f9SAndroid Build Coastguard Worker
370*b16991f9SAndroid Build Coastguard Workerload("@rules_jvm_external//:defs.bzl", "maven_install")
371*b16991f9SAndroid Build Coastguard Worker
372*b16991f9SAndroid Build Coastguard Workermaven_install(
373*b16991f9SAndroid Build Coastguard Worker    artifacts = [
374*b16991f9SAndroid Build Coastguard Worker        "androidx.annotation:annotation:aar:1.1.0",
375*b16991f9SAndroid Build Coastguard Worker    ],
376*b16991f9SAndroid Build Coastguard Worker    repositories = [
377*b16991f9SAndroid Build Coastguard Worker        "https://jcenter.bintray.com",
378*b16991f9SAndroid Build Coastguard Worker        "https://maven.google.com",
379*b16991f9SAndroid Build Coastguard Worker        "https://dl.google.com/dl/android/maven2",
380*b16991f9SAndroid Build Coastguard Worker        "https://repo1.maven.org/maven2",
381*b16991f9SAndroid Build Coastguard Worker    ],
382*b16991f9SAndroid Build Coastguard Worker    fetch_sources = True,
383*b16991f9SAndroid Build Coastguard Worker    version_conflict_policy = "pinned",
384*b16991f9SAndroid Build Coastguard Worker)
385