-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
312 lines (279 loc) · 11.9 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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
import io.papermc.hangarpublishplugin.model.Platforms
import net.minecrell.pluginyml.bukkit.BukkitPluginDescription
import net.minecrell.pluginyml.paper.PaperPluginDescription
plugins {
id("java")
id("io.github.goooler.shadow") version "8.1.8"
id("io.papermc.hangar-publish-plugin") version "0.1.2"
id("net.minecrell.plugin-yml.paper") version "0.6.0"
}
group = "net.thenextlvl.economist"
version = "0.2.0"
java {
toolchain.languageVersion = JavaLanguageVersion.of(21)
}
tasks.compileJava {
options.release.set(21)
}
repositories {
mavenCentral()
maven("https://repo.thenextlvl.net/releases")
maven("https://repo.papermc.io/repository/maven-public/")
}
dependencies {
compileOnly("io.papermc.paper:paper-api:1.21.4-R0.1-SNAPSHOT")
compileOnly("net.thenextlvl.services:service-io:2.2.0")
compileOnly("org.projectlombok:lombok:1.18.36")
implementation("net.thenextlvl.core:i18n:1.0.20")
implementation("net.thenextlvl.core:files:2.0.1")
implementation("net.thenextlvl.core:paper:2.0.3")
implementation("org.bstats:bstats-bukkit:3.1.0")
implementation(project(":api"))
testImplementation(platform("org.junit:junit-bom:5.11.4"))
testImplementation("org.junit.jupiter:junit-jupiter")
annotationProcessor("org.projectlombok:lombok:1.18.36")
}
tasks.shadowJar {
relocate("org.bstats", "${rootProject.group}.metrics")
}
tasks.test {
useJUnitPlatform()
}
paper {
name = "Economist"
main = "net.thenextlvl.economist.EconomistPlugin"
author = "NonSwag"
apiVersion = "1.21"
foliaSupported = true
website = "https://thenextlvl.net"
serverDependencies {
register("ServiceIO") {
load = PaperPluginDescription.RelativeLoadOrder.BEFORE
required = false
}
}
permissions {
register("economist.bank.admin") {
default = BukkitPluginDescription.Permission.Default.OP
description = "Admin permission to manage banks."
children = listOf(
"economist.bank.create.others",
"economist.bank.delete.others",
"economist.bank.manage.others",
)
}
register("economist.account.create") {
default = BukkitPluginDescription.Permission.Default.OP
description = "Allows players to create accounts."
children = listOf("economist.account")
}
register("economist.account.create.others") {
default = BukkitPluginDescription.Permission.Default.OP
description = "Allows players to create accounts for others."
children = listOf("economist.account.create")
}
register("economist.account.create.world") {
default = BukkitPluginDescription.Permission.Default.OP
description = "Allows players to create accounts in specific worlds."
children = listOf("economist.account.create.others")
}
register("economist.account.delete") {
default = BukkitPluginDescription.Permission.Default.OP
description = "Allows players to delete accounts."
children = listOf("economist.account")
}
register("economist.account.delete.others") {
default = BukkitPluginDescription.Permission.Default.OP
description = "Allows players to delete accounts for others."
children = listOf("economist.account.delete")
}
register("economist.account.delete.world") {
default = BukkitPluginDescription.Permission.Default.OP
description = "Allows players to delete accounts in specific worlds."
children = listOf("economist.account.delete.others")
}
register("economist.account.prune") {
default = BukkitPluginDescription.Permission.Default.OP
description = "Prune accounts that haven't been used in a while."
children = listOf("economist.account")
}
register("economist.account") {
description = "Allows players to use accounts."
}
register("economist.bank.manage.others") {
default = BukkitPluginDescription.Permission.Default.OP
description = "Allows players to manage others' banks."
children = listOf(
"economist.bank.deposit.others",
"economist.bank.withdraw.others",
"economist.bank.info.others",
"economist.bank.manage"
)
}
register("economist.bank.info.others") {
default = BukkitPluginDescription.Permission.Default.OP
description = "Allows players to view others' banks info."
children = listOf(
"economist.bank.balance.others",
"economist.bank.movements.others",
"economist.bank.info",
"economist.bank-top"
)
}
register("economist.bank.balance.others") {
default = BukkitPluginDescription.Permission.Default.OP
description = "Allows players to view others' banks balance."
children = listOf("economist.bank.balance")
}
register("economist.bank.create.others") {
default = BukkitPluginDescription.Permission.Default.OP
description = "Allows players to create banks for others."
children = listOf("economist.bank.create")
}
register("economist.bank.delete.others") {
default = BukkitPluginDescription.Permission.Default.OP
description = "Allows players to delete others' banks."
children = listOf("economist.bank.delete")
}
register("economist.bank.movements.others") {
default = BukkitPluginDescription.Permission.Default.OP
description = "Allows players to view others' banks movements."
children = listOf("economist.bank.movements")
}
register("economist.bank.withdraw.others") {
default = BukkitPluginDescription.Permission.Default.OP
description = "Allows players to withdraw money from others' banks."
children = listOf("economist.bank.withdraw")
}
register("economist.bank.deposit.others") {
default = BukkitPluginDescription.Permission.Default.OP
description = "Allows players to deposit money into others' banks."
children = listOf("economist.bank.deposit")
}
register("economist.bank.transfer.others") {
default = BukkitPluginDescription.Permission.Default.OP
description = "Allows players to transfer money between others' banks."
children = listOf("economist.bank.transfer")
}
register("economist.bank.manage") {
default = BukkitPluginDescription.Permission.Default.TRUE
description = "Allows players to manage their bank."
children = listOf(
"economist.bank.movements",
"economist.bank.deposit",
"economist.bank.transfer",
"economist.bank.withdraw"
)
}
register("economist.bank-top") {
default = BukkitPluginDescription.Permission.Default.OP
description = "Allows players to view the bank top list."
children = listOf("economist.bank.balance.others")
}
register("economist.bank.info") {
description = "Allows players to view bank info."
children = listOf("economist.bank.balance")
}
register("economist.bank.balance") {
description = "Allows players to view their bank's balance."
children = listOf("economist.bank")
}
register("economist.bank.create") {
description = "Allows players to create banks."
children = listOf("economist.bank")
}
register("economist.bank.delete") {
description = "Allows players to delete their bank."
children = listOf("economist.bank")
}
register("economist.bank.deposit") {
description = "Allows players to deposit money into their bank."
children = listOf("economist.bank")
}
register("economist.bank.withdraw") {
description = "Allows players to withdraw money from their bank."
children = listOf("economist.bank")
}
register("economist.bank.movements") {
description = "Allows players to view bank movements."
children = listOf("economist.bank")
}
register("economist.bank.transfer") {
description = "Allows players to transfer money between banks."
children = listOf("economist.bank")
}
register("economist.bank") {
description = "Allows players to use banks."
}
register("economist.admin") {
default = BukkitPluginDescription.Permission.Default.OP
description = "Admin permission to manage the economy."
children = listOf(
"economist.account.create.others",
"economist.account.delete.others",
"economist.account.prune",
"economist.balance-top.world",
"economist.pay.world",
"economist.loan"
)
}
register("economist.balance.world") {
default = BukkitPluginDescription.Permission.Default.OP
description = "Allows players to see other players' balances in specific worlds."
children = listOf("economist.balance.others")
}
register("economist.balance.others") {
default = BukkitPluginDescription.Permission.Default.OP
description = "Allows players to see other players' balances."
children = listOf("economist.balance")
}
register("economist.balance") {
default = BukkitPluginDescription.Permission.Default.TRUE
description = "Allows players to see their balance."
}
register("economist.balance-top.world") {
default = BukkitPluginDescription.Permission.Default.OP
children = listOf("economist.balance-top", "economist.balance.world")
description = "Allows players to see the balance top list of specific worlds."
}
register("economist.balance-top") {
children = listOf("economist.balance.others")
description = "Allows players to see the balance top list."
}
register("economist.pay.world") {
default = BukkitPluginDescription.Permission.Default.OP
children = listOf("economist.pay")
description = "Allows players to make payments to specific worlds."
}
register("economist.pay") {
default = BukkitPluginDescription.Permission.Default.TRUE
description = "Allows players to make payments."
}
register("economist.loan") {
default = BukkitPluginDescription.Permission.Default.OP
description = "Allows players to loan money when making payments with insufficient funds."
}
}
}
val versionString: String = project.version as String
val isRelease: Boolean = !versionString.contains("-pre")
val versions: List<String> = (property("gameVersions") as String)
.split(",")
.map { it.trim() }
hangarPublish { // docs - https://docs.papermc.io/misc/hangar-publishing
publications.register("plugin") {
id.set("Economist")
version.set(versionString)
channel.set(if (isRelease) "Release" else "Snapshot")
apiKey.set(System.getenv("HANGAR_API_TOKEN"))
platforms.register(Platforms.PAPER) {
jar.set(tasks.shadowJar.flatMap { it.archiveFile })
platformVersions.set(versions)
dependencies {
url("ServiceIO", "https://hangar.papermc.io/TheNextLvl/ServiceIO") {
required.set(false)
}
}
}
}
}