-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
113 lines (97 loc) · 4.31 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
import io.papermc.hangarpublishplugin.model.Platforms
import net.minecrell.pluginyml.paper.PaperPluginDescription
plugins {
id("java")
id("com.gradleup.shadow") version "9.0.0-beta9"
id("io.papermc.hangar-publish-plugin") version "0.1.2"
id("io.papermc.paperweight.userdev") version "2.0.0-beta.14"
id("de.eldoria.plugin-yml.paper") version "0.7.1"
}
group = "net.thenextlvl.characters"
version = "0.1.1"
java {
toolchain.languageVersion = JavaLanguageVersion.of(21)
}
tasks.compileJava {
options.release.set(21)
}
repositories {
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/")
maven("https://repo.thenextlvl.net/releases")
maven("https://repo.inventivetalent.org/repository/public/")
}
dependencies {
paperweight.paperDevBundle("1.21.4-R0.1-SNAPSHOT")
implementation("net.thenextlvl.core:i18n:1.0.20")
implementation("net.thenextlvl.core:paper:2.0.3")
implementation("org.bstats:bstats-bukkit:3.1.0")
implementation("org.mineskin:java-client-java11:3.0.2-SNAPSHOT") {
exclude("com.google.code.gson", "gson")
exclude("com.google.guava", "guava")
}
implementation(project(":api"))
//testImplementation("io.papermc.paper:paper-api:1.21.4-R0.1-SNAPSHOT")
testImplementation("org.junit.jupiter:junit-jupiter")
testImplementation(platform("org.junit:junit-bom:5.12.1"))
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 = "1.21"
website = "https://thenextlvl.net"
authors = listOf("NonSwag")
foliaSupported = true
serverDependencies {
register("HologramAPI") {
load = PaperPluginDescription.RelativeLoadOrder.BEFORE
required = false
}
}
permissions {
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)
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)
}
}
}