Skip to content

Commit

Permalink
Set up publishing to Gradle Portal
Browse files Browse the repository at this point in the history
  • Loading branch information
ogolberg authored Feb 21, 2020
1 parent 9d6cd93 commit f92accf
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:

- run:
name: Deploy (if release)
command: "if [[ \"$CIRCLE_BRANCH\" == master ]]; then ./gradlew publishToRemote closeAndReleaseRepository -Dorg.gradle.internal.http.socketTimeout=120000 -Dorg.gradle.internal.network.retry.max.attempts=1 -Dorg.gradle.internal.publish.checksums.insecure=true; else echo skipping publishing; fi"
command: "if [[ \"$CIRCLE_BRANCH\" == master ]]; then ./gradlew publishToRemote closeAndReleaseRepository publishPlugins -Dorg.gradle.internal.http.socketTimeout=120000 -Dorg.gradle.internal.network.retry.max.attempts=1 -Dorg.gradle.internal.publish.checksums.insecure=true; else echo skipping publishing; fi"

workflows:
version: 2.1
Expand Down
14 changes: 10 additions & 4 deletions buildSrc/src/main/kotlin/RemotePublishing.kt
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,19 @@ private object Remote {
val url = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
}

object ProtoktProjectInfo {
const val name = "Protokt"
const val url = "/~https://github.com/open-toast/protokt"
const val description = "Protobuf compiler and runtime for Kotlin"
}

fun MavenPublication.standardPom() {
pom {
name.set("Protokt")
description.set("Protobuf compiler and runtime for Kotlin")
url.set("/~https://github.com/open-toast/protokt")
name.set(ProtoktProjectInfo.name)
description.set(ProtoktProjectInfo.description)
url.set(ProtoktProjectInfo.url)
scm {
url.set("/~https://github.com/open-toast/protokt")
url.set(ProtoktProjectInfo.url)
}
licenses {
license {
Expand Down
17 changes: 17 additions & 0 deletions protokt-gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

plugins {
`java-gradle-plugin`
id("com.gradle.plugin-publish") version "0.10.1"
}

val buildSrcClasses = "${rootProject.projectDir}/buildSrc/build/classes/kotlin/main"
Expand All @@ -33,10 +34,26 @@ gradlePlugin {
create("protokt") {
id = "com.toasttab.protokt"
implementationClass = "com.toasttab.protokt.gradle.plugin.ProtoktPlugin"
displayName = ProtoktProjectInfo.name
description = ProtoktProjectInfo.description
}
}
}

pluginBundle {
mavenCoordinates {
group = "${project.group}"
}
website = ProtoktProjectInfo.url
vcsUrl = ProtoktProjectInfo.url
description = ProtoktProjectInfo.description
tags = listOf("protobuf", "kotlin")
}

tasks.named("publishPlugins") {
enabled = isRelease()
}

enablePublishing()

dependencies {
Expand Down

0 comments on commit f92accf

Please sign in to comment.