-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
100 lines (92 loc) · 2.89 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
100 lines (92 loc) · 2.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
plugins {
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.dokka)
alias(libs.plugins.nexus.publish)
`java-library`
`maven-publish`
signing
}
group = "org.eljabali.sami.javatimefun"
version = "4.1.1"
repositories {
mavenCentral()
}
dependencies {
testImplementation(libs.junit.api)
testRuntimeOnly(libs.junit.engine)
testRuntimeOnly(libs.junit.launcher)
}
tasks.getByName<Test>("test") {
useJUnitPlatform()
}
tasks{
register<Jar>("dokkaJar") {
dependsOn(dokkaGeneratePublicationHtml)
from(dokkaGeneratePublicationHtml.flatMap { it.outputDirectory })
archiveClassifier.set("javadoc")
}
withType<Jar> {
metaInf.with(
copySpec {
from("${project.rootDir}/LICENSE")
}
)
}
}
signing {
useInMemoryPgpKeys(
System.getProperty("GPG_PRIVATE_KEY"),
System.getProperty("GPG_PRIVATE_PASSWORD")
)
sign(publishing.publications)
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
pom {
name.set(project.name)
description.set("java.time Kotlin extension functions library.")
url.set("https://github.com/sami-eljabali/java-time-fun")
licenses {
license {
name.set("MIT License")
url.set("https://github.com/sami-eljabali/java-time-fun/blob/main/LICENSE")
}
}
developers {
developer {
id.set("sami-eljabali")
name.set("Sami Eljabali")
email.set("sami@eljabali.org")
url.set("sami.eljabali.org")
}
}
scm {
connection.set("scm:git:git://github.com/sami-eljabali/java-time-fun.git")
developerConnection.set("scm:git:ssh://github.com/sami-eljabali/java-time-fun.git")
url.set("https://github.com/sami-eljabali/java-time-fun/tree/main")
}
}
groupId = project.group as String
artifactId = project.name
version = project.version as String
from(components["java"])
artifacts {
artifact(tasks["dokkaJar"])
artifact(tasks.kotlinSourcesJar) {
classifier = "sources"
}
}
}
}
}
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
username.set(System.getProperty("SONATYPE_USERNAME"))
password.set(System.getProperty("SONATYPE_PASSWORD"))
}
}
}