Skip to content

Commit ae26437

Browse files
committed
Fix tests by upgrading rules_kotlin, rules_android.
Fix gradle tests by upgrading to kotlin 2.1.0
1 parent 5a80466 commit ae26437

File tree

3 files changed

+6
-150
lines changed

3 files changed

+6
-150
lines changed

MODULE.bazel

Lines changed: 4 additions & 148 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
# These need needs to be consistent with their counterparts in build_extensions/axt_deps_versions.bzl.
2-
KOTLIN_VERSION = "1.8.20"
2+
KOTLIN_VERSION = "2.1.0"
33
KOTLINX_COROUTINES_VERSION = "1.7.1"
4-
#GRPC_VERSION = "1.54.1"
5-
# Get from https://github.com/JetBrains/kotlin/releases/
6-
#KOTLINC_RELEASE_SHA = "10df74c3c6e2eafd4c7a5572352d37cbe41774996e42de627023cb4c82b50ae4"
74

85
bazel_dep(name = "rules_java", version = "8.6.0")
96
bazel_dep(name = "rules_jvm_external", version = "6.6")
10-
bazel_dep(name = "rules_android", version = "0.6.0", repo_name = "build_bazel_rules_android")
11-
bazel_dep(name = "rules_kotlin", version = "1.9.6", repo_name = "io_bazel_rules_kotlin")
7+
bazel_dep(name = "rules_android", version = "0.6.3", repo_name = "build_bazel_rules_android")
8+
bazel_dep(name = "rules_kotlin", version = "2.1.3", repo_name = "io_bazel_rules_kotlin")
129
bazel_dep(name = "protobuf", version = "29.0", repo_name = "com_google_protobuf")
1310
bazel_dep(name = "grpc-java", version = "1.68.1")
14-
#needed?
15-
#bazel_dep(name = "rules_python", version = "0.37.1")
1611
bazel_dep(name = "rules_robolectric", version = "4.14.1.2", repo_name = "robolectric")
1712

