forked from lavalink-devs/Lavalink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
83 lines (71 loc) · 2.38 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
plugins {
java
signing
`java-library`
`maven-publish`
kotlin("jvm")
}
val archivesBaseName = "protocol"
group = "dev.arbjerg.lavalink"
java {
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_11
withJavadocJar()
withSourcesJar()
}
dependencies {
compileOnly(libs.lavaplayer)
implementation(libs.kotlin.stdlib.jdk8)
implementation(libs.jackson.module.kotlin)
}
val isGpgKeyDefined = findProperty("signing.gnupg.keyName") != null
publishing {
publications {
create<MavenPublication>("Protocol") {
from(project.components["java"])
pom {
name.set("Lavalink Protocol")
description.set("Protocol for Lavalink Client development")
url.set("https://github.com/freyacodes/lavalink")
licenses {
license {
name.set("The MIT License")
url.set("https://github.com/freyacodes/Lavalink/blob/master/LICENSE")
}
}
developers {
developer {
id.set("freyacodes")
name.set("Freya Arbjerg")
url.set("https://www.arbjerg.dev")
}
}
scm {
connection.set("scm:git:ssh://github.com/freyacodes/lavalink.git")
developerConnection.set("scm:git:ssh://github.com/freyacodes/lavalink.git")
url.set("https://github.com/freyacodes/lavalink")
}
}
}
}
if (isGpgKeyDefined) {
repositories {
val snapshots = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
val releases = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
maven(if ((version as String).endsWith("SNAPSHOT")) snapshots else releases) {
credentials {
password = findProperty("ossrhPassword") as? String
username = findProperty("ossrhUsername") as? String
}
}
}
} else {
println("Not capable of publishing to OSSRH because of missing GPG key")
}
}
if (isGpgKeyDefined) {
signing {
sign(publishing.publications["Protocol"])
useGpgCmd()
}
}