Skip to content

Commit bd12ddb

Browse files
brettchabotcopybara-androidxtest
authored andcommitted
Upgrade bazel toolchain.
This commit upgrades the bazel version and a bunch of associated pieces of the toolchain: bazel 7.5.0 bzlmod kotlin 2.1.0 rules_java 8.6.0 robolectric 4.14.1 rules_jvm_external 6.6 rules_kotlin 2.1.3 rules_android 0.6.3 java 21 PiperOrigin-RevId: 738974759
1 parent 9741ad7 commit bd12ddb

File tree

25 files changed

+181
-321
lines changed

25 files changed

+181
-321
lines changed

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.5.0
1+
7.5.0

.github/workflows/ci.yml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
- 'axt_**_release_branch'
1212

1313
env:
14-
cache-version: v1
14+
cache-version: v2
1515

1616
jobs:
1717
build:
@@ -20,11 +20,11 @@ jobs:
2020
steps:
2121
- name: Check out repository code
2222
uses: actions/checkout@v4
23-
- name: Install Java 17
23+
- name: Install Java 21
2424
uses: actions/setup-java@v4
2525
with:
2626
distribution: 'zulu'
27-
java-version: '17'
27+
java-version: '21'
2828
- name: 'Cache Bazel files'
2929
uses: actions/cache@v4
3030
with:
@@ -46,14 +46,8 @@ jobs:
4646
name: local-snapshot
4747
path: ~/download
4848
- name: 'Clean bazel cache'
49-
# Don't cache the bazel/external directory, since it can be > 2GB
50-
# and is expensive to restore and save
51-
# According to the documentation, we should be able to exclude these via
52-
# the actions/cache path, e.g. "!~/.cache/bazel/*/*/external/" but that
53-
# doesn't seem to work.
5449
run: |
5550
rm -rf $(bazel info repository_cache)
56-
rm -rf ~/.cache/bazel/*/*/external/
5751
shell: bash
5852
test:
5953
runs-on: ubuntu-latest
@@ -77,14 +71,8 @@ jobs:
7771
run: bazelisk test --test_tag_filters=robolectric,fast --build_tag_filters=robolectric,fast --test_output=all ...
7872
shell: bash
7973
- name: 'Clean bazel cache'
80-
# Don't cache the bazel/external directory, since it can be > 2GB
81-
# and is expensive to restore and save
82-
# According to the documentation, we should be able to exclude these via
83-
# the actions/cache path, e.g. "!~/.cache/bazel/*/*/external/" but that
84-
# doesn't seem to work.
8574
run: |
8675
rm -rf $(bazel info repository_cache)
87-
rm -rf ~/.cache/bazel/*/*/external/
8876
shell: bash
8977
gradle-emulator-test:
9078
runs-on: ubuntu-latest

