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 f6b1aa8
Show file tree
Hide file tree
Showing 3 changed files with 87 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"))
}
}
41 changes: 41 additions & 0 deletions generator/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,55 @@ 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"
}
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 f6b1aa8

Please sign in to comment.