forked from HMJosh/DeathMessages
-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.gradle.kts
190 lines (160 loc) · 5.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
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
plugins {
`java-library`
`maven-publish`
id("com.gradleup.shadow") version "8.3.5"
id("com.willfp.libreforge-gradle-plugin") version "1.0.2"
}
group = "dev.mrshawn"
version = "1.4.20-SNAPSHOT"
repositories {
mavenCentral()
// PaperMC
maven {
name = "papermc-repo"
url = uri("https://repo.papermc.io/repository/maven-public/")
}
// Eco
maven {
name = "auxilor-repo"
url = uri("https://repo.auxilor.io/repository/maven-public/")
}
}
allprojects {
apply(plugin = "java")
apply(plugin = "maven-publish")
apply(plugin = "com.gradleup.shadow")
repositories {
mavenCentral()
flatDir {
dirs("./libs")
}
// PaperMC
maven {
name = "papermc-repo"
url = uri("https://repo.papermc.io/repository/maven-public/")
}
// PlaceholderAPI
maven {
name = "placeholderapi-repo"
url = uri("https://repo.extendedclip.com/content/repositories/placeholderapi/")
}
// CodeMC-NMS
maven {
name = "codemc-nms-repo"
url = uri("https://repo.codemc.io/repository/nms/")
}
// NBT-API
maven {
name = "codemc-repo"
url = uri("https://repo.codemc.org/repository/maven-public/")
}
// Eco
maven {
name = "auxilor-repo"
url = uri("https://repo.auxilor.io/repository/maven-public/")
}
// JitPack
maven {
name = "jitpack.io"
url = uri("https://jitpack.io")
}
// DiscordSRV
maven {
name = "Scarsz-Nexus"
url = uri("https://nexus.scarsz.me/content/groups/public/")
}
// CombatLogX
maven {
name = "sirblobman-public"
url = uri("https://nexus.sirblobman.xyz/public/")
}
// SayanVanish
maven {
name = "sayanvanish-repo"
url = uri("https://repo.sayandev.org/snapshots")
}
// sk89q's
maven {
name = "sk89q-repo"
url = uri("https://maven.enginehub.org/repo/")
}
// Lumine's
maven {
name = "Lumine Releases"
url = uri("https://mvn.lumine.io/repository/maven-public/")
}
// FoliaLib
maven {
name = "devmart-other"
url = uri("https://nexuslite.gcnt.net/repos/other/")
}
// worldguard-legacy
maven {
name = "minebench-repo"
url = uri("https://repo.minebench.de/")
}
}
configure<JavaPluginExtension> {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
tasks {
compileJava {
options.encoding = "UTF-8"
}
shadowJar {
archiveFileName = "${rootProject.name}-${rootProject.version}.${archiveExtension.get()}"
exclude("META-INF/**") // Dreeam - Avoid to include META-INF/maven in Jar
// minimize {
// exclude(dependency("com.tcoded.folialib:.*:.*"))
// }
relocate("kotlin", "dev.mrshawn.deathmessages.libs.kotlin")
//relocate("com.google.gson", "dev.mrshawn.deathmessages.libs.gson") // Don't relocate to avoid item hover issue
//relocate("com.google.auto", "dev.mrshawn.deathmessages.libs.auto") // Don't relocate to avoid item hover issue
//relocate("net.kyori", "dev.mrshawn.deathmessages.libs.kyori") // Don't relocate to avoid item hover issue
relocate("com.cryptomorin.xseries", "dev.mrshawn.deathmessages.libs.xseries")
relocate("org.bstats", "dev.mrshawn.deathmessages.libs.bstats")
relocate("com.tcoded.folialib", "dev.mrshawn.deathmessages.libs.folialib")
relocate("de.tr7zw.changeme.nbtapi", "dev.mrshawn.deathmessages.libs.nbtapi")
relocate("net.dv8tion.jda", "dev.mrshawn.deathmessages.libs.jda")
}
processResources {
filesMatching("**/plugin.yml") {
expand(
"version" to rootProject.version
)
}
}
build {
dependsOn(shadowJar)
}
}
}
tasks {
libreforgeJar {
dependsOn("jar")
}
build {
doLast {
val plugin = project(":Core")
val file = file("${plugin.layout.buildDirectory.get()}/libs").listFiles()
?.find { it.name.startsWith(rootProject.name) }
delete("bin")
delete("build/libs")
file?.copyTo(file("${rootProject.layout.buildDirectory.get()}/libs/${rootProject.name}-${rootProject.version}.jar"), true)
listOf(
":Core",
":Hooks:WorldGuard", ":Hooks:WorldGuard6", ":Hooks:WorldGuard7",
":NMS:V1_20_6", ":NMS:V1_21", ":NMS:Wrapper",
).forEach {
delete(project(it).layout.buildDirectory.get())
}
}
dependsOn(project(":Core").tasks.build)
}
}
publishing {
publications.create<MavenPublication>("maven") {
from(components["java"])
}
}