-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: switched publishing plugin back to third party solution
- Loading branch information
Showing
4 changed files
with
58 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,9 @@ | |
* License-Filename: LICENSE | ||
*/ | ||
|
||
import com.vanniktech.maven.publish.JavadocJar | ||
import com.vanniktech.maven.publish.KotlinJvm | ||
import com.vanniktech.maven.publish.SonatypeHost | ||
import org.gradle.accessors.dm.LibrariesForLibs | ||
|
||
private val Project.libs: LibrariesForLibs | ||
|
@@ -15,60 +18,62 @@ private val Project.libs: LibrariesForLibs | |
plugins { | ||
// Apply core plugins. | ||
`java-library` | ||
`maven-publish` | ||
signing | ||
id("com.vanniktech.maven.publish") | ||
jacoco | ||
id("org.jetbrains.dokka") | ||
id("com.ncorti.ktfmt.gradle") | ||
kotlin("jvm") | ||
} | ||
|
||
repositories { mavenCentral() } | ||
if (project != rootProject) version = rootProject.version | ||
|
||
java { | ||
withSourcesJar() | ||
withJavadocJar() | ||
toolchain { languageVersion = JavaLanguageVersion.of(21) } | ||
} | ||
repositories { mavenCentral() } | ||
|
||
publishing { | ||
publications { | ||
create<MavenPublication>("maven") { | ||
pom { | ||
name = "spha-${project.name}" | ||
description = | ||
"SPHA is a collection of libraries to work with hierarchical KPI models." | ||
url = "https://github.com/fraunhofer-iem/software-product-health-analyzer" | ||
licenses { | ||
license { | ||
name = "MIT License" | ||
url = | ||
"https://github.com/fraunhofer-iem/software-product-health-analyzer/blob/main/LICENSE.md" | ||
} | ||
} | ||
developers { | ||
developer { | ||
name = "Jan-Niclas Struewer" | ||
email = "[email protected]" | ||
} | ||
developer { | ||
name = "Sebastian Leuer" | ||
email = "[email protected]" | ||
} | ||
} | ||
scm { | ||
connection = | ||
"scm:git:[email protected]:fraunhofer-iem/software-product-health-analyzer.git" | ||
developerConnection = | ||
"scm:git:ssh://github.com:fraunhofer-iem/software-product-health-analyzer.git" | ||
url = "https://github.com/fraunhofer-iem/software-product-health-analyzer" | ||
} | ||
java { toolchain { languageVersion = JavaLanguageVersion.of(21) } } | ||
|
||
mavenPublishing { | ||
configure(KotlinJvm(JavadocJar.Dokka("dokkaJavadoc"))) | ||
|
||
coordinates( | ||
groupId = "de.fraunhofer.iem", | ||
artifactId = "spha-${project.name}", | ||
version = version.toString(), | ||
) | ||
|
||
publishToMavenCentral(SonatypeHost.S01, automaticRelease = false) | ||
signAllPublications() | ||
|
||
pom { | ||
name = "spha-${project.name}" | ||
description = "SPHA is a collection of libraries to work with hierarchical KPI models." | ||
url = "https://github.com/fraunhofer-iem/software-product-health-analyzer" | ||
version = version.toString() | ||
licenses { | ||
license { | ||
name = "MIT License" | ||
url = | ||
"https://github.com/fraunhofer-iem/software-product-health-analyzer/blob/main/LICENSE.md" | ||
} | ||
groupId = "de.fraunhofer.iem" | ||
artifactId = "spha-${project.name}" | ||
from(components["java"]) | ||
} | ||
developers { | ||
developer { | ||
name = "Jan-Niclas Struewer" | ||
email = "[email protected]" | ||
} | ||
developer { | ||
name = "Sebastian Leuer" | ||
email = "[email protected]" | ||
} | ||
} | ||
scm { | ||
connection = | ||
"scm:git:[email protected]:fraunhofer-iem/software-product-health-analyzer.git" | ||
developerConnection = | ||
"scm:git:ssh://github.com:fraunhofer-iem/software-product-health-analyzer.git" | ||
url = "https://github.com/fraunhofer-iem/software-product-health-analyzer" | ||
} | ||
} | ||
|
||
repositories { | ||
maven { | ||
name = "mavenCentral" | ||
|
@@ -85,13 +90,6 @@ publishing { | |
} | ||
} | ||
|
||
signing { | ||
val signingKey: String? by project | ||
val signingPassword: String? by project | ||
useInMemoryPgpKeys(signingKey, signingPassword) | ||
sign(publishing.publications["maven"]) | ||
} | ||
|
||
kotlin { | ||
compilerOptions { apiVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0) } | ||
} | ||
|
@@ -123,19 +121,9 @@ tasks.jacocoTestReport { | |
reports { xml.required = true } | ||
} | ||
|
||
tasks.named<Jar>("javadocJar") { from(tasks.named("dokkaJavadoc")) } | ||
|
||
tasks.register<Jar>("dokkaJavadocJar") { | ||
dependsOn(tasks.dokkaJavadoc) | ||
from(tasks.dokkaJavadoc.flatMap { it.outputDirectory }) | ||
archiveClassifier.set("javadoc") | ||
} | ||
|
||
tasks.register("jacocoReport") { | ||
description = "Generates code coverage reports for all test tasks." | ||
group = "Reporting" | ||
|
||
dependsOn(tasks.withType<JacocoReport>()) | ||
} | ||
|
||
if (project != rootProject) version = rootProject.version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters