Migrate to new central publish
This commit is contained in:
parent
0dc3458176
commit
2e1f3876af
@ -2,8 +2,9 @@ plugins {
|
||||
`java-gradle-plugin`
|
||||
`kotlin-dsl`
|
||||
`maven-publish`
|
||||
signing
|
||||
// signing
|
||||
`version-catalog`
|
||||
alias(libs.plugins.maven.publish)
|
||||
alias(libs.plugins.jetbrains.changelog)
|
||||
alias(libs.plugins.jetbrains.dokka)
|
||||
alias(libs.plugins.versions)
|
||||
@ -111,25 +112,9 @@ val emptySourcesJar by tasks.creating(Jar::class) {
|
||||
archiveBaseName.set("empty")
|
||||
}
|
||||
|
||||
publishing {
|
||||
val vcs = "https://github.com/SciProgCentre/gradle-tools"
|
||||
|
||||
// Process each publication we have in this project
|
||||
publications {
|
||||
create<MavenPublication>("catalog") {
|
||||
from(components["versionCatalog"])
|
||||
artifactId = "version-catalog"
|
||||
|
||||
pom {
|
||||
name.set("version-catalog")
|
||||
}
|
||||
}
|
||||
|
||||
withType<MavenPublication> {
|
||||
// thanks @vladimirsitnikv for the fix
|
||||
artifact(if (name == "catalog") emptySourcesJar else sourcesJar)
|
||||
artifact(if (name == "catalog") emptyJavadocJar else javadocsJar)
|
||||
|
||||
mavenPublishing {
|
||||
val vcs = "https://git.sciprog.center/kscience/gradle-tools"
|
||||
|
||||
pom {
|
||||
name.set(project.name)
|
||||
@ -158,15 +143,13 @@ publishing {
|
||||
tag.set(project.version.toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val spaceRepo = "https://maven.sciprog.center/kscience"
|
||||
val spcUser: String? = findProperty("publishing.spc.user") as? String
|
||||
val spcToken: String? = findProperty("publishing.spc.token") as? String
|
||||
|
||||
if (spcUser != null && spcToken != null) {
|
||||
repositories.maven {
|
||||
publishing.repositories.maven {
|
||||
name = "spc"
|
||||
url = uri(spaceRepo)
|
||||
|
||||
@ -177,31 +160,15 @@ publishing {
|
||||
}
|
||||
}
|
||||
|
||||
val sonatypeUser: String? = project.findProperty("publishing.sonatype.user") as? String
|
||||
val sonatypePassword: String? = project.findProperty("publishing.sonatype.password") as? String
|
||||
val centralUser: String? = project.findProperty("mavenCentralUsername") as? String
|
||||
val centralPassword: String? = project.findProperty("mavenCentralPassword") as? String
|
||||
|
||||
if (sonatypeUser != null && sonatypePassword != null) {
|
||||
val sonatypeRepo: String = if (project.version.toString().contains("dev")) {
|
||||
"https://oss.sonatype.org/content/repositories/snapshots"
|
||||
} else {
|
||||
"https://oss.sonatype.org/service/local/staging/deploy/maven2"
|
||||
if (centralUser != null && centralPassword != null) {
|
||||
publishToMavenCentral(com.vanniktech.maven.publish.SonatypeHost.CENTRAL_PORTAL)
|
||||
signAllPublications()
|
||||
}
|
||||
|
||||
repositories.maven {
|
||||
name = "sonatype"
|
||||
url = uri(sonatypeRepo)
|
||||
|
||||
credentials {
|
||||
username = sonatypeUser
|
||||
password = sonatypePassword
|
||||
}
|
||||
}
|
||||
|
||||
signing {
|
||||
//useGpgCmd()
|
||||
sign(publications)
|
||||
}
|
||||
}
|
||||
configure(com.vanniktech.maven.publish.VersionCatalog())
|
||||
}
|
||||
|
||||
kotlin {
|
||||
|
@ -27,6 +27,7 @@ xmlutil = "0.90.3"
|
||||
yamlkt = "0.13.0"
|
||||
|
||||
[plugins]
|
||||
maven-publish = { id = "com.vanniktech.maven.publish", version = "0.30.0" }
|
||||
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
|
||||
compose-jb = { id = "org.jetbrains.compose", version.ref = "compose" }
|
||||
jetbrains-changelog = "org.jetbrains.changelog:2.2.1"
|
||||
|
Loading…
Reference in New Issue
Block a user