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

Add plugin to maven publish #28

Merged
merged 6 commits into from
Mar 14, 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
7 changes: 4 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,14 @@ jobs:
uses: gradle/wrapper-validation-action@v1
- name: sha256
run: |
make buildplugin
sha256sum ./protoc-gen-connect-kotlin/build/libs/protoc-gen-connect-kotlin.jar >> sha256.txt
tag=$(git describe --tags --abbrev=0 --exact-match)
release_version="${tag:1}"
sha256sum ./protoc-gen-connect-kotlin/build/libs/protoc-gen-connect-kotlin-${release_version}.jar >> sha256.txt
- name: Publish GitHub artifacts
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
append_body: true
files: |
./protoc-gen-connect-kotlin/build/libs/protoc-gen-connect-kotlin.jar
./protoc-gen-connect-kotlin/build/libs/protoc-gen-connect-kotlin-${release_version}.jar
sha256.txt
1 change: 1 addition & 0 deletions okhttp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ configure<MavenPublishBaseExtension> {
KotlinJvm(javadocJar = Dokka("dokkaGfm"))
)
}

// Workaround for overriding the published library name to "connect-kotlin-okhttp".
// Otherwise, the plugin will take the library name.
extensions.getByType<PublishingExtension>().apply {
Expand Down
23 changes: 23 additions & 0 deletions protoc-gen-connect-kotlin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import com.vanniktech.maven.publish.JavadocJar.Dokka
import com.vanniktech.maven.publish.KotlinJvm
import com.vanniktech.maven.publish.MavenPublishBaseExtension

plugins {
application
java
kotlin("jvm")

id("org.jetbrains.dokka")
id("com.vanniktech.maven.publish.base")
}

tasks {
Expand Down Expand Up @@ -31,3 +38,19 @@ dependencies {
testImplementation(libs.mockito)
testImplementation(libs.kotlin.coroutines.core)
}

configure<MavenPublishBaseExtension> {
configure(
KotlinJvm(javadocJar = Dokka("dokkaGfm"))
)
}

// Workaround for overriding the published library name.
// Otherwise, the plugin will take the library name.
extensions.getByType<PublishingExtension>().apply {
publications
.filterIsInstance<MavenPublication>()
.forEach { publication ->
publication.artifactId = "protoc-gen-connect-kotlin"
}
}
2 changes: 1 addition & 1 deletion protoc-gen-connect-kotlin/protoc-gen-connect-kotlin
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

exec java -jar ./protoc-gen-connect-kotlin/build/libs/protoc-gen-connect-kotlin.jar
exec java -jar ./protoc-gen-connect-kotlin/build/libs/protoc-gen-connect-kotlin-0.0.0-SNAPSHOT.jar