From b4a7d565382205a74de0410e2ffe02c5ef82763a Mon Sep 17 00:00:00 2001 From: "Philip K. Warren" Date: Mon, 9 Oct 2023 13:18:03 -0500 Subject: [PATCH 1/2] Update dependencies and fix javadoc artifacts Update to the latest versions of spotless, android libraries, and the Maven plugin. Fix javadoc generation for Maven artifacts (previously empty). --- build.gradle.kts | 24 +++++++++++-------- examples/android/build.gradle.kts | 4 ++-- extensions/google-java/build.gradle.kts | 4 ++-- extensions/google-javalite/build.gradle.kts | 4 ++-- gradle/libs.versions.toml | 6 ++--- library/build.gradle.kts | 6 ++--- okhttp/build.gradle.kts | 4 ++-- protoc-gen-connect-kotlin/build.gradle.kts | 4 ++-- .../protocgen/connect/internal/Parameters.kt | 3 ++- 9 files changed, 32 insertions(+), 27 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index b29b3171..592a79fb 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -51,11 +51,23 @@ allprojects { spotless { isEnforceCheck = false // Disables lint on gradle builds. kotlin { - ktlint().editorConfigOverride(mapOf("ktlint_experimental" to "enabled")) + ktlint().editorConfigOverride( + mapOf( + "ktlint_experimental" to "enabled", + // Disabled until https://github.com/pinterest/ktlint/pull/2273 is released + "ktlint_standard_function-expression-body" to "disabled", + ), + ) target("**/*.kt") } kotlinGradle { - ktlint().editorConfigOverride(mapOf("ktlint_experimental" to "enabled")) + ktlint().editorConfigOverride( + mapOf( + "ktlint_experimental" to "enabled", + // Disabled until https://github.com/pinterest/ktlint/pull/2273 is released + "ktlint_standard_function-expression-body" to "disabled", + ), + ) target("**/*.kts") } } @@ -76,16 +88,8 @@ allprojects { } tasks.withType().configureEach { dokkaSourceSets.configureEach { - reportUndocumented.set(false) skipDeprecated.set(true) jdkVersion.set(8) - perPackageOption { - matchingRegex.set("build\\.buf.*") - suppress.set(true) - } - } - if (name == "dokkaGfm") { - outputDirectory.set(project.file("${project.rootDir}/docs/3.x")) } } plugins.withId("com.vanniktech.maven.publish.base") { diff --git a/examples/android/build.gradle.kts b/examples/android/build.gradle.kts index 4c203fb9..c141247f 100644 --- a/examples/android/build.gradle.kts +++ b/examples/android/build.gradle.kts @@ -4,12 +4,12 @@ plugins { } android { - compileSdk = 33 + compileSdk = 34 defaultConfig { applicationId = "com.connectrpc.examples.android" minSdk = 28 - targetSdk = 33 + targetSdk = 34 versionCode = 1 versionName = "1.0" multiDexEnabled = true diff --git a/extensions/google-java/build.gradle.kts b/extensions/google-java/build.gradle.kts index 5874b325..2068d3b5 100644 --- a/extensions/google-java/build.gradle.kts +++ b/extensions/google-java/build.gradle.kts @@ -29,9 +29,9 @@ dependencies { implementation(libs.kotlin.reflect) } -configure { +mavenPublishing { configure( - KotlinJvm(javadocJar = Dokka("dokkaGfm")), + KotlinJvm(javadocJar = Dokka("dokkaHtml")), ) } diff --git a/extensions/google-javalite/build.gradle.kts b/extensions/google-javalite/build.gradle.kts index a7d6b002..ba9a6dd5 100644 --- a/extensions/google-javalite/build.gradle.kts +++ b/extensions/google-javalite/build.gradle.kts @@ -28,9 +28,9 @@ sourceSets { } } -configure { +mavenPublishing { configure( - KotlinJvm(javadocJar = Dokka("dokkaGfm")), + KotlinJvm(javadocJar = Dokka("dokkaHtml")), ) } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index c70cd324..14f5c4a3 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -6,17 +6,17 @@ dokka = "1.9.0" junit = "4.13.2" kotlin = "1.9.10" kotlinpoet = "1.14.2" -mavenplugin = "0.24.0" +mavenplugin = "0.25.3" moshi = "1.15.0" okhttp = "4.11.0" okio = "3.6.0" protobuf = "3.24.4" slf4j = "2.0.9" -spotless = "6.21.0" +spotless = "6.22.0" [libraries] android = { module = "com.google.android:android", version.ref = "android" } -android-material = { module = "com.google.android.material:material", version = "1.9.0" } +android-material = { module = "com.google.android.material:material", version = "1.10.0" } android-multidex = { module = "com.android.support:multidex", version = "1.0.3" } android-plugin = { module = "com.android.tools.build:gradle", version = "8.1.2" } androidx-annotations = { module = "androidx.annotation:annotation", version = "1.7.0" } diff --git a/library/build.gradle.kts b/library/build.gradle.kts index ba96154a..17adb3be 100644 --- a/library/build.gradle.kts +++ b/library/build.gradle.kts @@ -1,6 +1,5 @@ import com.vanniktech.maven.publish.JavadocJar.Dokka import com.vanniktech.maven.publish.KotlinJvm -import com.vanniktech.maven.publish.MavenPublishBaseExtension plugins { kotlin("jvm") @@ -23,11 +22,12 @@ dependencies { ksp(libs.moshiKotlinCodegen) } -configure { +mavenPublishing { configure( - KotlinJvm(javadocJar = Dokka("dokkaGfm")), + KotlinJvm(javadocJar = Dokka("dokkaHtml")), ) } + // Workaround for overriding the published library name to "connect-kotlin". // Otherwise, the plugin will take the library name. extensions.getByType().apply { diff --git a/okhttp/build.gradle.kts b/okhttp/build.gradle.kts index 635adedd..39587023 100644 --- a/okhttp/build.gradle.kts +++ b/okhttp/build.gradle.kts @@ -15,9 +15,9 @@ dependencies { api(project(":library")) } -configure { +mavenPublishing { configure( - KotlinJvm(javadocJar = Dokka("dokkaGfm")), + KotlinJvm(javadocJar = Dokka("dokkaHtml")), ) } diff --git a/protoc-gen-connect-kotlin/build.gradle.kts b/protoc-gen-connect-kotlin/build.gradle.kts index a6879e59..2d0cb4b5 100644 --- a/protoc-gen-connect-kotlin/build.gradle.kts +++ b/protoc-gen-connect-kotlin/build.gradle.kts @@ -45,9 +45,9 @@ sourceSets { } } -configure { +mavenPublishing { configure( - KotlinJvm(javadocJar = Dokka("dokkaGfm")), + KotlinJvm(javadocJar = Dokka("dokkaHtml")), ) } diff --git a/protoc-gen-connect-kotlin/src/main/kotlin/com/connectrpc/protocgen/connect/internal/Parameters.kt b/protoc-gen-connect-kotlin/src/main/kotlin/com/connectrpc/protocgen/connect/internal/Parameters.kt index c377cdb1..e8ce0e96 100644 --- a/protoc-gen-connect-kotlin/src/main/kotlin/com/connectrpc/protocgen/connect/internal/Parameters.kt +++ b/protoc-gen-connect-kotlin/src/main/kotlin/com/connectrpc/protocgen/connect/internal/Parameters.kt @@ -42,7 +42,8 @@ internal fun parse(input: String): Configuration { val parameters = parseGeneratorParameter(input) return Configuration( generateCallbackMethods = parameters[CALLBACK_SIGNATURE]?.toBoolean() ?: false, - generateCoroutineMethods = parameters[COROUTINE_SIGNATURE]?.toBoolean() ?: true, // Defaulted to true. + // Defaulted to true. + generateCoroutineMethods = parameters[COROUTINE_SIGNATURE]?.toBoolean() ?: true, generateBlockingUnaryMethods = parameters[BLOCKING_UNARY_SIGNATURE]?.toBoolean() ?: false, ) } From 5686186a7761052833c242eb3920f8efbb218013 Mon Sep 17 00:00:00 2001 From: "Philip K. Warren" Date: Mon, 9 Oct 2023 14:19:48 -0500 Subject: [PATCH 2/2] apply lint fixes --- build.gradle.kts | 6 +++--- extensions/google-java/build.gradle.kts | 1 - extensions/google-javalite/build.gradle.kts | 1 - okhttp/build.gradle.kts | 1 - protoc-gen-connect-kotlin/build.gradle.kts | 1 - 5 files changed, 3 insertions(+), 7 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 592a79fb..d7b5834b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -56,7 +56,7 @@ allprojects { "ktlint_experimental" to "enabled", // Disabled until https://github.com/pinterest/ktlint/pull/2273 is released "ktlint_standard_function-expression-body" to "disabled", - ), + ), ) target("**/*.kt") } @@ -66,8 +66,8 @@ allprojects { "ktlint_experimental" to "enabled", // Disabled until https://github.com/pinterest/ktlint/pull/2273 is released "ktlint_standard_function-expression-body" to "disabled", - ), - ) + ), + ) target("**/*.kts") } } diff --git a/extensions/google-java/build.gradle.kts b/extensions/google-java/build.gradle.kts index 2068d3b5..1219bcb8 100644 --- a/extensions/google-java/build.gradle.kts +++ b/extensions/google-java/build.gradle.kts @@ -1,6 +1,5 @@ import com.vanniktech.maven.publish.JavadocJar.Dokka import com.vanniktech.maven.publish.KotlinJvm -import com.vanniktech.maven.publish.MavenPublishBaseExtension plugins { kotlin("jvm") diff --git a/extensions/google-javalite/build.gradle.kts b/extensions/google-javalite/build.gradle.kts index ba9a6dd5..3695ac37 100644 --- a/extensions/google-javalite/build.gradle.kts +++ b/extensions/google-javalite/build.gradle.kts @@ -1,6 +1,5 @@ import com.vanniktech.maven.publish.JavadocJar.Dokka import com.vanniktech.maven.publish.KotlinJvm -import com.vanniktech.maven.publish.MavenPublishBaseExtension plugins { kotlin("jvm") diff --git a/okhttp/build.gradle.kts b/okhttp/build.gradle.kts index 39587023..a365e6f5 100644 --- a/okhttp/build.gradle.kts +++ b/okhttp/build.gradle.kts @@ -1,6 +1,5 @@ import com.vanniktech.maven.publish.JavadocJar.Dokka import com.vanniktech.maven.publish.KotlinJvm -import com.vanniktech.maven.publish.MavenPublishBaseExtension plugins { kotlin("jvm") diff --git a/protoc-gen-connect-kotlin/build.gradle.kts b/protoc-gen-connect-kotlin/build.gradle.kts index 2d0cb4b5..41cc9269 100644 --- a/protoc-gen-connect-kotlin/build.gradle.kts +++ b/protoc-gen-connect-kotlin/build.gradle.kts @@ -1,6 +1,5 @@ import com.vanniktech.maven.publish.JavadocJar.Dokka import com.vanniktech.maven.publish.KotlinJvm -import com.vanniktech.maven.publish.MavenPublishBaseExtension plugins { application