-
-
Notifications
You must be signed in to change notification settings - Fork 62
/
WORKSPACE
415 lines (326 loc) · 14.7 KB
/
WORKSPACE
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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
workspace(name = "atox")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# Android SDK/NDK setup
# =========================================================
android_sdk_repository(name = "androidsdk")
android_ndk_repository(
name = "androidndk",
api_level = 19,
)
# Bazel
# =========================================================
PLATFORMS_TAG = "0.0.10"
# https://github.com/bazelbuild/platforms
http_archive(
name = "platforms",
integrity = "sha256-IY7+juc20mo1cmY7N0olPAErcW2K8MB+hC6C8jigp+4=",
url = "https://github.com/bazelbuild/platforms/releases/download/%s/platforms-%s.tar.gz" % (PLATFORMS_TAG, PLATFORMS_TAG),
)
RULES_PKG_TAG = "1.0.1"
# https://github.com/bazelbuild/rules_pkg
http_archive(
name = "rules_pkg",
integrity = "sha256-0gyVGWDtd8t7NBwqWUiFNOSU1a0dMMSBjHNtV3cqn+8=",
url = "https://github.com/bazelbuild/rules_pkg/releases/download/%s/rules_pkg-%s.tar.gz" % (RULES_PKG_TAG, RULES_PKG_TAG),
)
# >=8.6.0 requires a newer version of com_google_protobuf which breaks rules_scala.
RULES_JAVA_TAG = "7.12.3"
# https://github.com/bazelbuild/rules_java
http_archive(
name = "rules_java",
integrity = "sha256-wO5g+HV/FAwVf8LHr3A9gZUU3m4CXr9wOG04vdhfzoM=",
url = "https://github.com/bazelbuild/rules_java/releases/download/%s/rules_java-%s.tar.gz" % (RULES_JAVA_TAG, RULES_JAVA_TAG),
)
# >=7.0.0 requires a newer version of com_google_protobuf which breaks rules_scala.
RULES_PROTO_TAG = "6.0.2"
# https://github.com/bazelbuild/rules_proto
http_archive(
name = "rules_proto",
integrity = "sha256-b7Z2fRvvU1MQVH4DJH91GLA0h3QMEbbGrbeVIDP+EpU=",
strip_prefix = "rules_proto-%s" % RULES_PROTO_TAG,
url = "https://github.com/bazelbuild/rules_proto/archive/%s.tar.gz" % RULES_PROTO_TAG,
)
RULES_PYTHON_TAG = "0.40.0"
# https://github.com/bazelbuild/rules_python
http_archive(
name = "rules_python",
sha256 = "690e0141724abb568267e003c7b6d9a54925df40c275a870a4d934161dc9dd53",
strip_prefix = "rules_python-%s" % RULES_PYTHON_TAG,
url = "https://github.com/bazelbuild/rules_python/releases/download/%s/rules_python-%s.tar.gz" % (RULES_PYTHON_TAG, RULES_PYTHON_TAG),
)
RULES_ANDROID_TAG = "0.1.1"
# https://github.com/bazelbuild/rules_android
http_archive(
name = "rules_android",
sha256 = "cd06d15dd8bb59926e4d65f9003bfc20f9da4b2519985c27e190cddc8b7a7806",
strip_prefix = "rules_android-%s" % RULES_ANDROID_TAG,
url = "https://github.com/bazelbuild/rules_android/archive/v%s.zip" % RULES_ANDROID_TAG,
)
STARDOC_TAG = "0.7.2"
# https://github.com/bazelbuild/stardoc
http_archive(
name = "io_bazel_stardoc",
integrity = "sha256-Dh7UqY8m5xh3a9ZNBT0CuzTZhXLM0D1ro1URKhIFcGs=",
url = "https://github.com/bazelbuild/stardoc/releases/download/%s/stardoc-%s.tar.gz" % (STARDOC_TAG, STARDOC_TAG),
)
BAZEL_SKYLIB_TAG = "1.7.1"
# https://github.com/bazelbuild/bazel-skylib
http_archive(
name = "bazel_skylib",
integrity = "sha256-vCg8381SalLDIBJ5zaS8KYZS76iYsQtNsIN9xRZSdW8=",
url = "https://github.com/bazelbuild/bazel-skylib/releases/download/%s/bazel-skylib-%s.tar.gz" % (BAZEL_SKYLIB_TAG, BAZEL_SKYLIB_TAG),
)
RULES_KOTLIN_TAG = "v1.9.6"
# https://github.com/bazelbuild/rules_kotlin
http_archive(
name = "io_bazel_rules_kotlin",
integrity = "sha256-O3cpdv7Hvc2h2EudObF2WJQkwEfrIXW+0JqsYw5Qr0M=",
url = "https://github.com/bazelbuild/rules_kotlin/releases/download/%s/rules_kotlin-%s.tar.gz" % (RULES_KOTLIN_TAG, RULES_KOTLIN_TAG),
)
RULES_SCALA_TAG = "6.6.0"
# https://github.com/bazelbuild/rules_scala
http_archive(
name = "io_bazel_rules_scala",
sha256 = "e734eef95cf26c0171566bdc24d83bd82bdaf8ca7873bec6ce9b0d524bdaf05d",
strip_prefix = "rules_scala-%s" % RULES_SCALA_TAG,
url = "https://github.com/bazelbuild/rules_scala/releases/download/v%s/rules_scala-v%s.tar.gz" % (RULES_SCALA_TAG, RULES_SCALA_TAG),
)
RULES_FUZZING_TAG = "0.5.2"
# https://github.com/bazelbuild/rules_fuzzing
http_archive(
name = "rules_fuzzing",
integrity = "sha256-5rwhm/rJ4fg7Mn3QkPcoqflz7pm5tdjloYSicy7whiM=",
strip_prefix = "rules_fuzzing-%s" % RULES_FUZZING_TAG,
urls = ["https://github.com/bazelbuild/rules_fuzzing/releases/download/v%s/rules_fuzzing-%s.zip" % (RULES_FUZZING_TAG, RULES_FUZZING_TAG)],
)
# Bazel contrib
# =========================================================
RULES_JVM_EXTERNAL_TAG = "5.3"
# https://github.com/bazel-contrib/rules_jvm_external
http_archive(
name = "rules_jvm_external",
integrity = "sha256-0x42m4VDIspQmOoSxp1xdd7ZcUNeVcGN2d1fKcxSSaw=",
strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG,
url = "https://github.com/bazel-contrib/rules_jvm_external/releases/download/%s/rules_jvm_external-%s.tar.gz" % (RULES_JVM_EXTERNAL_TAG, RULES_JVM_EXTERNAL_TAG),
)
# https://github.com/bazel-contrib/bazel_features
http_archive(
name = "bazel_features",
integrity = "sha256-ixybdVhJgAD1reu8WEt78VtrK/GBRIpm9rL8W0yEIxw=",
strip_prefix = "bazel_features-1.23.0",
url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.23.0/bazel_features-v1.23.0.tar.gz",
)
# Third-party
# =========================================================
# Using protobuf 28.3 causes ProtoScalaPBRule to hang. Looking at issues in
# rules_scala, it seems like 25.5 is the newest version of protobuf that
# rules_scala can handle.
# See: https://github.com/bazelbuild/rules_scala/issues/1647
PROTOBUF_TAG = "25.5"
# https://github.com/protocolbuffers/protobuf
http_archive(
name = "com_google_protobuf",
integrity = "sha256-PPfVsXxP8E/p8DgQTp0Mrm2gm4ziccE+RPisafUeTg8=",
strip_prefix = "protobuf-%s" % PROTOBUF_TAG,
url = "https://github.com/protocolbuffers/protobuf/releases/download/v%s/protobuf-%s.tar.gz" % (PROTOBUF_TAG, PROTOBUF_TAG),
)
DAGGER_TAG = "2.54"
# https://github.com/google/dagger
http_archive(
name = "dagger",
integrity = "sha256-9/0XTvm7D+eyO1DFAPeOGbZM52IWn6epfHFxZY2Cg0w=",
strip_prefix = "dagger-dagger-%s" % DAGGER_TAG,
url = "https://github.com/google/dagger/archive/dagger-%s.zip" % DAGGER_TAG,
)
ROBOLECTRIC_TAG = "4.7.3"
# https://github.com/robolectric/robolectric-bazel
http_archive(
name = "robolectric",
sha256 = "97f169d39f19412bdd07fd6c274dcda0a7c8f623f7f00aa5a3b94994fc6f0ec4",
strip_prefix = "robolectric-bazel-%s" % ROBOLECTRIC_TAG,
url = "https://github.com/robolectric/robolectric-bazel/archive/%s.tar.gz" % ROBOLECTRIC_TAG,
)
LIBSODIUM_TAG = "1.0.18"
# https://github.com/jedisct1/libsodium
http_archive(
name = "libsodium",
build_file = "//bazel:libsodium.BUILD",
sha256 = "1b72c0cdbc535ce42e14ac15e8fc7c089a3ee9ffe5183399fd77f0f3746ea794",
strip_prefix = "libsodium-%s" % LIBSODIUM_TAG,
url = "https://github.com/jedisct1/libsodium/archive/%s.zip" % LIBSODIUM_TAG,
)
OPUS_TAG = "5c94ec3205c30171ffd01056f5b4622b7c0ab54c"
# https://github.com/xiph/opus
http_archive(
name = "opus",
build_file = "//bazel:opus.BUILD",
sha256 = "09366bf588b02b76bda3fd1428a30b55ca995d6d2eac509a39919f337690329e",
strip_prefix = "opus-%s" % OPUS_TAG,
url = "https://github.com/xiph/opus/archive/%s.zip" % OPUS_TAG,
)
LIBVPX_TAG = "3d28ff98039134325cf689d8d08996fc8dabb225"
# https://github.com/webmproject/libvpx
http_archive(
name = "libvpx",
build_file = "//bazel:libvpx.BUILD",
sha256 = "27d082899b60dea79c596affc68341522db1f72c241f6d6096fc46bcf774f217",
strip_prefix = "libvpx-%s" % LIBVPX_TAG,
url = "https://github.com/webmproject/libvpx/archive/%s.zip" % LIBVPX_TAG,
)
# aTox maven dependencies
# =========================================================
load("@dagger//:workspace_defs.bzl", "DAGGER_ARTIFACTS", "DAGGER_REPOSITORIES")
load("@rules_jvm_external//:defs.bzl", "maven_install")
maven_install(
artifacts = DAGGER_ARTIFACTS + [
"androidx.activity:activity-ktx:1.2.3",
"androidx.activity:activity:1.2.3",
"androidx.annotation:annotation:1.1.0",
"androidx.appcompat:appcompat:1.3.0",
"androidx.core:core-ktx:1.5.0",
"androidx.databinding:databinding-adapters:3.4.2",
"androidx.databinding:databinding-common:3.4.2",
"androidx.databinding:databinding-runtime:3.4.2",
"androidx.fragment:fragment-ktx:1.3.5",
"androidx.fragment:fragment:1.3.5",
"androidx.multidex:multidex:2.0.1",
"androidx.navigation:navigation-fragment-ktx:2.3.5",
"androidx.navigation:navigation-ui-ktx:2.3.5",
"androidx.preference:preference:1.1.1",
"androidx.room:room-compiler:2.2.6",
"androidx.room:room-ktx:2.2.6",
"androidx.room:room-runtime:2.2.6",
"androidx.room:room-testing:2.2.6",
"androidx.test.ext:junit:1.2.1",
"com.google.android.material:material:1.4.0",
"com.google.code.gson:gson:2.8.6",
"com.google.guava:guava:19.0",
"com.squareup.picasso:picasso:2.8",
"com.typesafe.scala-logging:scala-logging_2.11:3.7.2",
"javax.inject:javax.inject:1",
"junit:junit:4.13.1",
"org.jetbrains.kotlin:kotlin-test-junit:1.7.20",
"org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0",
"org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.0",
"org.jetbrains:annotations:13.0",
"org.slf4j:slf4j-api:1.7.25",
"org.robolectric:robolectric:4.7.3",
"org.scala-lang:scala-library:2.11.12",
"androidx.lifecycle:lifecycle-extensions:2.2.0",
"androidx.lifecycle:lifecycle-livedata-ktx:2.2.0",
"androidx.lifecycle:lifecycle-service:2.2.0",
"androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0",
],
repositories = DAGGER_REPOSITORIES + [
"https://repo1.maven.org/maven2/",
"https://dl.google.com/dl/android/maven2/",
],
)
# Tox
# =========================================================
local_repository(
name = "pthread",
path = "bazel/pthread",
)
local_repository(
name = "psocket",
path = "bazel/psocket",
)
JVM_TOXCORE_API_TAG = "c0f37cfd77d79d5826ea566127f60fce838858c2"
# https://github.com/TokTok/jvm-toxcore-api
http_archive(
name = "jvm-toxcore-api",
build_file = "//bazel:jvm-toxcore-api.BUILD",
sha256 = "ab129f7d845d87e1b6ee0a2b4bc34acede45480dd32a15f85a08e9dfca7cedf6",
strip_prefix = "jvm-toxcore-api-%s" % JVM_TOXCORE_API_TAG,
url = "https://github.com/TokTok/jvm-toxcore-api/archive/%s.tar.gz" % JVM_TOXCORE_API_TAG,
)
JVM_TOXCORE_C_TAG = "f697eef5d0a16a025b187c3369288986e89bde2b"
# https://github.com/TokTok/jvm-toxcore-c
http_archive(
name = "jvm-toxcore-c",
build_file = "//bazel:jvm-toxcore-c.BUILD",
sha256 = "93fb5cd0a1f45561e52cb585287cec98415d80b655d847278aa51c8d26f80124",
strip_prefix = "jvm-toxcore-c-%s" % JVM_TOXCORE_C_TAG,
url = "https://github.com/TokTok/jvm-toxcore-c/archive/%s.tar.gz" % JVM_TOXCORE_C_TAG,
)
JVM_MACROS_TAG = "8e8991581bec396861678012cab302ba09ced629"
# https://github.com/TokTok/jvm-macros
http_archive(
name = "jvm-macros",
build_file = "//bazel:jvm-macros.BUILD",
sha256 = "3f2e7c024347085596ad3c90d236e0e6fddf5c7c18c03a66a058c4d334f24888",
strip_prefix = "jvm-macros-%s" % JVM_MACROS_TAG,
url = "https://github.com/TokTok/jvm-macros/archive/%s.tar.gz" % JVM_MACROS_TAG,
)
C_TOXCORE_TAG = "0.2.20"
# https://github.com/TokTok/c-toxcore
http_archive(
name = "c-toxcore",
integrity = "sha256-qciaja6nRdU+XXjnqsuZx7R5LEQApaaccSOPRdYWT0w=",
patch_cmds = [
# Delete references to the "project" stuff that lives in toktok-stack.
"sed -i /project/d BUILD.bazel",
# Ignore the "other", "testing", and "auto_tests" bonus content.
"echo other >.bazelignore",
"echo testing >>.bazelignore",
"echo auto_tests >>.bazelignore",
# Delete references to the "no_undefined" cc_library that lives in toktok-stack.
"sed -i /no_undefined/d toxencryptsave/BUILD.bazel",
"sed -i /no_undefined/d toxav/BUILD.bazel",
"sed -i /no_undefined/d toxcore/BUILD.bazel",
"sed -i /no_undefined/d third_party/BUILD.bazel",
# Replace toktok-stack selects w/ more standard versions.
"sed -i 's|//tools/config:linux|@platforms//os:linux|g' toxcore/BUILD.bazel",
# Replace "//c-toxcore/" w/ "@c-toxcore//" to get internal dependencies between libraries working.
"sed -i 's|//c-toxcore/|@c-toxcore//|g' BUILD.bazel",
"sed -i 's|//c-toxcore/|@c-toxcore//|g' toxcore/BUILD.bazel",
"sed -i 's|//c-toxcore/|@c-toxcore//|g' toxav/BUILD.bazel",
"sed -i 's|//c-toxcore/|@c-toxcore//|g' toxencryptsave/BUILD.bazel",
# Fix some "//c-toxcore:" -> "@c-toxcore:" references.
"sed -i 's|//c-toxcore:|@c-toxcore//:|g' toxcore/BUILD.bazel",
"sed -i 's|//c-toxcore:|@c-toxcore//:|g' toxav/BUILD.bazel",
"sed -i 's|//c-toxcore:|@c-toxcore//:|g' toxencryptsave/BUILD.bazel",
"sed -i 's|//c-toxcore:|@c-toxcore//:|g' third_party/BUILD.bazel",
# Flatten the gendir structure to deal with c-toxcore having its own workspace.
"sed -i 's|$(GENDIR)/c-toxcore/|$(RULEDIR)/|g' BUILD.bazel",
],
strip_prefix = "c-toxcore-%s" % C_TOXCORE_TAG,
url = "https://github.com/TokTok/c-toxcore/releases/download/v%s/c-toxcore-%s.tar.gz" % (C_TOXCORE_TAG, C_TOXCORE_TAG),
)
# Transitive dependencies and toolchain setup
# =========================================================
#
# These go last since we override a bunch of them.
load("@bazel_features//:deps.bzl", "bazel_features_deps")
bazel_features_deps()
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
rules_pkg_dependencies()
load("@io_bazel_rules_kotlin//kotlin:repositories.bzl", "kotlin_repositories", "kotlinc_version")
kotlin_repositories(
compiler_release = kotlinc_version(
release = "1.9.22",
sha256 = "88b39213506532c816ff56348c07bbeefe0c8d18943bffbad11063cf97cac3e6",
),
)
register_toolchains("//:kotlin_toolchain")
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
protobuf_deps()
load("@robolectric//bazel:robolectric.bzl", "robolectric_repositories")
robolectric_repositories()
load("@io_bazel_rules_scala//:scala_config.bzl", "scala_config")
scala_config(scala_version = "2.11.12")
load("@io_bazel_rules_scala//scala:scala.bzl", "scala_repositories")
load("@io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_toolchains")
load("@io_bazel_rules_scala//scala_proto:scala_proto.bzl", "scala_proto_repositories")
load("@io_bazel_rules_scala//scala_proto:toolchains.bzl", "scala_proto_register_enable_all_options_toolchain")
scala_register_toolchains()
scala_repositories()
scala_proto_repositories()
scala_proto_register_enable_all_options_toolchain()
load("@rules_fuzzing//fuzzing:repositories.bzl", "rules_fuzzing_dependencies")
rules_fuzzing_dependencies()
load("@rules_fuzzing//fuzzing:init.bzl", "rules_fuzzing_init")
rules_fuzzing_init()