Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

version bumps and related fixes #417

Merged
merged 5 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build --cxxopt=-std=c++14 --host_cxxopt=-std=c++14
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.1.0
6.3.2
6 changes: 3 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ load(
# Maven
maven_install(
artifacts = [
"com.google.jimfs:jimfs:1.1",
"com.google.truth.extensions:truth-proto-extension:1.0.1",
"com.google.protobuf:protobuf-kotlin:3.18.0",
"com.google.jimfs:jimfs:1.3.0",
"com.google.truth.extensions:truth-proto-extension:1.1.3",
"com.google.protobuf:protobuf-kotlin:3.24.1",
] + IO_GRPC_GRPC_KOTLIN_ARTIFACTS + IO_GRPC_GRPC_JAVA_ARTIFACTS,
override_targets = dict(
IO_GRPC_GRPC_KOTLIN_OVERRIDE_TARGETS.items() +
Expand Down
20 changes: 8 additions & 12 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm") version "1.6.21" 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.46.0"
ext["protobufVersion"] = "3.20.1"
ext["coroutinesVersion"] = "1.6.2"
ext["grpcVersion"] = "1.57.2"
ext["protobufVersion"] = "3.24.1"
ext["coroutinesVersion"] = "1.7.3"

subprojects {

Expand Down Expand Up @@ -134,11 +134,7 @@ subprojects {
}
}

nexusPublishing {
repositories {
sonatype {
username.set(System.getenv("SONATYPE_USERNAME"))
password.set(System.getenv("SONATYPE_PASSWORD"))
}
}
nexusPublishing.repositories.sonatype {
username.set(System.getenv("SONATYPE_USERNAME"))
password.set(System.getenv("SONATYPE_PASSWORD"))
}
6 changes: 3 additions & 3 deletions compiler/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ dependencies {

// Misc
implementation(kotlin("reflect"))
implementation("com.squareup:kotlinpoet:1.11.0")
implementation("com.google.truth:truth:1.1.3")
implementation("com.squareup:kotlinpoet:1.14.2")
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 @@ -58,11 +58,10 @@ class DeclarationsTest {
package com.foo.bar

import kotlin.Int
import kotlin.Unit

public val someProperty: Int

public fun someFunction(): Unit {
public fun someFunction() {
}
""".trimIndent()
)
Expand Down Expand Up @@ -111,10 +110,8 @@ class DeclarationsTest {
"""
package com.foo.bar

import kotlin.Unit

public object SomeObject {
public fun someFunction(): Unit {
public fun someFunction() {
}
}
""".trimIndent()
Expand Down Expand Up @@ -172,9 +169,7 @@ class DeclarationsTest {
assertThat(decls)
.generatesTopLevel(
"""
import kotlin.Unit

public fun someFunction(): Unit {
public fun someFunction() {
}
"""
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ class GeneratorConfigTest {
"""
package com.google

import kotlin.Unit

public fun fooBar(): Unit {
public fun fooBar() {
}
""".trimIndent()
)
Expand All @@ -77,9 +75,7 @@ class GeneratorConfigTest {
"""
package com.google

import kotlin.Unit

public inline fun fooBar(): Unit {
public inline fun fooBar() {
}
""".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
2 changes: 1 addition & 1 deletion compiler/src/test/proto/helloworld/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package(default_visibility = ["//compiler/src/test:__subpackages__"])
proto_library(
name = "hello_world_proto",
srcs = ["helloworld.proto"],
strip_import_prefix = "//compiler/src/test/proto",
strip_import_prefix = "/compiler/src/test/proto",
)

java_proto_library(
Expand Down
18 changes: 9 additions & 9 deletions compiler/src/test/proto/testing/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package(default_visibility = ["//compiler/src/test:__subpackages__"])
proto_library(
name = "example3_proto",
srcs = ["example3.proto"],
strip_import_prefix = "//compiler/src/test/proto",
strip_import_prefix = "/compiler/src/test/proto",
deps = ["@com_google_protobuf//:wrappers_proto"],
)

Expand All @@ -21,7 +21,7 @@ java_proto_library(
proto_library(
name = "has_explicit_outer_class_name_proto",
srcs = ["has_explicit_outer_class_name.proto"],
strip_import_prefix = "//compiler/src/test/proto",
strip_import_prefix = "/compiler/src/test/proto",
)

java_proto_library(
Expand All @@ -32,7 +32,7 @@ java_proto_library(
proto_library(
name = "has_nested_class_name_conflict_proto",
srcs = ["has_nested_class_name_conflict.proto"],
strip_import_prefix = "//compiler/src/test/proto",
strip_import_prefix = "/compiler/src/test/proto",
)

java_proto_library(
Expand All @@ -43,7 +43,7 @@ java_proto_library(
proto_library(
name = "has_outer_class_name_conflict_proto",
srcs = ["has_outer_class_name_conflict.proto"],
strip_import_prefix = "//compiler/src/test/proto",
strip_import_prefix = "/compiler/src/test/proto",
)

java_proto_library(
Expand All @@ -54,7 +54,7 @@ java_proto_library(
proto_library(
name = "implicit_java_package_proto",
srcs = ["implicit_java_package.proto"],
strip_import_prefix = "//compiler/src/test/proto",
strip_import_prefix = "/compiler/src/test/proto",
)

java_proto_library(
Expand All @@ -65,7 +65,7 @@ java_proto_library(
proto_library(
name = "proto-file-with-hyphen_proto",
srcs = ["proto-file-with-hyphen.proto"],
strip_import_prefix = "//compiler/src/test/proto",
strip_import_prefix = "/compiler/src/test/proto",
)

java_proto_library(
Expand All @@ -76,7 +76,7 @@ java_proto_library(
proto_library(
name = "service_name_conflicts_with_file_proto",
srcs = ["service_name_conflicts_with_file.proto"],
strip_import_prefix = "//compiler/src/test/proto",
strip_import_prefix = "/compiler/src/test/proto",
)

java_proto_library(
Expand All @@ -87,7 +87,7 @@ java_proto_library(
proto_library(
name = "service_t_proto",
srcs = ["serviceT.proto"],
strip_import_prefix = "//compiler/src/test/proto",
strip_import_prefix = "/compiler/src/test/proto",
)

java_proto_library(
Expand All @@ -98,7 +98,7 @@ java_proto_library(
proto_library(
name = "test_proto3_optional",
srcs = ["test_proto3_optional.proto"],
strip_import_prefix = "//compiler/src/test/proto",
strip_import_prefix = "/compiler/src/test/proto",
)

java_proto_library(
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
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading
Loading