Skip to content

Commit

Permalink
Merge branch 'master' into kt_jvm_proto_helper
Browse files Browse the repository at this point in the history
  • Loading branch information
steineldar committed Aug 31, 2023
2 parents f3aadf5 + 7aea0e9 commit 5c6c35c
Show file tree
Hide file tree
Showing 20 changed files with 159 additions and 60 deletions.
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2
updates:
- package-ecosystem: "gradle"
directory: "/"
schedule:
interval: "daily"

- package-ecosystem: "gradle"
directory: "/examples"
schedule:
interval: "daily"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
4 changes: 2 additions & 2 deletions .github/workflows/bazel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ jobs:
bazel:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- name: Mount bazel cache
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: "/home/runner/.cache/bazel"
key: bazel
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
java: ['8', '11']
java: ['8', '11', '17']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/setup-java@v2
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
Expand All @@ -33,13 +33,13 @@ jobs:
run: ./gradlew publishToMavenLocal

- name: Build Examples
if: matrix.java == '11'
if: matrix.java == '17'
run: ./gradlew build
working-directory: ./examples

- id: test-data
name: Run HelloWorld
if: matrix.java == '11'
if: matrix.java == '17'
working-directory: ./examples
run: |-
./gradlew :server:HelloWorldServer &
Expand All @@ -48,7 +48,7 @@ jobs:
echo "stdout=${OUTPUT//$'\n'/'%0A'}" >> $GITHUB_OUTPUT
- name: Test HelloWorld
if: matrix.java == '11'
if: matrix.java == '17'
uses: nick-invision/assert-action@v1
with:
expected: "Received: Hello world"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/gradle_arm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:
gradle_arm:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2.1.0
- uses: actions/checkout@v3
- name: test_on_arm
continue-on-error: true
uses: uraimo/run-on-arch-action@v2.0.5
uses: uraimo/run-on-arch-action@v2.5.1
with:
arch: aarch64
distro: ubuntu18.04
Expand All @@ -29,7 +29,7 @@ jobs:
./gradlew --console=plain build
- name: test_on_arm_retry
if: steps.test_on_arm.outcome=='failure'
uses: uraimo/run-on-arch-action@v2.0.5
uses: uraimo/run-on-arch-action@v2.5.1
with:
arch: aarch64
distro: ubuntu18.04
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3

- uses: actions/setup-java@v2
- uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '8'
Expand Down
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
## Change Log

### 1.3.1

#### Changes

* bump coroutines to 1.6.2 by @jamesward in https://github.com/grpc/grpc-kotlin/pull/340
* bump versions by @jamesward in https://github.com/grpc/grpc-kotlin/pull/346
* Support generating lite protos with Bazel by @Kernald in https://github.com/grpc/grpc-kotlin/pull/350
* Recover cancellation when close responses flow by @akandratovich in https://github.com/grpc/grpc-kotlin/pull/344
* Fixed Examples by Updating to Gradle 7.5.1 and Java 11 by @handstandsam in https://github.com/grpc/grpc-kotlin/pull/362
* Provide action mnemonics for kt_jvm_proto_library implementation. by @plobsing in https://github.com/grpc/grpc-kotlin/pull/368
* Migrate run command to work on a windows machine by @jlyon12345 in https://github.com/grpc/grpc-kotlin/pull/375
* Enable sourceSets in the stub example project by @nkhoshini in https://github.com/grpc/grpc-kotlin/pull/376
* bumps and build cleanup by @jamesward in https://github.com/grpc/grpc-kotlin/pull/377
* add foojar resolver convention plugin - fixes #391 by @jamesward in https://github.com/grpc/grpc-kotlin/pull/392
* [README][fix] Adding missing character on readme by @andrsGutirrz in https://github.com/grpc/grpc-kotlin/pull/393
* Replace deprecated command with environment file by @jongwooo in https://github.com/grpc/grpc-kotlin/pull/395
* fix(ServerCalls): Ensure failure cause is propagated in Status to interceptors by @zakhenry in https://github.com/grpc/grpc-kotlin/pull/400