MODULE.bazel

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# These need needs to be consistent with their counterparts in build_extensions/axt_deps_versions.bzl.
2+
KOTLIN_VERSION = "2.1.0"
3+
KOTLINX_COROUTINES_VERSION = "1.7.1"
4+
GRPC_VERSION = "1.68.1"
5+
# TODO(brettchabot): make this the same as GRPC_VERSION.
6+
# Tryng to do so results in `external/grpc-java~/okhttp/src/main/java/io/grpc/okhttp/ExceptionHandlingFrameWriter.java:147: error: [strict] Using type okio.Buffer from an indirect dependency (TOOL_INFO: "@maven//:com_squareup_okio_okio_jvm")`
7+
GRPC_MAVEN_VERSION = "1.54.1"
8+
9+
bazel_dep(name = "rules_java", version = "8.6.0")
10+
bazel_dep(name = "rules_jvm_external", version = "6.6")
11+
bazel_dep(name = "rules_android", version = "0.6.3", repo_name = "build_bazel_rules_android")
12+
bazel_dep(name = "rules_kotlin", version = "2.1.3", repo_name = "io_bazel_rules_kotlin")
13+
bazel_dep(name = "protobuf", version = "29.0", repo_name = "com_google_protobuf")
14+
bazel_dep(name = "grpc-java", version = GRPC_VERSION)
15+
bazel_dep(name = "rules_robolectric", version = "4.14.1.2", repo_name = "robolectric")
16+
17+
# Pin the version of rules_robolectric so that it matches the robolectric version we get from maven.
18+
single_version_override(
19+
module_name = "rules_robolectric",
20+
version = "4.14.1.2",
21+
)
22+
23+
# maven dependencies
24+
maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
25+
26+
maven.artifact(
27+
artifact = "accessibility-test-framework",
28+
# exclude the org.checkerframework dependency since that require
29+
# java8 compatibility. See b/176926990
30+
# accessibility-test-framework depends on hamcrest 2.2 which causes 'Using type org.hamcrest.Matcher from an indirect dependency' compile errors
31+
exclusions = [
32+
"org.checkerframework:checker",
33+
"org.hamcrest:hamcrest-core",
34+
"org.hamcrest:hamcrest-library",
35+
],
36+
group = "com.google.android.apps.common.testing.accessibility.framework",
37+
version = "3.1.2",
38+
)
39+
40+
maven.install(
41+
name = "maven",
42+
artifacts = [
43+
"androidx.annotation:annotation:1.7.0-beta01",
44+
"androidx.concurrent:concurrent-futures:1.1.0",
45+
"androidx.concurrent:concurrent-futures-ktx:1.1.0",
46+
"androidx.core:core:1.6.0",
47+
"androidx.lifecycle:lifecycle-common:2.3.1",
48+
"androidx.multidex:multidex:2.0.0",
49+
"androidx.tracing:tracing:1.1.0",
50+
"androidx.window:window-java:1.1.0",
51+
"androidx.window:window-core:1.1.0",
52+
"com.google.dagger:dagger-compiler:2.46",
53+
"com.google.dagger:dagger-producers:2.46",
54+
"com.google.dagger:dagger:2.46",
55+
"com.google.googlejavaformat:google-java-format:1.4",
56+
"com.squareup:javapoet:1.9.0",
57+
"io.grpc:grpc-okhttp:%s" % GRPC_MAVEN_VERSION,
58+
"io.grpc:grpc-api:%s" % GRPC_MAVEN_VERSION,
59+
"io.grpc:grpc-stub:%s" % GRPC_MAVEN_VERSION,
60+
"io.grpc:grpc-core:%s" % GRPC_MAVEN_VERSION,
61+
"io.grpc:grpc-context:%s" % GRPC_MAVEN_VERSION,
62+
"io.grpc:grpc-protobuf-lite:%s" % GRPC_MAVEN_VERSION,
63+
"junit:junit:4.13.2",
64+
"org.ccil.cowan.tagsoup:tagsoup:1.2.1",
65+
"org.hamcrest:hamcrest-library:1.3",
66+
"org.pantsbuild:jarjar:1.7.2",
67+
"org.jetbrains.kotlin:kotlin-stdlib:%s" % KOTLIN_VERSION,
68+
"org.jetbrains.kotlinx:kotlinx-coroutines-core:%s" % KOTLINX_COROUTINES_VERSION,
69+
"org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:%s" % KOTLINX_COROUTINES_VERSION,
70+
"org.jetbrains.kotlinx:kotlinx-coroutines-android:%s" % KOTLINX_COROUTINES_VERSION,
71+
"org.robolectric:robolectric:4.14.1",
72+
],
73+
fetch_sources = True,
74+
repositories = [
75+
"https://maven.google.com",
76+
"https://repo1.maven.org/maven2",
77+
"https://dl.bintray.com/linkedin/maven",
78+
],
79+
)
80+
81+
use_repo(maven, "maven")
82+
83+
# need to have a isolated version tree for listenablefuture, because otherwise
84+
# listenablefuture will get resolved to 9999.0-empty-to-avoid-conflict-with-guava
85+
maven.install(
86+
name = "maven_listenablefuture",
87+
artifacts = [
88+
"com.google.guava:listenablefuture:1.0",
89+
],
90+
repositories = [
91+
"https://maven.google.com",
92+
"https://repo1.maven.org/maven2",
93+
"https://dl.bintray.com/linkedin/maven",
94+
],
95+
)
96+
use_repo(maven, "maven_listenablefuture")
97+

0 commit comments

Comments
 (0)