Skip to content

Commit

Permalink
more bumps and associated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesward committed Sep 25, 2023
1 parent 95a1ad2 commit da56686
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 22 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions compiler/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,43 +32,43 @@ 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)
}

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)
}

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()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -38,6 +38,6 @@ class FileSpecSubject(
}

fun hasName(name: String) {
check("name").that(actual.name).isEqualTo(name)
check("name").that(actual?.name).isEqualTo(name)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion interop_testing/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down
6 changes: 3 additions & 3 deletions stub/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ tasks.withType<DokkaTask>().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 {
Expand Down

0 comments on commit da56686

Please sign in to comment.