## New Contributors
* @akandratovich made their first contribution in https://github.com/grpc/grpc-kotlin/pull/344
* @handstandsam made their first contribution in https://github.com/grpc/grpc-kotlin/pull/362
* @plobsing made their first contribution in https://github.com/grpc/grpc-kotlin/pull/368
* @jlyon12345 made their first contribution in https://github.com/grpc/grpc-kotlin/pull/375
* @nkhoshini made their first contribution in https://github.com/grpc/grpc-kotlin/pull/376
* @andrsGutirrz made their first contribution in https://github.com/grpc/grpc-kotlin/pull/393
* @jongwooo made their first contribution in https://github.com/grpc/grpc-kotlin/pull/395
* @zakhenry made their first contribution in https://github.com/grpc/grpc-kotlin/pull/400

**Full Changelog**: https://github.com/grpc/grpc-kotlin/compare/v1.3.0...v1.3.1

### 1.3.0

#### Changes
Expand Down
8 changes: 4 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm") version "1.6.21" apply false
id("com.google.protobuf") version "0.8.18" apply false
id("org.gradle.test-retry") version "1.5.2"
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
id("com.google.protobuf") version "0.9.4" apply false
id("org.gradle.test-retry") version "1.5.4"
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
}

group = "io.grpc"
version = "1.3.0" // CURRENT_GRPC_KOTLIN_VERSION
version = "1.3.1" // CURRENT_GRPC_KOTLIN_VERSION

ext["grpcVersion"] = "1.46.0"
ext["protobufVersion"] = "3.20.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 @@ -24,10 +24,10 @@ dependencies {
// Testing
testImplementation("junit:junit:4.13.2")
testImplementation("com.google.guava:guava:29.0-jre")
testImplementation("com.google.jimfs:jimfs:1.2")
testImplementation("com.google.jimfs:jimfs:1.3.0")
testImplementation("com.google.protobuf:protobuf-gradle-plugin:0.8.18")
testImplementation("com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0")
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.8.2")
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.10.0")
testImplementation("org.mockito:mockito-core:4.5.1")
}

Expand Down
12 changes: 6 additions & 6 deletions examples/android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ plugins {
kotlin("android")
}

val composeVersion = "1.4.3"
val composeCompilerVersion = "1.4.7"
val composeVersion = "1.5.0"
val composeCompilerVersion = "1.5.3"

