Skip to content

Commit 43dce9d

Browse files
authored
bumps and build cleanup (#377)
* version bumps * add test retry * bump coroutines
1 parent 5a7bbdb commit 43dce9d

File tree

17 files changed

+88
-129
lines changed

17 files changed

+88
-129
lines changed

build.gradle.kts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
55
plugins {
66
kotlin("jvm") version "1.6.21" apply false
77
id("com.google.protobuf") version "0.8.18" apply false
8-
8+
id("org.gradle.test-retry") version "1.5.2"
99
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
1010
}
1111

@@ -22,6 +22,7 @@ subprojects {
2222
plugin("java")
2323
plugin("org.jetbrains.kotlin.jvm")
2424
plugin("com.google.protobuf")
25+
plugin("org.gradle.test-retry")
2526
plugin("maven-publish")
2627
plugin("signing")
2728
}
@@ -48,8 +49,6 @@ subprojects {
4849

4950
tasks.withType<Test> {
5051
testLogging {
51-
showStandardStreams = true
52-
5352
// set options for log level LIFECYCLE
5453
events = setOf(
5554
TestLogEvent.FAILED,
@@ -59,6 +58,7 @@ subprojects {
5958
)
6059

6160
exceptionFormat = TestExceptionFormat.FULL
61+
showStandardStreams = true
6262
showExceptions = true
6363
showCauses = true
6464
showStackTraces = true
@@ -81,6 +81,10 @@ subprojects {
8181
info.exceptionFormat = debug.exceptionFormat
8282
}
8383

84+
retry {
85+
maxRetries.set(10)
86+
}
87+
8488
afterSuite(
8589
KotlinClosure2({ desc: TestDescriptor, result: TestResult ->
8690
if (desc.parent == null) { // will match the outermost suite

examples/android/build.gradle.kts

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,33 @@ plugins {
33
kotlin("android")
44
}
55

6-
val composeVersion = "1.1.1"
7-
val composeCompilerVersion = "1.2.0"
6+
val composeVersion = "1.4.3"
7+
val composeCompilerVersion = "1.4.7"
88

99
dependencies {
1010
implementation(project(":stub-android"))
11-
implementation(kotlin("stdlib"))
12-
implementation("androidx.activity:activity-compose:1.5.0")
13-
implementation("androidx.appcompat:appcompat:1.4.2")
14-
11+
implementation("androidx.activity:activity-compose:1.7.1")
1512
implementation("androidx.compose.foundation:foundation-layout:$composeVersion")
1613
implementation("androidx.compose.material:material:$composeVersion")
1714
implementation("androidx.compose.runtime:runtime:$composeVersion")
1815
implementation("androidx.compose.ui:ui:$composeVersion")
1916

20-
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:${rootProject.ext["coroutinesVersion"]}")
21-
2217
runtimeOnly("io.grpc:grpc-okhttp:${rootProject.ext["grpcVersion"]}")
2318
}
2419

25-
java {
26-
toolchain {
27-
languageVersion.set(JavaLanguageVersion.of(11))
28-
}
20+
kotlin {
21+
jvmToolchain(8)
2922
}
3023

3124
android {
32-
compileSdk = 31
33-
buildToolsVersion = "31.0.0"
25+
compileSdk = 33
26+
buildToolsVersion = "33.0.0"
27+
namespace = "io.grpc.examples.helloworld"
3428

3529
defaultConfig {
3630
applicationId = "io.grpc.examples.hello"
3731
minSdk = 26
38-
targetSdk = 31
32+
targetSdk = 33
3933
versionCode = 1
4034
versionName = "1.0"
4135

@@ -47,11 +41,6 @@ android {
4741
}
4842
}
4943

50-
compileOptions {
51-
sourceCompatibility = JavaVersion.VERSION_11
52-
targetCompatibility = JavaVersion.VERSION_11
53-
}
54-
5544
buildFeatures {
5645
compose = true
5746
}

examples/android/src/main/AndroidManifest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="io.grpc.examples.helloworld">
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
33

44
<uses-permission android:name="android.permission.INTERNET"/>
55

@@ -9,7 +9,6 @@
99
android:icon="@android:drawable/btn_star"
1010
android:label="@string/app_label">
1111
<activity
12-
android:theme="@style/Theme.AppCompat.NoActionBar"
1312
android:name="io.grpc.examples.helloworld.MainActivity"
1413
android:exported="true">
1514
<intent-filter>

examples/android/src/main/kotlin/io/grpc/examples/helloworld/MainActivity.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ package io.grpc.examples.helloworld
22

33
import android.net.Uri
44
import android.os.Bundle
5+
import androidx.activity.ComponentActivity
56
import androidx.activity.compose.setContent
6-
import androidx.appcompat.app.AppCompatActivity
77
import androidx.compose.foundation.layout.Arrangement
88
import androidx.compose.foundation.layout.Column
99
import androidx.compose.foundation.layout.fillMaxHeight
@@ -29,7 +29,7 @@ import kotlinx.coroutines.asExecutor
2929
import kotlinx.coroutines.launch
3030
import java.io.Closeable
3131

32-
class MainActivity : AppCompatActivity() {
32+
class MainActivity : ComponentActivity() {
3333

3434
private val uri by lazy { Uri.parse(resources.getString(R.string.server_url)) }
3535
private val greeterService by lazy { GreeterRCP(uri) }

examples/build.gradle.kts

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,32 @@
11
plugins {
2-
id("com.android.application") version "7.0.4" apply false // Older for IntelliJ Support
3-
id("com.google.protobuf") version "0.8.18" apply false
4-
kotlin("jvm") version "1.7.0" apply false
5-
id("org.jlleitschuh.gradle.ktlint") version "10.2.0"
2+
id("com.android.application") version "7.4.2" apply false // Older for IntelliJ Support
3+
id("com.google.protobuf") version "0.9.3" apply false
4+
kotlin("jvm") version "1.8.21" apply false
5+
id("org.jlleitschuh.gradle.ktlint") version "11.3.2"
66
}
77

88
// todo: move to subprojects, but how?
9-
ext["grpcVersion"] = "1.47.0"
9+
ext["grpcVersion"] = "1.54.1"
1010
ext["grpcKotlinVersion"] = "1.3.0" // CURRENT_GRPC_KOTLIN_VERSION
11-
ext["protobufVersion"] = "3.21.2"
12-
ext["coroutinesVersion"] = "1.6.2"
11+
ext["protobufVersion"] = "3.22.3"
12+
ext["coroutinesVersion"] = "1.7.0"
1313

1414
allprojects {
1515
repositories {
16-
mavenLocal()
16+
mavenLocal() // For testing new releases of gRPC Kotlin
1717
mavenCentral()
1818
google()
1919
}
2020

2121
apply(plugin = "org.jlleitschuh.gradle.ktlint")
22+
23+
ktlint {
24+
filter {
25+
exclude {
26+
it.file.path.contains("$buildDir/generated/")
27+
}
28+
}
29+
}
2230
}
2331

2432
tasks.create("assemble").dependsOn(":server:installDist")

examples/client/build.gradle.kts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@ plugins {
33
kotlin("jvm")
44
}
55

6-
java {
7-
toolchain {
8-
languageVersion.set(JavaLanguageVersion.of(11))
9-
}
6+
kotlin {
7+
jvmToolchain(8)
108
}
119

1210
dependencies {

examples/client/src/main/kotlin/io/grpc/examples/routeguide/RouteGuideClient.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class RouteGuideClient(private val channel: ManagedChannel) : Closeable {
111111
routeNote {
112112
message = "Last message"
113113
location = point(0, 0)
114-
},
114+
}
115115
)
116116
for (note in notes) {
117117
println("Sending message \"${note.message}\" at ${note.location.toStr()}")
1.29 KB
Binary file not shown.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
4+
networkTimeout=10000
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists

examples/gradlew

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
# Darwin, MinGW, and NonStop.
5656
#
5757
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
58+
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5959
# within the Gradle project.
6060
#
6161
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -80,13 +80,10 @@ do
8080
esac
8181
done
8282

83-
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
84-
85-
APP_NAME="Gradle"
83+
# This is normally unused
84+
# shellcheck disable=SC2034
8685
APP_BASE_NAME=${0##*/}
87-
88-
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
89-
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
86+
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
9087

9188
# Use the maximum available, or set MAX_FD != -1 to use that value.
9289
MAX_FD=maximum
@@ -143,12 +140,16 @@ fi
143140
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144141
case $MAX_FD in #(
145142
max*)
143+
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
144+
# shellcheck disable=SC3045
146145
MAX_FD=$( ulimit -H -n ) ||
147146
warn "Could not query maximum file descriptor limit"
148147
esac
149148
case $MAX_FD in #(
150149
'' | soft) :;; #(
151150
*)
151+
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
152+
# shellcheck disable=SC3045
152153
ulimit -n "$MAX_FD" ||
153154
warn "Could not set maximum file descriptor limit to $MAX_FD"
154155
esac
@@ -193,6 +194,10 @@ if "$cygwin" || "$msys" ; then
193194
done
194195
fi
195196

197+
198+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
199+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
200+
196201
# Collect all arguments for the java command;
197202
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
198203
# shell script including quotes and variable substitutions, so put them in

examples/gradlew.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal
2626

2727
set DIRNAME=%~dp0
2828
if "%DIRNAME%"=="" set DIRNAME=.
29+
@rem This is normally unused
2930
set APP_BASE_NAME=%~n0
3031
set APP_HOME=%DIRNAME%
3132

examples/native-client/build.gradle.kts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ plugins {
44
id("com.palantir.graal") version "0.12.0"
55
}
66

7-
java {
8-
toolchain {
9-
languageVersion.set(JavaLanguageVersion.of(11))
10-
}
7+
kotlin {
8+
jvmToolchain(11)
119
}
1210

1311
dependencies {
@@ -24,7 +22,7 @@ application {
2422
// 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
2523

2624
graal {
27-
graalVersion("22.1.0")
25+
graalVersion("22.3.2")
2826
javaVersion("11")
2927
mainClass(application.mainClass.get())
3028
outputName("hello-world")

examples/server/build.gradle.kts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@ plugins {
33
kotlin("jvm")
44
}
55

6-
java {
7-
toolchain {
8-
languageVersion.set(JavaLanguageVersion.of(11))
9-
}
6+
kotlin {
7+
jvmToolchain(8)
108
}
119

1210
dependencies {

examples/stub-android/build.gradle.kts

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
import com.google.protobuf.gradle.generateProtoTasks
2-
import com.google.protobuf.gradle.id
3-
import com.google.protobuf.gradle.plugins
4-
import com.google.protobuf.gradle.protobuf
5-
import com.google.protobuf.gradle.protoc
6-
71
plugins {
82
id("com.android.library")
93
kotlin("android")
@@ -13,28 +7,26 @@ plugins {
137
dependencies {
148
protobuf(project(":protos"))
159

16-
api(kotlin("stdlib-jdk8"))
17-
api("org.jetbrains.kotlinx:kotlinx-coroutines-android:${rootProject.ext["coroutinesVersion"]}")
10+
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:${rootProject.ext["coroutinesVersion"]}")
1811

1912
api("io.grpc:grpc-stub:${rootProject.ext["grpcVersion"]}")
2013
api("io.grpc:grpc-protobuf-lite:${rootProject.ext["grpcVersion"]}")
2114
api("io.grpc:grpc-kotlin-stub:${rootProject.ext["grpcKotlinVersion"]}")
2215
api("com.google.protobuf:protobuf-kotlin-lite:${rootProject.ext["protobufVersion"]}")
2316
}
2417

25-
android {
26-
compileSdk = 31
27-
buildToolsVersion = "31.0.0"
18+
kotlin {
19+
jvmToolchain(8)
20+
}
2821

29-
compileOptions {
30-
sourceCompatibility = JavaVersion.VERSION_11
31-
targetCompatibility = JavaVersion.VERSION_11
32-
}
22+
android {
23+
compileSdk = 33
24+
buildToolsVersion = "33.0.0"
25+
namespace = "io.grpc.examples.stublite"
3326
}
3427

3528
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().all {
3629
kotlinOptions {
37-
jvmTarget = JavaVersion.VERSION_11.toString()
3830
freeCompilerArgs = listOf("-opt-in=kotlin.RequiresOptIn")
3931
}
4032
}
@@ -44,31 +36,31 @@ protobuf {
4436
artifact = "com.google.protobuf:protoc:${rootProject.ext["protobufVersion"]}"
4537
}
4638
plugins {
47-
id("java") {
39+
create("java") {
4840
artifact = "io.grpc:protoc-gen-grpc-java:${rootProject.ext["grpcVersion"]}"
4941
}
50-
id("grpc") {
42+
create("grpc") {
5143
artifact = "io.grpc:protoc-gen-grpc-java:${rootProject.ext["grpcVersion"]}"
5244
}
53-
id("grpckt") {
45+
create("grpckt") {
5446
artifact = "io.grpc:protoc-gen-grpc-kotlin:${rootProject.ext["grpcKotlinVersion"]}:jdk8@jar"
5547
}
5648
}
5749
generateProtoTasks {
5850
all().forEach {
5951
it.plugins {
60-
id("java") {
52+
create("java") {
6153
option("lite")
6254
}
63-
id("grpc") {
55+
create("grpc") {
6456
option("lite")
6557
}
66-
id("grpckt") {
58+
create("grpckt") {
6759
option("lite")
6860
}
6961
}
7062
it.builtins {
71-
id("kotlin") {
63+
create("kotlin") {
7264
option("lite")
7365
}
7466
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest package="io.grpc.examples.stublite" />
2+
<manifest />

0 commit comments

Comments
 (0)