-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.gradle.kts
128 lines (103 loc) · 3.44 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
import dev.kord.x.emoji.EmojiPlugin
import de.undercouch.gradle.tasks.download.org.apache.commons.codec.binary.Base64
version = Library.version
group = Library.group
plugins {
kotlin("jvm") version Versions.kotlin
signing
`maven-publish`
id("io.codearte.nexus-staging") version "0.30.0"
}
repositories {
mavenCentral()
maven("https://oss.sonatype.org/content/repositories/snapshots")
}
dependencies {
implementation("dev.kord:kord-core:${Versions.kordRange}") {
/*
version {
prefer("latest.integration")
}
*/
}
testImplementation("org.jetbrains.kotlin:kotlin-test")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit")
}
tasks.compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
apply<EmojiPlugin>()
val sourcesJar by tasks.registering(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets.main.get().allSource)
}
val javadocJar by tasks.registering(Jar::class) {
group = JavaBasePlugin.DOCUMENTATION_GROUP
archiveClassifier.set("javadoc")
}
tasks.withType<PublishToMavenRepository>().configureEach {
doFirst { require(!Library.isUndefined) { "No release/snapshot version found." } }
}
publishing {
publications {
create<MavenPublication>(Library.name) {
from(components["kotlin"])
groupId = Library.group
artifactId = Library.name
version = Library.version
artifact(sourcesJar.get())
pom {
name.set(Library.name)
description.set(Library.description)
url.set(Library.description)
organization {
name.set("Kord")
url.set(Library.projectUrl)
}
developers {
developer {
name.set("The Kord Team")
}
}
issueManagement {
system.set("GitHub")
url.set("${Library.projectUrl}/issues")
}
licenses {
license {
name.set("MIT")
url.set("https://opensource.org/licenses/MIT")
}
}
scm {
connection.set("scm:git:ssh://github.com/kordlib/kordx.emoji.git")
developerConnection.set("scm:git:ssh://[email protected]:kordlib/kordx.emoji.git")
url.set(Library.projectUrl)
}
}
if (!isJitPack) {
repositories {
maven {
url = if (Library.isSnapshot) uri(Repo.snapshotsUrl)
else uri(Repo.releasesUrl)
credentials {
username = System.getenv("NEXUS_USER")
password = System.getenv("NEXUS_PASSWORD")
}
}
}
}
}
}
}
if (!isJitPack && Library.isRelease) {
signing {
val signingKey = findProperty("signingKey")?.toString()
val signingPassword = findProperty("signingPassword")?.toString()
if (signingKey != null && signingPassword != null) {
useInMemoryPgpKeys(String(Base64().decode(signingKey.toByteArray())), signingPassword)
}
sign(publishing.publications[Library.name])
}
}
nexusStaging { }