1813
# Pin the version of rules_robolectric so that it matches the robolectric version we get from maven.
@@ -42,104 +37,41 @@ maven.install(
4237
name = "maven",
4338
artifacts = [
4439
"androidx.annotation:annotation:1.7.0-beta01",
45-
# "androidx.annotation:annotation-experimental:jar:1.1.0",
46-
# "androidx.appcompat:appcompat:1.3.1",
4740
"androidx.concurrent:concurrent-futures:1.1.0",
4841
"androidx.concurrent:concurrent-futures-ktx:1.1.0",
4942
"androidx.core:core:1.6.0",
50-
# "androidx.cursoradapter:cursoradapter:1.0.0",
51-
# "androidx.drawerlayout:drawerlayout:1.1.1",
52-
# "androidx.fragment:fragment:1.3.6",
53-
# "androidx.legacy:legacy-support-core-ui:1.0.0",
54-
# "androidx.legacy:legacy-support-core-utils:1.0.0",
55-
# "androidx.legacy:legacy-support-v4:1.0.0",
5643
"androidx.lifecycle:lifecycle-common:2.3.1",
5744
"androidx.multidex:multidex:2.0.0",
58-
# "androidx.recyclerview:recyclerview:1.2.1",
5945
"androidx.tracing:tracing:1.1.0",
60-
# "androidx.test.uiautomator:uiautomator:2.2.0",
61-
# "androidx.viewpager:viewpager:1.0.0",
62-
# "androidx.window:window:1.1.0",
6346
"androidx.window:window-java:1.1.0",
6447
"androidx.window:window-core:1.1.0",
65-
# "aopalliance:aopalliance:1.0",
66-
# "com.android.tools.lint:lint-api:30.1.0",
67-
# "com.android.tools.lint:lint-checks:30.1.0",
68-
# "com.beust:jcommander:1.72",
69-
70-
# "com.google.android.material:material:1.4.0",
71-
# "com.google.auto.value:auto-value:1.5.1",
72-
# "com.google.code.findbugs:jsr305:3.0.2",
73-
# "com.google.code.gson:gson:2.8.5",
7448
"com.google.dagger:dagger-compiler:2.46",
7549
"com.google.dagger:dagger-producers:2.46",
7650
"com.google.dagger:dagger:2.46",
77-
# "com.google.errorprone:error_prone_annotations:2.9.0",
78-
# "com.google.errorprone:javac-shaded:9-dev-r4023-3",
79-
# "com.google.flogger:flogger-system-backend:0.4",
80-
# "com.google.flogger:flogger:0.4",
81-
# "com.google.flogger:google-extensions:0.4",
8251
"com.google.googlejavaformat:google-java-format:1.4",
83-
# "com.google.guava:guava:30.1.1-android",
84-
# "com.google.guava:listenablefuture:1.0",
85-
# "com.google.inject.extensions:guice-multibindings:4.1.0",
86-
# "com.google.inject:guice:4.1.0",
87-
# "com.google.truth:truth:1.0",
88-
# "com.googlecode.jarjar:jarjar:1.3",
89-
# "com.linkedin.dexmaker:dexmaker-mockito:jar:2.28.1",
90-
# "com.linkedin.dexmaker:dexmaker:2.28.1",
91-
# "org.mockito.kotlin:mockito-kotlin:4.1.0",
9252
"com.squareup:javapoet:1.9.0",
9353
"io.grpc:grpc-okhttp:1.54.1",
9454
"io.grpc:grpc-stub:1.54.1",
95-
# "org.apache.tomcat:annotations-api:6.0.53",
96-
# "javax.annotation:javax.annotation-api:1.3.1",
97-
# "javax.inject:javax.inject:1",
98-
# "joda-time:joda-time:2.10.1",
9955
"junit:junit:4.13.2",
100-
# "net.bytebuddy:byte-buddy-agent:1.9.10",
101-
# "net.bytebuddy:byte-buddy:1.9.10",
102-
# "net.sf.kxml:kxml2:jar:2.3.0",
10356
"org.ccil.cowan.tagsoup:tagsoup:1.2.1",
104-
# "org.checkerframework:checker-compat-qual:2.5.5",
105-
# "org.hamcrest:hamcrest-core:1.3",
10657
"org.hamcrest:hamcrest-library:1.3",
107-
# "org.mockito:mockito-core:2.28.1",
108-
# "org.objenesis:objenesis:2.6",
10958
"org.pantsbuild:jarjar:1.7.2",
11059
"org.jetbrains.kotlin:kotlin-stdlib:%s" % KOTLIN_VERSION,
11160
"org.jetbrains.kotlinx:kotlinx-coroutines-core:%s" % KOTLINX_COROUTINES_VERSION,
11261
"org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:%s" % KOTLINX_COROUTINES_VERSION,
11362
"org.jetbrains.kotlinx:kotlinx-coroutines-android:%s" % KOTLINX_COROUTINES_VERSION,
114-
"org.robolectric:robolectric:4.14.1",
115-
# maven.artifact(
116-
# artifact = "robolectric",
117-
# exclusions = [
118-
# # exclude the com.google.guava dependency since that require
119-
# # java8 compatibility.
120-
# maven.exclusion(
121-
# artifact = "guava",
122-
# group = "com.google.guava",
123-
# ),
124-
# ],
125-
# group = "org.robolectric",
126-
# version = "4.13",
127-
# ),
63+
"org.robolectric:robolectric:4.14.1",
12864
],
12965
fetch_sources = True,
130-
# generate_compat_repositories = True,
13166
repositories = [
13267
"https://maven.google.com",
13368
"https://repo1.maven.org/maven2",
13469
"https://dl.bintray.com/linkedin/maven",
13570
],
13671
)
13772

138-
139-
14073
use_repo(maven, "maven")
14174

