-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle.kts
103 lines (94 loc) · 3.01 KB
/
build.gradle.kts
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
101
102
103
val kotlinVersion by extra { "1.9.20" }
val junitVersion by extra { "5.8.1" }
plugins {
kotlin("jvm") version "1.9.20"
id("org.jetbrains.dokka") version "1.9.10"
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
`java-library`
`maven-publish`
signing
}
group = "org.eljabali.sami.javatimefun"
version = "3.0.0"
repositories {
mavenCentral()
}
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion")
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitVersion")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junitVersion")
}
tasks.getByName<Test>("test") {
useJUnitPlatform()
}
tasks{
register<Jar>("dokkaJar") {
from(dokkaHtml)
dependsOn(dokkaHtml)
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/seljabali/java-time-fun")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("seljabali")
name.set("Sami Eljabali")
email.set("[email protected]")
url.set("sami.eljabali.org")
}
}
scm {
connection.set("scm:git:git://github.com/seljabali/java-time-fun.git")
developerConnection.set("scm:git:ssh://github.com/seljabali/java-time-fun.git")
url.set("https://github.com/seljabali/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://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
username.set(System.getProperty("SONATYPE_USERNAME"))
password.set(System.getProperty("SONATYPE_PASSWORD"))
}
}
}