-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
149 lines (129 loc) · 5.7 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
149 lines (129 loc) · 5.7 KB
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
import io.papermc.hangarpublishplugin.model.Platforms
plugins {
id("java")
id("com.gradleup.shadow") version "9.6.1"
id("com.modrinth.minotaur") version "2.+"
id("io.papermc.hangar-publish-plugin") version "0.1.4"
id("io.papermc.paperweight.userdev") version "2.0.0-beta.21"
id("de.eldoria.plugin-yml.paper") version "0.9.0"
}
group = "net.thenextlvl.characters"
java {
toolchain.languageVersion = JavaLanguageVersion.of(25)
}
tasks.compileJava {
options.release.set(21)
}
configurations.compileClasspath {
attributes.attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 25)
}
repositories {
mavenCentral()
maven("https://repo.inventivetalent.org/repository/public/")
maven("https://repo.papermc.io/repository/maven-public/")
maven("https://repo.thenextlvl.net/releases")
maven("https://repo.thenextlvl.net/snapshots")
}
dependencies {
paperweight.paperDevBundle("26.2.build.92-stable")
implementation("net.thenextlvl.core:paper:3.0.0-pre5")
implementation("net.thenextlvl.version-checker:modrinth-paper:1.0.1")
implementation("net.thenextlvl:i18n:1.2.0")
implementation("org.mineskin:java-client-java11:3.2.6") {
exclude("com.google.code.gson", "gson")
exclude("com.google.guava", "guava")
}
implementation("dev.faststats.metrics:bukkit:0.23.0")
implementation("org.bstats:bstats-bukkit:3.2.1")
implementation(project(":api"))
testImplementation("org.junit.jupiter:junit-jupiter")
testImplementation(platform("org.junit:junit-bom:6.2.0-SNAPSHOT"))
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}
tasks.test {
useJUnitPlatform()
}
tasks.shadowJar {
minimize()
relocate("org.bstats", "net.thenextlvl.character.bstats")
relocate("org.mineskin", "net.thenextlvl.character.mineskin")
}
paper {
name = "Characters"
main = "net.thenextlvl.character.plugin.CharacterPlugin"
apiVersion = "26.1"
website = "https://thenextlvl.net"
authors = listOf("NonSwag")
// foliaSupported = true
permissions {
register("characters.admin") {
description = "Allows access to all characters commands"
children = listOf(
"characters.command.action",
"characters.command.action.add",
"characters.command.action.chance",
"characters.command.action.cooldown",
"characters.command.action.list",
"characters.command.action.permission",
"characters.command.action.remove",
"characters.command.attribute",
"characters.command.create",
"characters.command.delete",
"characters.command.equipment",
"characters.command.goal",
"characters.command.list",
"characters.command.save",
"characters.command.skin",
"characters.command.tag",
"characters.command.teleport",
"characters.command.view-permission"
)
}
register("characters.command")
register("characters.command.action") { children = listOf("characters.command") }
register("characters.command.action.add") { children = listOf("characters.command.action") }
register("characters.command.action.cooldown") { children = listOf("characters.command.action") }
register("characters.command.action.list") { children = listOf("characters.command.action") }
register("characters.command.action.permission") { children = listOf("characters.command.action") }
register("characters.command.action.remove") { children = listOf("characters.command.action") }
register("characters.command.attribute") { children = listOf("characters.command") }
register("characters.command.create") { children = listOf("characters.command") }
register("characters.command.delete") { children = listOf("characters.command") }
register("characters.command.equipment") { children = listOf("characters.command") }
register("characters.command.goal") { children = listOf("characters.command") }
register("characters.command.list") { children = listOf("characters.command") }
register("characters.command.save") { children = listOf("characters.command") }
register("characters.command.skin") { children = listOf("characters.command") }
register("characters.command.tag") { children = listOf("characters.command") }
register("characters.command.teleport") { children = listOf("characters.command") }
register("characters.command.view-permission") { children = listOf("characters.command") }
}
}
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("Characters")
version.set(versionString)
changelog = System.getenv("CHANGELOG")
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)
}
}
}
modrinth {
token.set(System.getenv("MODRINTH_TOKEN"))
projectId.set("oeBa7ep1")
changelog = System.getenv("CHANGELOG")
versionType = if (isRelease) "release" else "beta"
uploadFile.set(tasks.shadowJar)
gameVersions.set(versions)
syncBodyFrom.set(rootProject.file("README.md").readText())
loaders.add("paper")
}