142-
14375
# need to have a isolated version tree for listenablefuture, because otherwise
14476
# listenablefuture will get resolved to 9999.0-empty-to-avoid-conflict-with-guava
14577
maven.install(
@@ -155,79 +87,3 @@ maven.install(
15587
)
15688
use_repo(maven, "maven_listenablefuture")
15789

158-
159-
#android_sdk_repository(
160-
# name = "androidsdk",
161-
# api_level = 35,
162-
# build_tools_version = "35.0.0",
163-
#)
164-
#
165-
#load("//:repo.bzl", "android_test_repositories")
166-
#
167-
#android_test_repositories(with_dev_repositories = True)
168-
#
169-
#load("@robolectric//bazel:robolectric.bzl", "robolectric_repositories")
170-
#
171-
#robolectric_repositories()
172-
#
173-
## Kotlin toolchains
174-
#
175-
#rules_kotlin_version = "1.8-RC-12"
176-
#rules_kotlin_sha = "8e5c8ab087e0fa3fbb58e1f6b99d8fe40f75bac44994c3d208eba723284465d6"
177-
#
178-
#http_archive(
179-
# name = "io_bazel_rules_kotlin",
180-
# sha256 = rules_kotlin_sha,
181-
# urls = ["https://github.com/bazelbuild/rules_kotlin/releases/download/v%s/rules_kotlin_release.tgz" % rules_kotlin_version],
182-
#)
183-
#
184-
#load("@io_bazel_rules_kotlin//kotlin:repositories.bzl", "kotlin_repositories", "kotlinc_version")
185-
#
186-
#kotlin_repositories(
187-
# compiler_release = kotlinc_version(
188-
# release = KOTLIN_VERSION,
189-
# sha256 = KOTLINC_RELEASE_SHA,
190-
# ),
191-
#)
192-
#
193-
#load("@io_bazel_rules_kotlin//kotlin:core.bzl", "kt_register_toolchains")
194-
#
195-
#kt_register_toolchains()
196-
#
197-
## Android bazel rules from Dec 22 2022. This is the last commit that supports bazel 6.0.0
198-
#RULES_ANDROID_COMMIT = "ce37817d8589cac4a7cc20cb4d51fe8ad459dea1"
199-
#
200-
#RULES_ANDROID_SHA = "402b1ed3756028dca11835dad3225689a4040c3b377de798709f9a39b5c6af17"
201-
#
202-
#http_archive(
203-
# name = "rules_android",
204-
# sha256 = RULES_ANDROID_SHA,
205-
# strip_prefix = "rules_android-%s" % RULES_ANDROID_COMMIT,
206-
# url = "https://github.com/bazelbuild/rules_android/archive/%s.zip" % RULES_ANDROID_COMMIT,
207-
#)
208-
#
209-
#load("@rules_android//:prereqs.bzl", "rules_android_prereqs")
210-
#
211-
#rules_android_prereqs()
212-
#
213-
#load("@rules_android//:defs.bzl", "rules_android_workspace")
214-
#
215-
#rules_android_workspace()
216-
#
217-
#register_toolchains(
218-
# "@rules_android//toolchains/android:android_default_toolchain",
219-
# "@rules_android//toolchains/android_sdk:android_sdk_tools",
220-
#)
221-
#
222-
## Updated 2023-02-01
223-
#http_archive(
224-
# name = "rules_license",
225-
# sha256 = "6157e1e68378532d0241ecd15d3c45f6e5cfd98fc10846045509fb2a7cc9e381",
226-
# urls = [
227-
# "https://github.com/bazelbuild/rules_license/releases/download/0.0.4/rules_license-0.0.4.tar.gz",
228-
# ],
229-
#)
230-
#
231-
#load("@maven//:compat.bzl", "compat_repositories")
232-
#
233-
#compat_repositories()

build_extensions/axt_android_local_test.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
load("@io_bazel_rules_kotlin//kotlin:android.bzl", "kt_android_library")
44
load("//build_extensions:create_jar.bzl", "create_jar")
5-
load("@build_bazel_rules_android//android:rules.bzl", "android_local_test")
5+
load("@build_bazel_rules_android//android:rules.bzl", "android_local_test", "android_library")
66

77
def axt_android_local_test(name, srcs = [], deps = [], manifest = "//build_extensions:AndroidManifest_robolectric.xml", tags = ["robolectric"], **kwargs):
88
"""A wrapper around android_local_test that provides sensible defaults for androidx.test.

gradle-tests/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
plugins {
33
id 'com.android.library' version '8.5.0' apply false
4-
id 'org.jetbrains.kotlin.android' version '1.9.22' apply false
4+
id 'org.jetbrains.kotlin.android' version '2.1.0' apply false
55
}
66
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
77
kotlinOptions {

0 commit comments

Comments
 (0)