diff --git a/build.gradle.kts b/build.gradle.kts index 252cd14a..5c63759a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,14 +3,14 @@ import org.gradle.api.tasks.testing.logging.TestLogEvent import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { - kotlin("jvm") version "1.9.10" apply false + kotlin("jvm") version "1.8.0" apply false id("com.google.protobuf") version "0.9.4" apply false id("org.gradle.test-retry") version "1.5.5" id("io.github.gradle-nexus.publish-plugin") version "1.3.0" } group = "io.grpc" -version = "1.3.1" // CURRENT_GRPC_KOTLIN_VERSION +version = "1.4.0" // CURRENT_GRPC_KOTLIN_VERSION ext["grpcVersion"] = "1.57.2" ext["protobufVersion"] = "3.24.1" diff --git a/compiler/build.gradle.kts b/compiler/build.gradle.kts index 47b654a9..275a4e83 100644 --- a/compiler/build.gradle.kts +++ b/compiler/build.gradle.kts @@ -19,11 +19,11 @@ dependencies { // Misc implementation(kotlin("reflect")) implementation("com.squareup:kotlinpoet:1.14.2") - implementation("com.google.truth:truth:1.1.3") + implementation("com.google.truth:truth:1.1.5") // Testing testImplementation("junit:junit:4.13.2") - testImplementation("com.google.guava:guava:29.0-jre") + testImplementation("com.google.guava:guava:32.1.2-jre") testImplementation("com.google.jimfs:jimfs:1.3.0") testImplementation("com.google.protobuf:protobuf-gradle-plugin:0.9.4") testImplementation("com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0") diff --git a/compiler/src/main/java/io/grpc/kotlin/generator/protoc/testing/DeclarationsSubject.kt b/compiler/src/main/java/io/grpc/kotlin/generator/protoc/testing/DeclarationsSubject.kt index 60ca4209..eaf02581 100644 --- a/compiler/src/main/java/io/grpc/kotlin/generator/protoc/testing/DeclarationsSubject.kt +++ b/compiler/src/main/java/io/grpc/kotlin/generator/protoc/testing/DeclarationsSubject.kt @@ -32,12 +32,12 @@ fun assertThat(declarations: Declarations): DeclarationsSubject = /** A Truth subject for [Declarations]. */ class DeclarationsSubject( failureMetadata: FailureMetadata, - private val actual: Declarations + private val actual: Declarations? ) : Subject(failureMetadata, actual) { fun generatesTopLevel(indentedCode: String) { val actualCode = FileSpec.builder("", "MyDeclarations.kt") - .apply { actual.writeOnlyTopLevel(this) } + .apply { actual?.writeOnlyTopLevel(this) } .build() check("topLevel").about(fileSpecs).that(actualCode).generates(indentedCode) } @@ -45,7 +45,7 @@ class DeclarationsSubject( fun generatesEnclosed(indentedCode: String) { val actualCode = FileSpec.builder("", "MyDeclarations.kt") - .apply { actual.writeToEnclosingFile(this) } + .apply { actual?.writeToEnclosingFile(this) } .build() check("enclosed").about(fileSpecs).that(actualCode).generates(indentedCode) } @@ -53,22 +53,22 @@ class DeclarationsSubject( fun generatesNoTopLevelMembers() { val actualCode = FileSpec.builder("", "MyDeclarations.kt") - .apply { actual.writeOnlyTopLevel(this) } + .apply { actual?.writeOnlyTopLevel(this) } .build() check("topLevel") .withMessage("top level declarations: %s", actualCode) - .that(actual.hasTopLevelDeclarations) + .that(actual?.hasTopLevelDeclarations) .isFalse() } fun generatesNoEnclosedMembers() { val actualCode = FileSpec.builder("", "MyDeclarations.kt") - .apply { actual.writeToEnclosingFile(this) } + .apply { actual?.writeToEnclosingFile(this) } .build() check("enclosed") .withMessage("enclosed declarations: %s", actualCode) - .that(actual.hasEnclosingScopeDeclarations) + .that(actual?.hasEnclosingScopeDeclarations) .isFalse() } } diff --git a/compiler/src/main/java/io/grpc/kotlin/generator/protoc/testing/FileSpecSubject.kt b/compiler/src/main/java/io/grpc/kotlin/generator/protoc/testing/FileSpecSubject.kt index c45f0833..af65122b 100644 --- a/compiler/src/main/java/io/grpc/kotlin/generator/protoc/testing/FileSpecSubject.kt +++ b/compiler/src/main/java/io/grpc/kotlin/generator/protoc/testing/FileSpecSubject.kt @@ -29,7 +29,7 @@ fun assertThat(fileSpec: FileSpec): FileSpecSubject = assertAbout(fileSpecs).tha /** A Truth subject for [FileSpec]. */ class FileSpecSubject( failureMetadata: FailureMetadata, - private val actual: FileSpec + private val actual: FileSpec? ) : Subject(failureMetadata, actual) { fun generates(indentedCode: String) { val expectedCode = indentedCode.trimIndent() @@ -38,6 +38,6 @@ class FileSpecSubject( } fun hasName(name: String) { - check("name").that(actual.name).isEqualTo(name) + check("name").that(actual?.name).isEqualTo(name) } } diff --git a/compiler/src/main/java/io/grpc/kotlin/generator/protoc/testing/FunSpecSubject.kt b/compiler/src/main/java/io/grpc/kotlin/generator/protoc/testing/FunSpecSubject.kt index 38af3c5b..9018a5c8 100644 --- a/compiler/src/main/java/io/grpc/kotlin/generator/protoc/testing/FunSpecSubject.kt +++ b/compiler/src/main/java/io/grpc/kotlin/generator/protoc/testing/FunSpecSubject.kt @@ -29,7 +29,7 @@ fun assertThat(funSpec: FunSpec): FunSpecSubject = Truth.assertAbout(funSpecs).t /** A Truth subject for [FunSpec]. */ class FunSpecSubject( failureMetadata: FailureMetadata, - private val actual: FunSpec + private val actual: FunSpec? ) : Subject(failureMetadata, actual) { fun generates(indentedCode: String) { val expectedCode = indentedCode.trimIndent() diff --git a/compiler/src/main/java/io/grpc/kotlin/generator/protoc/testing/TypeSpecSubject.kt b/compiler/src/main/java/io/grpc/kotlin/generator/protoc/testing/TypeSpecSubject.kt index 2d7e7a60..6988b73f 100644 --- a/compiler/src/main/java/io/grpc/kotlin/generator/protoc/testing/TypeSpecSubject.kt +++ b/compiler/src/main/java/io/grpc/kotlin/generator/protoc/testing/TypeSpecSubject.kt @@ -29,7 +29,7 @@ fun assertThat(typeSpec: TypeSpec): TypeSpecSubject = assertAbout(typeSpecs).tha /** A Truth subject for [TypeSpec]. */ class TypeSpecSubject( failureMetadata: FailureMetadata, - private val actual: TypeSpec + private val actual: TypeSpec? ) : Subject(failureMetadata, actual) { fun generates(indentedCode: String) { val expectedCode = indentedCode.trimIndent() diff --git a/compiler/src/test/java/io/grpc/kotlin/generator/protoc/testing/DeclarationsSubjectTest.kt b/compiler/src/test/java/io/grpc/kotlin/generator/protoc/testing/DeclarationsSubjectTest.kt index f87efbfa..9c830cb8 100644 --- a/compiler/src/test/java/io/grpc/kotlin/generator/protoc/testing/DeclarationsSubjectTest.kt +++ b/compiler/src/test/java/io/grpc/kotlin/generator/protoc/testing/DeclarationsSubjectTest.kt @@ -16,7 +16,6 @@ package io.grpc.kotlin.generator.protoc.testing -import com.google.common.truth.ExpectFailure.SimpleSubjectBuilderCallback import com.google.common.truth.ExpectFailure.expectFailureAbout import com.squareup.kotlinpoet.INT import com.squareup.kotlinpoet.PropertySpec diff --git a/examples/build.gradle.kts b/examples/build.gradle.kts index a1421434..5a79c0a3 100644 --- a/examples/build.gradle.kts +++ b/examples/build.gradle.kts @@ -2,12 +2,12 @@ plugins { id("com.android.application") version "8.1.1" apply false id("com.google.protobuf") version "0.9.4" apply false kotlin("jvm") version "1.9.10" apply false - id("org.jlleitschuh.gradle.ktlint") version "11.5.1" apply false + id("org.jlleitschuh.gradle.ktlint") version "11.6.0" apply false } // todo: move to subprojects, but how? ext["grpcVersion"] = "1.57.2" -ext["grpcKotlinVersion"] = "1.3.1" // CURRENT_GRPC_KOTLIN_VERSION +ext["grpcKotlinVersion"] = "1.4.0" // CURRENT_GRPC_KOTLIN_VERSION ext["protobufVersion"] = "3.24.1" ext["coroutinesVersion"] = "1.7.3" diff --git a/interop_testing/build.gradle.kts b/interop_testing/build.gradle.kts index a4e5190a..6f362b09 100644 --- a/interop_testing/build.gradle.kts +++ b/interop_testing/build.gradle.kts @@ -20,7 +20,7 @@ dependencies { implementation("com.google.protobuf:protobuf-java:${rootProject.ext["protobufVersion"]}") - implementation("com.google.truth:truth:1.1.3") + implementation("com.google.truth:truth:1.1.5") testImplementation("org.mockito:mockito-core:4.11.0") testImplementation("com.squareup.okhttp:okhttp:2.7.5") { diff --git a/stub/build.gradle.kts b/stub/build.gradle.kts index 66ffaf03..1e4ea4d6 100644 --- a/stub/build.gradle.kts +++ b/stub/build.gradle.kts @@ -85,12 +85,12 @@ tasks.withType().configureEach { reportUndocumented.set(true) externalDocumentationLink( - url = URL("https://grpc.github.io/grpc-java/javadoc/") - //packageListUrl = "https://grpc.github.io/grpc-java/javadoc/package-list" + url = "https://grpc.github.io/grpc-java/javadoc/", + packageListUrl = "https://grpc.github.io/grpc-java/javadoc/element-list" ) externalDocumentationLink( - url = URL("https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/") + url = "https://kotlinlang.org/api/kotlinx.coroutines/" ) perPackageOption {