-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
136 lines (117 loc) · 4.17 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
129
130
131
132
133
134
135
136
import java.time.Instant
plugins {
`java-library`
`maven-publish`
eclipse
idea
}
group = "com.github.milkdrinkers"
version = "2.0.0"
description = ""
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
withJavadocJar()
withSourcesJar()
}
repositories {
mavenCentral()
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") {
content {
includeGroup("org.bukkit")
includeGroup("org.spigotmc")
}
}
maven("https://oss.sonatype.org/content/repositories/snapshots") // Required for Spigots Bungeecord dependency
maven("https://oss.sonatype.org/content/repositories/central") // Required for Spigots Bungeecord dependency
maven("https://repo.extendedclip.com/content/repositories/placeholderapi/") {
content { includeGroup("me.clip") }
}
}
dependencies {
compileOnly("org.jetbrains:annotations:24.1.0")
annotationProcessor("org.jetbrains:annotations:24.1.0")
api("net.kyori:adventure-api:4.14.0")
api("net.kyori:adventure-text-minimessage:4.14.0")
api("net.kyori:adventure-text-serializer-gson:4.14.0")
api("net.kyori:adventure-text-serializer-legacy:4.14.0")
api("net.kyori:adventure-text-serializer-plain:4.14.0")
compileOnly("org.spigotmc:spigot-api:1.20.6-R0.1-SNAPSHOT")
compileOnly("me.clip:placeholderapi:2.11.6")
}
tasks {
compileJava {
options.encoding = Charsets.UTF_8.name()
options.release.set(8)
}
javadoc {
isFailOnError = false
val options = options as StandardJavadocDocletOptions
options.encoding = Charsets.UTF_8.name()
options.overview = "src/main/javadoc/overview.html"
options.isDocFilesSubDirs = true
options.tags("apiNote:a:API Note:", "implNote:a:Implementation Note:", "implSpec:a:Implementation Requirements:")
options.use()
}
}
// Apply custom version arg
val versionArg = if (hasProperty("customVersion"))
(properties["customVersion"] as String).uppercase() // Uppercase version string
else
"${project.version}-SNAPSHOT-${Instant.now().epochSecond}" // Append snapshot to version
// Strip prefixed "v" from version tag
project.version = if (versionArg.first().equals('v', true))
versionArg.substring(1)
else
versionArg.uppercase()
publishing {
publications {
create<MavenPublication>("maven") {
groupId = "${rootProject.group}"
artifactId = "colorparser"
version = "${rootProject.version}"
pom {
name.set("ColorParser")
description.set(rootProject.description.orEmpty())
url.set("https://github.com/milkdrinkers/ColorParser")
licenses {
license {
name.set("GNU General Public License version 3")
url.set("https://opensource.org/license/gpl-3-0/")
}
}
developers {
developer {
id.set("darksaid98")
name.set("darksaid98")
organization.set("Milkdrinkers")
organizationUrl.set("https://github.com/milkdrinkers")
}
}
scm {
connection.set("scm:git:git://github.com/milkdrinkers/ColorParser.git")
developerConnection.set("scm:git:ssh://github.com:milkdrinkers/ColorParser.git")
url.set("https://github.com/milkdrinkers/ColorParser")
}
}
from(components["java"])
}
}
repositories {
maven {
name = "releases"
url = uri("https://maven.athyrium.eu/releases")
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
maven {
name = "snapshots"
url = uri("https://maven.athyrium.eu/snapshots")
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
}
}