106 lines
2.6 KiB
Kotlin
106 lines
2.6 KiB
Kotlin
import org.gradle.model.internal.core.ModelNodes.withType
|
|
|
|
plugins {
|
|
kotlin("jvm") version "2.1.0"
|
|
`maven-publish`
|
|
signing
|
|
id("org.jetbrains.dokka") version "1.5.31"
|
|
}
|
|
|
|
group = "nl.astraeus"
|
|
version = "1.1.3"
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
}
|
|
|
|
dependencies {
|
|
testImplementation(kotlin("test"))
|
|
}
|
|
|
|
tasks.test {
|
|
useJUnitPlatform()
|
|
|
|
minHeapSize = "128m"
|
|
maxHeapSize = "1g"
|
|
}
|
|
|
|
extra["PUBLISH_GROUP_ID"] = group
|
|
extra["PUBLISH_VERSION"] = version
|
|
extra["PUBLISH_ARTIFACT_ID"] = name
|
|
|
|
// Stub secrets to let the project sync and build without the publication values set up
|
|
val signingKeyId: String? by project
|
|
val signingPassword: String? by project
|
|
val signingSecretKeyRingFile: String? by project
|
|
|
|
extra["signing.keyId"] = signingKeyId
|
|
extra["signing.password"] = signingPassword
|
|
extra["signing.secretKeyRingFile"] = signingSecretKeyRingFile
|
|
|
|
val javadocJar by tasks.registering(Jar::class) {
|
|
archiveClassifier.set("javadoc")
|
|
}
|
|
|
|
val sourcesJar by tasks.registering(Jar::class) {
|
|
archiveClassifier.set("sources") // This sets the classifier to 'sources'
|
|
from(sourceSets.main.get().allSource) // Assumes you are using the 'main' source set
|
|
}
|
|
|
|
publishing {
|
|
repositories {
|
|
maven {
|
|
name = "gitea"
|
|
setUrl("https://gitea.astraeus.nl/api/packages/rnentjes/maven")
|
|
|
|
credentials {
|
|
val giteaUsername: String? by project
|
|
val giteaPassword: String? by project
|
|
|
|
username = giteaUsername
|
|
password = giteaPassword
|
|
}
|
|
}
|
|
}
|
|
|
|
publications {
|
|
create<MavenPublication>("mavenKotlin") {
|
|
artifact(javadocJar.get())
|
|
artifact(tasks.jar.get())
|
|
artifact(sourcesJar.get())
|
|
}
|
|
}
|
|
publications.withType<MavenPublication> {
|
|
// Provide artifacts information requited by Maven Central
|
|
pom {
|
|
name.set("simple-persistence-kotlin")
|
|
description.set("Simple persistence in Kotlin")
|
|
|
|
licenses {
|
|
license {
|
|
name.set("MIT")
|
|
url.set("https://opensource.org/licenses/MIT")
|
|
}
|
|
}
|
|
developers {
|
|
developer {
|
|
id.set("rnentjes")
|
|
name.set("Rien Nentjes")
|
|
email.set("info@nentjes.com")
|
|
}
|
|
}
|
|
scm {
|
|
url.set("https://gitea.astraeus.nl/rnentjes/simple-persistence-kotlin")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
signing {
|
|
sign(publishing.publications)
|
|
}
|
|
|
|
tasks.withType<PublishToMavenRepository> {
|
|
dependsOn(tasks.withType<Sign>())
|
|
}
|