dependencies {
implementation(project(":stub-android"))
implementation("androidx.activity:activity-compose:1.7.1")
implementation("androidx.activity:activity-compose:1.7.2")
implementation("androidx.compose.foundation:foundation-layout:$composeVersion")
implementation("androidx.compose.material:material:$composeVersion")
implementation("androidx.compose.runtime:runtime:$composeVersion")
Expand All @@ -22,14 +22,14 @@ kotlin {
}

android {
compileSdk = 33
buildToolsVersion = "33.0.0"
compileSdk = 34
buildToolsVersion = "34.0.0"
namespace = "io.grpc.examples.helloworld"

defaultConfig {
applicationId = "io.grpc.examples.hello"
minSdk = 26
targetSdk = 33
targetSdk = 34
versionCode = 1
versionName = "1.0"

Expand Down
22 changes: 11 additions & 11 deletions examples/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
plugins {
id("com.android.application") version "7.4.2" apply false // Older for IntelliJ Support
id("com.google.protobuf") version "0.9.3" apply false
kotlin("jvm") version "1.8.21" apply false
id("org.jlleitschuh.gradle.ktlint") version "11.3.2"
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
}

// todo: move to subprojects, but how?
ext["grpcVersion"] = "1.54.1"
ext["grpcKotlinVersion"] = "1.3.0" // CURRENT_GRPC_KOTLIN_VERSION
ext["protobufVersion"] = "3.22.3"
ext["coroutinesVersion"] = "1.7.0"
ext["grpcVersion"] = "1.57.2"
ext["grpcKotlinVersion"] = "1.3.1" // CURRENT_GRPC_KOTLIN_VERSION
ext["protobufVersion"] = "3.24.1"
ext["coroutinesVersion"] = "1.7.3"

allprojects {
subprojects {
repositories {
mavenLocal() // For testing new releases of gRPC Kotlin
mavenCentral()
Expand All @@ -20,10 +20,10 @@ allprojects {

apply(plugin = "org.jlleitschuh.gradle.ktlint")

ktlint {
configure<org.jlleitschuh.gradle.ktlint.KtlintExtension> {
filter {
exclude {
it.file.path.contains("$buildDir/generated/")
it.file.path.startsWith(project.layout.buildDirectory.get().dir("generated").toString())
}
}
}
Expand Down
Binary file modified examples/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion examples/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.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
8 changes: 6 additions & 2 deletions examples/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -130,10 +131,13 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
Expand Down
5 changes: 2 additions & 3 deletions examples/native-client/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,15 @@ application {

// todo: add graalvm-config-create task
// ./gradlew :native-client:install
// JAVA_HOME=~/.gradle/caches/com.palantir.graal/22.1.0/11/graalvm-ce-java11-22.1.0 JAVA_OPTS=-agentlib:native-image-agent=config-output-dir=native-client/src/graal native-client/build/install/native-client/bin/native-client
// JAVA_HOME=~/.gradle/caches/com.palantir.graal/22.3.3/11/graalvm-ce-java11-22.3.3 JAVA_OPTS=-agentlib:native-image-agent=config-output-dir=native-client/src/main/resources/META-INF/native-image native-client/build/install/native-client/bin/native-client

graal {
graalVersion("22.3.2")
graalVersion("22.3.3")
javaVersion("11")
mainClass(application.mainClass.get())
outputName("hello-world")
option("--verbose")
option("--no-fallback")
option("-H:+ReportExceptionStackTraces")
option("-H:+PrintClassInitialization")
option("-H:ReflectionConfigurationFiles=src/graal/reflect-config.json")
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,17 @@
"queryAllPublicConstructors":true,
"methods":[
{"name":"<init>","parameterTypes":[] },
{"name":"add","parameterTypes":["long"] }
],
"queriedMethods":[{"name":"sum","parameterTypes":[] }]
{"name":"add","parameterTypes":["long"] },
{"name":"sum","parameterTypes":[] }
]
},
{
"name":"javax.naming.directory.InitialDirContext"
},
{
"name":"kotlin.internal.jdk8.JDK8PlatformImplementations",
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"sun.misc.Unsafe",
"allDeclaredFields":true,
"queriedMethods":[
"methods":[
{"name":"arrayBaseOffset","parameterTypes":["java.lang.Class"] },
{"name":"arrayIndexScale","parameterTypes":["java.lang.Class"] },
{"name":"copyMemory","parameterTypes":["long","long","long"] },
Expand Down
2 changes: 1 addition & 1 deletion examples/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ pluginManagement {
}

plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.5.0"
id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0"
}
4 changes: 2 additions & 2 deletions examples/stub-android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ kotlin {
}

android {
compileSdk = 33
buildToolsVersion = "33.0.0"
compileSdk = 34
buildToolsVersion = "34.0.0"
namespace = "io.grpc.examples.stublite"
}

Expand Down
6 changes: 3 additions & 3 deletions stub/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import org.jetbrains.dokka.gradle.DokkaTask
import java.net.URL

plugins {
id("org.jetbrains.dokka") version "1.6.21"
id("org.jetbrains.dokka") version "1.8.20"
}

repositories {
Expand All @@ -27,9 +27,9 @@ dependencies {

// Testing
testImplementation("junit:junit:4.13.2")
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.8.2")
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.10.0")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-debug:${rootProject.ext["coroutinesVersion"]}")
testImplementation("com.google.truth.extensions:truth-proto-extension:1.1.3")
testImplementation("com.google.truth.extensions:truth-proto-extension:1.1.5")
testImplementation("io.grpc:grpc-protobuf:${rootProject.ext["grpcVersion"]}")
testImplementation("io.grpc:grpc-testing:${rootProject.ext["grpcVersion"]}") // gRCP testing utilities
}
Expand Down
2 changes: 1 addition & 1 deletion stub/src/main/java/io/grpc/kotlin/ServerCalls.kt
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ object ServerCalls {
val closeStatus = when (failure) {
null -> Status.OK
is CancellationException -> Status.CANCELLED.withCause(failure)
else -> Status.fromThrowable(failure)
else -> Status.fromThrowable(failure).withCause(failure)
}
val trailers = failure?.let { Status.trailersFromThrowable(it) } ?: GrpcMetadata()
mutex.withLock { call.close(closeStatus, trailers) }
Expand Down
Loading

0 comments on commit 5c6c35c

Please sign in to comment.