Skip to content

Commit

Permalink
Sign publications
Browse files Browse the repository at this point in the history
  • Loading branch information
Duzhinsky committed Aug 31, 2023
1 parent 1b7951f commit 3634fa9
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 48 deletions.
50 changes: 2 additions & 48 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,15 @@ allprojects {
}

fun configurePublishedProject(project: Project) {
project.java {
withJavadocJar()
withSourcesJar()
}

project.tasks.withType<Javadoc>() {
options {
(this as CoreJavadocOptions).addStringOption("Xdoclint:none", "-quiet")
}
}

project.signing {
sign(publishing.publications)
}
project.apply(plugin = "signing")

project.publishing {
publications.withType<MavenPublication>().forEach() { configureMavenPublication(it) }
repositories {
maven {
name = "ghPackages"
Expand All @@ -81,42 +73,4 @@ fun configurePublishedProject(project: Project) {
}
}
}
}


fun configureMavenPublication(publication: MavenPublication) {
publication.pom {
url = "https://github.com/SuduIDE/protogen"
organization {
name = "com.github.SuduIDE"
url = "https://github.com/SuduIDE"
}
issueManagement {
system = "GitHub"
url = "https://github.com/SuduIDE/protogen/issues"
}
licenses {
license {
name = "The Apache License, Version 2.0"
url = "https://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
scm {
url = "https://github.com/SuduIDE/protogen"
connection = "scm:https://github.com/SuduIDE/protogen.git"
developerConnection = "scm:git://github.com/SuduIDE/protogen.git"
}
developers {
developer {
id = "Duzhinsky"
name = "Dmitrii Duzhinskii"
email = "[email protected]"
}
}
}

publication.groupId = project.group.toString()
publication.version = project.version.toString()
publication.artifact(tasks.findByName("sourcesJar"))
publication.artifact(tasks.findByName("javadocJar"))
}
}
60 changes: 60 additions & 0 deletions generator/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,79 @@ plugins {
id("com.github.johnrengelman.shadow") version "8.1.1"
}

java {
withJavadocJar()
withSourcesJar()
}

signing {
sign(publishing.publications)
}

publishing {
publications {
create<MavenPublication>("maven") {
pom {
description = "protoc plugin of protogen"
name = "protoc-gen-protogen"
url = "https://github.com/SuduIDE/protogen"
organization {
name = "com.github.SuduIDE"
url = "https://github.com/SuduIDE"
}
issueManagement {
system = "GitHub"
url = "https://github.com/SuduIDE/protogen/issues"
}
licenses {
license {
name = "The Apache License, Version 2.0"
url = "https://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
scm {
url = "https://github.com/SuduIDE/protogen"
connection = "scm:https://github.com/SuduIDE/protogen.git"
developerConnection = "scm:git://github.com/SuduIDE/protogen.git"
}
developers {
developer {
id = "Duzhinsky"
name = "Dmitrii Duzhinskii"
email = "[email protected]"
}
}
}

groupId = project.group.toString()
artifactId = "protoc-gen-protogen"
version = project.version.toString()
artifact(tasks.findByName("sourcesJar"))
artifact(tasks.findByName("javadocJar"))
artifact(tasks.shadowJar) {
classifier = "jvm"
}
}
}

repositories {
maven {
name = "ghPackages"
url = uri("https://maven.pkg.github.com/SuduIDE/protogen")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
maven {
name = "sonatype"
url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2")
credentials {
username = System.getenv("SONATYPE_USERNAME")
password = System.getenv("SONATYPE_PASSWORD")
}
}
}
}

tasks.shadowJar {
Expand Down
44 changes: 44 additions & 0 deletions options/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,53 @@ plugins {
signing
}

java {
withJavadocJar()
withSourcesJar()
}

signing {
sign(publishing.publications)
}

publishing {
publications {
create<MavenPublication>("maven") {
pom {
url = "https://github.com/SuduIDE/protogen"
organization {
name = "com.github.SuduIDE"
url = "https://github.com/SuduIDE"
}
issueManagement {
system = "GitHub"
url = "https://github.com/SuduIDE/protogen/issues"
}
licenses {
license {
name = "The Apache License, Version 2.0"
url = "https://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
scm {
url = "https://github.com/SuduIDE/protogen"
connection = "scm:https://github.com/SuduIDE/protogen.git"
developerConnection = "scm:git://github.com/SuduIDE/protogen.git"
}
developers {
developer {
id = "Duzhinsky"
name = "Dmitrii Duzhinskii"
email = "[email protected]"
}
}
}

groupId = project.group.toString()
version = project.version.toString()
artifact(tasks.findByName("sourcesJar"))
artifact(tasks.findByName("javadocJar"))

pom {
description = "Options for protogen tool. Use it as protogen scope dependency"
name = "protogen-options"
Expand Down

0 comments on commit 3634fa9

Please sign in to comment.