-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
113 lines (98 loc) · 3.03 KB
/
build.gradle.kts
File metadata and controls
113 lines (98 loc) · 3.03 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
101
102
103
104
105
106
107
108
109
110
111
112
113
plugins {
kotlin("jvm") version "1.5.31"
id("org.jetbrains.dokka") version "1.5.0"
`maven-publish`
signing
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}
}
repositories {
mavenCentral()
maven("https://m2.dv8tion.net/releases")
}
dependencies {
implementation(kotlin("stdlib"))
implementation("net.dv8tion:JDA:4.3.0_277")
implementation("com.google.guava:guava:31.0.1-jre")
}
tasks {
test {
useJUnitPlatform()
}
create<Jar>("sourcesJar") {
archiveClassifier.set("sources")
from(sourceSets["main"].allSource)
}
create<Jar>("dokkaJar") {
archiveClassifier.set("javadoc")
dependsOn("dokkaHtml")
from("$buildDir/dokka/html/") {
include("**")
}
}
}
publishing {
repositories {
mavenLocal()
maven {
name = "central"
credentials.runCatching {
val nexusUsername: String by project
val nexusPassword: String by project
username = nexusUsername
password = nexusPassword
}.onFailure {
logger.warn("Failed to load nexus credentials, Check the gradle.properties")
}
url = uri(
if ("SNAPSHOT" in version as String) {
"https://s01.oss.sonatype.org/content/repositories/snapshots/"
} else {
"https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
}
)
}
}
publications {
create<MavenPublication>("command") {
artifactId = "command"
from(components["java"])
artifact(tasks["sourcesJar"])
artifact(tasks["dokkaJar"])
pom {
name.set("command")
description.set("command library for jda")
url.set("https://github.com/monull/command")
licenses {
license {
name.set("GNU General Public License version 3")
url.set("https://opensource.org/licenses/GPL-3.0")
}
}
developers {
developer {
id.set("monull")
name.set("monull2452")
email.set("monull2452@gmail.com")
url.set("https://github.com/monull")
roles.addAll("developer")
timezone.set("Asia/Daejeon")
}
}
scm {
connection.set("scm:git:git://github.com/monull/command.git")
developerConnection.set("scm:git:ssh://github.com:monull/command.git")
url.set("https://github.com/monull/command")
}
}
}
}
}
signing {
isRequired = true
sign(tasks.jar.get(), tasks["sourcesJar"], tasks["dokkaJar"])
sign(publishing.publications["command"])
}