-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
90 lines (79 loc) · 2.19 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
plugins {
`java-library`
signing
`maven-publish`
}
group = "io.github.scru128"
version = "3.0.2"
repositories {
mavenCentral()
}
dependencies {
// Use @NotNull and @Nullable annotations for Kotlin interoperability
compileOnly("org.jetbrains:annotations:24.0.1")
}
testing {
suites {
named<JvmTestSuite>("test") {
useJUnitJupiter()
}
}
}
java {
// Publish sources jar and javadoc jar
withSourcesJar()
withJavadocJar()
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}
}
tasks.javadoc {
setDestinationDir(file("docs"))
}
tasks.clean {
delete("docs")
}
signing {
if (hasProperty("signing.keyId")) {
sign(publishing.publications)
}
}
publishing {
publications {
create<MavenPublication>("maven") {
from(components["java"])
pom {
name.set("${project.group}:${project.name}")
description.set("SCRU128: Sortable, Clock and Random number-based Unique identifier")
url.set("https://github.com/scru128/java")
licenses {
license {
name.set("Apache-2.0")
url.set("https://opensource.org/licenses/Apache-2.0")
}
}
developers {
developer {
name.set("LiosK")
email.set("[email protected]")
}
}
scm {
connection.set("scm:git:git://github.com/scru128/java.git")
developerConnection.set("scm:git:ssh://[email protected]/scru128/java.git")
url.set("https://github.com/scru128/java")
}
}
}
repositories {
maven {
name = "MavenCentral"
url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = findProperty("sonatypeUsername") as String
password = findProperty("sonatypePassword") as String
}
}
}
}
}