-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
106 lines (78 loc) · 2.97 KB
/
build.gradle.kts
File metadata and controls
106 lines (78 loc) · 2.97 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
import java.io.ByteArrayOutputStream
plugins {
java
id("com.gradleup.shadow") version ("9.3.0")
id("io.papermc.paperweight.userdev") version ("2.0.0-beta.19")
}
group = "me.zetastormy"
description = "A modern Minecraft server hub core solution. Based on DeluxeHub by ItsLewizzz."
version = buildString {
fun git(vararg args: String): String {
return providers.exec {
commandLine("git", *args)
}.standardOutput.asText.get().trim()
}
val latestTag = git("describe", "--tags", "--abbrev=0").replace("v", "")
append(latestTag)
val branchName = git("rev-parse", "--abbrev-ref", "HEAD")
if (branchName != "stable" && !branchName.startsWith("release")) {
val commitHash = git("rev-parse", "--short", "HEAD")
append("+").append(commitHash)
val gitStatus = git("status", "--porcelain")
if (!gitStatus.isEmpty()) {
append(".dirty")
}
}
}
val scoreboardLibraryVersion = "2.4.4"
val libsPackage = property("libsPackage") as String
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
}
repositories {
maven("https://oss.sonatype.org/content/groups/public/")
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/")
maven("https://repo.codemc.org/repository/maven-public")
maven("https://repo.extendedclip.com/content/repositories/placeholderapi/")
maven("https://jitpack.io")
}
dependencies {
paperweight.paperDevBundle("1.21.6-R0.1-SNAPSHOT")
implementation("javax.inject:javax.inject:1")
implementation("net.megavex:scoreboard-library-api:$scoreboardLibraryVersion")
runtimeOnly("net.megavex:scoreboard-library-implementation:$scoreboardLibraryVersion")
runtimeOnly("net.megavex:scoreboard-library-modern:$scoreboardLibraryVersion:mojmap")
compileOnly(platform("net.kyori:adventure-bom:4.23.0"))
compileOnly("net.kyori:adventure-text-minimessage")
compileOnly("net.kyori:adventure-api")
compileOnly("me.clip:placeholderapi:2.11.7")
compileOnly("com.arcaniax:HeadDatabase-API:1.3.2")
// Dependency downloaded at runtime, also change
// the version in AkropolisPluginLoader.java
// when upgrading
compileOnly("com.github.cryptomorin:XSeries:13.6.0")
compileOnly("io.github.miniplaceholders:miniplaceholders-api:3.1.0")
compileOnly("com.github.koca2000:NoteBlockAPI:1.6.3")
}
configurations.implementation {
exclude("org.bukkit", "bukkit")
}
tasks {
val projectVersion = project.version.toString()
processResources {
filesMatching("paper-plugin.yml") {
expand("version" to projectVersion)
}
}
shadowJar {
archiveClassifier.set("")
archiveFileName.set("Akropolis-${projectVersion}.jar")
minimize {
exclude(dependency("net.megavex:.*:.*"))
}
relocate("net.megavex.scoreboardlibrary", "${libsPackage}.scoreboardlibrary")
}
withType<JavaCompile> {
options.encoding = "UTF-8"
}
}