Skip to content

Commit 5221b85

Browse files
committed
Upgrade to C++ 17, Bazel 7.6.1 (LTS), Java 17, and bzlmod.
1 parent a969a91 commit 5221b85

File tree

24 files changed

+1501
-169
lines changed

24 files changed

+1501
-169
lines changed

.bazelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
build --cxxopt=-std=c++14 --host_cxxopt=-std=c++14
1+
build --cxxopt=-std=c++17 --host_cxxopt=-std=c++17

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.3.2
1+
7.6.1

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ build
55
local.properties
66
*.iml
77
/bazel-*
8+
MODULE.bazel.lock
9+
*/bin/*

MODULE.bazel

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
module(
2+
name = "com_github_grpc_grpc_kotlin",
3+
version = "2.1.0",
4+
)
5+
6+
bazel_dep(name = "protobuf", repo_name = "com_google_protobuf", version = "30.2")
7+
bazel_dep(name = "rules_kotlin", repo_name = "io_bazel_rules_kotlin", version = "2.1.3")
8+
bazel_dep(name = "rules_java", version = "8.11.0")
9+
bazel_dep(name = "rules_jvm_external", version = "6.7")
10+
bazel_dep(name = "grpc-java", repo_name = "io_grpc_grpc_java", version = "1.71.0")
11+
12+
maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
13+
maven.install(
14+
# Rerun whenever adding new artifacts.
15+
# $ REPIN=1 bazelisk run @maven//:pin
16+
artifacts = [
17+
"com.google.jimfs:jimfs:1.3.0",
18+
"com.google.truth:truth:1.4.2",
19+
"com.google.truth.extensions:truth-proto-extension:1.4.2",
20+
"com.google.protobuf:protobuf-java:4.30.2",
21+
"com.google.protobuf:protobuf-kotlin:4.30.2",
22+
"com.google.guava:guava:33.3.1-android",
23+
"com.squareup:kotlinpoet:1.14.2",
24+
"junit:junit:4.13.2",
25+
"org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.1",
26+
"org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.10.1",
27+
],
28+
fetch_sources = False,
29+
lock_file = "//:maven_install.json",
30+
generate_compat_repositories = True,
31+
strict_visibility = True,
32+
)
33+
use_repo(maven, "maven")

WORKSPACE

Lines changed: 0 additions & 70 deletions
This file was deleted.

build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ subprojects {
4040
version = rootProject.version
4141

4242
tasks.withType<JavaCompile> {
43-
sourceCompatibility = JavaVersion.VERSION_1_8.toString()
44-
targetCompatibility = JavaVersion.VERSION_1_8.toString()
43+
sourceCompatibility = JavaVersion.VERSION_17.toString()
44+
targetCompatibility = JavaVersion.VERSION_17.toString()
4545
}
4646

4747
tasks.withType<KotlinCompile> {
4848
kotlinOptions {
4949
freeCompilerArgs = listOf("-Xjsr305=strict")
50-
jvmTarget = JavaVersion.VERSION_1_8.toString()
50+
jvmTarget = JavaVersion.VERSION_17.toString()
5151
}
5252
}
5353

compiler/build.gradle.kts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ application {
1111
java {
1212
withSourcesJar()
1313
toolchain {
14-
languageVersion = JavaLanguageVersion.of(8)
14+
languageVersion = JavaLanguageVersion.of(17)
1515
}
1616
}
1717

@@ -34,7 +34,6 @@ dependencies {
3434
testImplementation(libs.jimfs)
3535
testImplementation(libs.protobuf.gradle.plugin)
3636
testImplementation(libs.protobuf.java)
37-
testImplementation(libs.mockito.kotlin)
3837
testImplementation(libs.junit.jupiter.engine)
3938
testImplementation(libs.mockito.core)
4039
}

compiler/src/main/java/io/grpc/kotlin/generator/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ kt_jvm_library(
1313
"//compiler/src/main/java/io/grpc/kotlin/generator/protoc",
1414
"//stub/src/main/java/io/grpc/kotlin:context",
1515
"//stub/src/main/java/io/grpc/kotlin:stub",
16-
"@com_google_guava_guava",
1716
"@com_google_protobuf//:protobuf_java",
1817
"@io_grpc_grpc_java//core",
18+
"@maven//:com_google_guava_guava",
1919
"@maven//:com_squareup_kotlinpoet",
2020
"@maven//:org_jetbrains_kotlinx_kotlinx_coroutines_core",
2121
],

compiler/src/main/java/io/grpc/kotlin/generator/protoc/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ kt_jvm_library(
1111
srcs = glob(["*.kt"]),
1212
deps = [
1313
"//compiler/src/main/java/io/grpc/kotlin/generator/protoc/util/graph",
14-
"@com_google_guava_guava",
1514
"@com_google_protobuf//:protobuf_java",
15+
"@maven//:com_google_guava_guava",
1616
"@maven//:com_squareup_kotlinpoet",
1717
],
1818
)

compiler/src/main/java/io/grpc/kotlin/generator/protoc/util/graph/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ kt_jvm_library(
1111
srcs = ["TopologicalSortGraph.kt"],
1212
deps = [
1313
"//compiler/src/main/java/io/grpc/kotlin/generator/protoc/util/sort",
14-
"@com_google_guava_guava//:com_google_guava_guava",
14+
"@maven//:com_google_guava_guava",
1515
],
1616
)

0 commit comments

Comments
 (0)