1313# limitations under the License.
1414
1515
16- load ("@bazel_tools//tools/build_defs/repo:http.bzl" , "http_archive" )
17-
1816#############################
1917# Load nested repository
2018#############################
@@ -26,37 +24,6 @@ local_repository(
2624 path = "examples/bazel" ,
2725)
2826
29- #############################
30- # Load Bazel Skylib rules
31- #############################
32-
33- BAZEL_SKYLIB_VERSION = "1.5.0"
34-
35- BAZEL_SKYLIB_SHA = "cd55a062e763b9349921f0f5db8c3933288dc8ba4f76dd9416aac68acee3cb94"
36-
37- http_archive (
38- name = "bazel_skylib" ,
39- sha256 = BAZEL_SKYLIB_SHA ,
40- urls = [
41- "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/%s/bazel-skylib-%s.tar.gz" % (BAZEL_SKYLIB_VERSION , BAZEL_SKYLIB_VERSION ),
42- "https://github.com/bazelbuild/bazel-skylib/releases/download/%s/bazel-skylib-%s.tar.gz" % (BAZEL_SKYLIB_VERSION , BAZEL_SKYLIB_VERSION ),
43- ],
44- )
45-
46- load ("@bazel_skylib//:workspace.bzl" , "bazel_skylib_workspace" )
47-
48- bazel_skylib_workspace ()
49-
50- #############################
51- # Load rules_java repository
52- #############################
53-
54- http_archive (
55- name = "rules_java" ,
56- sha256 = "c73336802d0b4882e40770666ad055212df4ea62cfa6edf9cb0f9d29828a0934" ,
57- url = "https://github.com/bazelbuild/rules_java/releases/download/5.3.5/rules_java-5.3.5.tar.gz" ,
58- )
59-
6027#############################
6128# Load Android Sdk
6229#############################
@@ -67,84 +34,10 @@ android_sdk_repository(
6734 build_tools_version = "32.0.0" ,
6835)
6936
70- ####################################################
71- # Load Protobuf repository (needed by bazel-common)
72- ####################################################
73-
74- http_archive (
75- name = "rules_proto" ,
76- # output from `sha256sum` on the downloaded tar.gz file
77- sha256 = "66bfdf8782796239d3875d37e7de19b1d94301e8972b3cbd2446b332429b4df1" ,
78- strip_prefix = "rules_proto-4.0.0" ,
79- urls = [
80- "https://mirror.bazel.build/github.com/bazelbuild/rules_proto/archive/refs/tags/4.0.0.tar.gz" ,
81- "https://github.com/bazelbuild/rules_proto/archive/refs/tags/4.0.0.tar.gz" ,
82- ],
83- )
84-
85- load ("@rules_proto//proto:repositories.bzl" , "rules_proto_dependencies" , "rules_proto_toolchains" )
86-
87- rules_proto_dependencies ()
88-
89- rules_proto_toolchains ()
90-
91- #############################
92- # Load Protobuf dependencies
93- #############################
94-
95- # rules_python and zlib are required by protobuf.
96- # TODO(ronshapiro): Figure out if zlib is in fact necessary, or if proto can depend on the
97- # @bazel_tools library directly. See discussion in
98- # https://github.com/protocolbuffers/protobuf/pull/5389#issuecomment-481785716
99- # TODO(cpovirk): Should we eventually get rules_python from "Bazel Federation?"
100- # https://github.com/bazelbuild/rules_python#getting-started
101-
102- http_archive (
103- name = "rules_python" ,
104- sha256 = "e5470e92a18aa51830db99a4d9c492cc613761d5bdb7131c04bd92b9834380f6" ,
105- strip_prefix = "rules_python-4b84ad270387a7c439ebdccfd530e2339601ef27" ,
106- urls = ["https://github.com/bazelbuild/rules_python/archive/4b84ad270387a7c439ebdccfd530e2339601ef27.tar.gz" ],
107- )
108-
109- http_archive (
110- name = "zlib" ,
111- build_file = "@com_google_protobuf//:third_party/zlib.BUILD" ,
112- sha256 = "629380c90a77b964d896ed37163f5c3a34f6e6d897311f1df2a7016355c45eff" ,
113- strip_prefix = "zlib-1.2.11" ,
114- urls = ["https://github.com/madler/zlib/archive/v1.2.11.tar.gz" ],
115- )
116-
117- #############################
118- # Load Robolectric repository
119- #############################
120-
121- ROBOLECTRIC_VERSION = "4.4"
122-
123- http_archive (
124- name = "robolectric" ,
125- sha256 = "d4f2eb078a51f4e534ebf5e18b6cd4646d05eae9b362ac40b93831bdf46112c7" ,
126- strip_prefix = "robolectric-bazel-%s" % ROBOLECTRIC_VERSION ,
127- urls = ["https://github.com/robolectric/robolectric-bazel/archive/%s.tar.gz" % ROBOLECTRIC_VERSION ],
128- )
129-
130- load ("@robolectric//bazel:robolectric.bzl" , "robolectric_repositories" )
131-
132- robolectric_repositories ()
133-
13437#############################
13538# Load Kotlin repository
13639#############################
13740
138- RULES_KOTLIN_TAG = "v1.8"
139-
140- RULES_KOTLIN_SHA = "01293740a16e474669aba5b5a1fe3d368de5832442f164e4fbfc566815a8bc3a"
141-
142- http_archive (
143- name = "io_bazel_rules_kotlin" ,
144- sha256 = RULES_KOTLIN_SHA ,
145- urls = ["https://github.com/bazelbuild/rules_kotlin/releases/download/%s/rules_kotlin_release.tgz" % RULES_KOTLIN_TAG ],
146- )
147-
14841load ("@io_bazel_rules_kotlin//kotlin:repositories.bzl" , "kotlin_repositories" , "kotlinc_version" )
14942
15043KOTLIN_VERSION = "1.9.23"
@@ -167,17 +60,6 @@ kt_register_toolchains()
16760# Load Maven dependencies
16861#############################
16962
170- RULES_JVM_EXTERNAL_TAG = "4.5"
171-
172- RULES_JVM_EXTERNAL_SHA = "b17d7388feb9bfa7f2fa09031b32707df529f26c91ab9e5d909eb1676badd9a6"
173-
174- http_archive (
175- name = "rules_jvm_external" ,
176- sha256 = RULES_JVM_EXTERNAL_SHA ,
177- strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG ,
178- url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % RULES_JVM_EXTERNAL_TAG ,
179- )
180-
18163load ("@rules_jvm_external//:defs.bzl" , "maven_install" )
18264
18365ANDROID_LINT_VERSION = "30.1.0"
@@ -209,6 +91,9 @@ KSP_VERSION = KOTLIN_VERSION + "-1.0.19"
20991
21092MAVEN_VERSION = "3.3.3"
21193
94+ # NOTE: This version should match the version declared in MODULE.bazel
95+ ROBOLECTRIC_VERSION = "4.11.1"
96+
21297maven_install (
21398 artifacts = [
21499 "androidx.annotation:annotation:1.1.0" ,
@@ -301,8 +186,8 @@ maven_install(
301186 "org.ow2.asm:asm:%s" % ASM_VERSION ,
302187 "org.ow2.asm:asm-tree:%s" % ASM_VERSION ,
303188 "org.ow2.asm:asm-commons:%s" % ASM_VERSION ,
304- "org.robolectric:robolectric:4.4" ,
305- "org.robolectric:shadows-framework:4.4" , # For ActivityController
189+ "org.robolectric:robolectric:%s" % ROBOLECTRIC_VERSION ,
190+ "org.robolectric:shadows-framework:%s" % ROBOLECTRIC_VERSION , # For ActivityController
306191 ],
307192 repositories = [
308193 "https://repo1.maven.org/maven2" ,
0 commit comments