forked from oraxen/oraxen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
173 lines (154 loc) · 7.43 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
import java.text.SimpleDateFormat
import java.time.Instant
import java.util.*
plugins {
id("java")
id("idea")
id("eclipse")
id("maven-publish")
id("com.github.johnrengelman.shadow") version "7.1.2"
id("xyz.jpenilla.run-paper") version "2.0.1"
id("net.minecrell.plugin-yml.bukkit") version "0.5.2" // Generates plugin.yml
}
val pluginVersion: String by project
group = "io.th0rgal"
version = pluginVersion
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}
repositories {
mavenCentral()
maven("https://papermc.io/repo/repository/maven-public/") // Paper
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") // Spigot
maven("https://oss.sonatype.org/content/repositories/snapshots") // Because Spigot depends on Bungeecord ChatComponent-API
maven("https://jitpack.io") // JitPack
maven("https://repo.mineinabyss.com/releases") // ModelEngine
maven("https://repo.dmulloy2.net/repository/public/") // ProtocolLib
maven("https://libraries.minecraft.net/") // Minecraft repo (commodore)
maven("https://repo.extendedclip.com/content/repositories/placeholderapi/") // PlaceHolderAPI
maven("https://maven.elmakers.com/repository/") // EffectLib
maven("https://hub.jeff-media.com/nexus/repository/jeff-media-public/") // CustomBlockData
maven("https://repo.triumphteam.dev/snapshots") // actions-code, actions-spigot
maven("https://mvn.lumine.io/repository/maven-public/") // MythicMobs
maven("https://mvn.lumine.io/repository/maven/") // PlayerAnimator
maven("https://s01.oss.sonatype.org/content/repositories/snapshots") // commandAPI snapshots
maven("https://maven.enginehub.org/repo/")
}
dependencies {
val actionsVersion = "1.0.0-SNAPSHOT"
compileOnly("org.spigotmc:spigot-api:1.19.3-R0.1-SNAPSHOT")
compileOnly("io.papermc.paper:paper-api:1.19.3-R0.1-SNAPSHOT") { exclude(group = "net.kyori") }
compileOnly("com.comphenix.protocol:ProtocolLib:5.0.0-SNAPSHOT")
compileOnly("me.clip:placeholderapi:2.11.2")
compileOnly("com.github.BeYkeRYkt:LightAPI:5.3.0-Bukkit")
compileOnly("me.gabytm.util:actions-core:$actionsVersion")
compileOnly("org.springframework:spring-expression:6.0.3")
compileOnly("io.lumine:Mythic-Dist:5.2.0-SNAPSHOT")
compileOnly("io.lumine:MythicCrucible:1.6.0-SNAPSHOT")
compileOnly("com.sk89q.worldedit:worldedit-bukkit:7.2.0")
compileOnly("commons-io:commons-io:2.11.0")
compileOnly("com.ticxo:modelengine:R3.0.1")
compileOnly(fileTree(mapOf("dir" to "libs/compile", "include" to listOf("*.jar"))))
implementation("dev.triumphteam:triumph-gui:3.1.2")
implementation("org.bstats:bstats-bukkit:3.0.0")
implementation("com.github.oraxen:protectionlib:1.2.3")
implementation("net.kyori:adventure-text-minimessage:4.13.0-SNAPSHOT")
implementation("net.kyori:adventure-text-serializer-plain:4.13.0-SNAPSHOT")
implementation("net.kyori:adventure-text-serializer-legacy:4.13.0-SNAPSHOT")
implementation("net.kyori:adventure-text-serializer-gson:4.13.0-SNAPSHOT")
implementation("net.kyori:adventure-platform-bukkit:4.2.0")
implementation("com.github.stefvanschie.inventoryframework:IF:0.10.8")
implementation("dev.jorel:commandapi-shade:8.7.6")
implementation("com.jeff_media:CustomBlockData:2.2.0")
implementation("com.jeff_media:MorePersistentDataTypes:2.3.1")
implementation("gs.mclo:mclogs:2.1.1")
implementation("com.ticxo.playeranimator:PlayerAnimator:R1.2.5")
implementation("me.gabytm.util:actions-spigot:$actionsVersion") { exclude(group = "com.google.guava") }
}
tasks {
compileJava {
options.encoding = Charsets.UTF_8.name()
options.release.set(17)
}
javadoc {
options.encoding = Charsets.UTF_8.name()
}
processResources {
filesNotMatching(listOf("**/*.png", "**/*.ogg", "**/models/**", "**/textures/**", "**/font/**.json", "**/plugin.yml")) {
expand(mapOf(project.version.toString() to pluginVersion))
}
duplicatesStrategy = DuplicatesStrategy.INCLUDE
filteringCharset = Charsets.UTF_8.name()
}
runServer {
minecraftVersion("1.19.3")
}
shadowJar {
//archiveClassifier = null
relocate("org.bstats", "io.th0rgal.oraxen.shaded.bstats")
relocate("net.kyori", "io.th0rgal.oraxen.shaded.kyori")
relocate("dev.triumphteam.gui", "io.th0rgal.oraxen.shaded.triumphteam.gui")
relocate("com.jeff_media.customblockdata", "io.th0rgal.oraxen.shaded.customblockdata")
relocate("com.jeff_media.morepersistentdatatypes", "io.th0rgal.oraxen.shaded.morepersistentdatatypes")
relocate("com.github.stefvanschie.inventoryframework", "io.th0rgal.oraxen.shaded.if")
relocate("dev.jorel.commandapi", "io.th0rgal.oraxen.shaded.commandapi")
relocate("me.gabytm.util.actions", "io.th0rgal.oraxen.shaded.actions")
relocate("org.intellij.lang.annotations", "io.th0rgal.oraxen.shaded.intellij.annotations")
relocate("org.jetbrains.annotations", "io.th0rgal.oraxen.shaded.jetbrains.annotations")
relocate("com.udojava.evalex", "io.th0rgal.oraxen.shaded.evalex")
relocate("com.ticxo.playeranimator", "io.th0rgal.oraxen.shaded.playeranimator")
//mapOf("dir" to "libs/compile", "include" to listOf("*.jar"))
manifest {
attributes(
mapOf(
"Built-By" to System.getProperty("user.name"),
"Version" to pluginVersion,
"Build-Timestamp" to SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss.SSSZ").format(Date.from(Instant.now())),
"Created-By" to "Gradle ${gradle.gradleVersion}",
"Build-Jdk" to "${System.getProperty("java.version")} ${System.getProperty("java.vendor")} ${System.getProperty("java.vm.version")}",
"Build-OS" to "${System.getProperty("os.name")} ${System.getProperty("os.arch")} ${System.getProperty("os.version")}"
)
)
}
archiveFileName.set("oraxen-${pluginVersion}.jar")
minimize()
}
compileJava.get().dependsOn(clean)
build.get().dependsOn(shadowJar)
}
bukkit {
load = net.minecrell.pluginyml.bukkit.BukkitPluginDescription.PluginLoadOrder.STARTUP
main = "io.th0rgal.oraxen.OraxenPlugin"
version = pluginVersion
name = "Oraxen"
apiVersion = "1.18"
authors = listOf("th0rgal", "boy0000")
softDepend = listOf("LightAPI", "PlaceholderAPI", "MythicMobs", "MMOItems", "MythicCrucible", "BossShopPro", "CrateReloaded", "ItemBridge", "WorldEdit", "WorldGuard", "Towny", "Factions", "Lands", "PlotSquared", "NBTAPI", "ModelEngine")
depend = listOf("ProtocolLib")
loadBefore = listOf("Realistic_World")
libraries = listOf("org.springframework:spring-expression:5.3.16", "org.apache.httpcomponents:httpmime:4.5.13")
}
publishing {
publications {
register<MavenPublication>("maven") {
from(components.getByName("java"))
}
}
}
val pluginPath = project.findProperty("oraxen_plugin_path")
if (pluginPath != null) {
tasks {
register<Copy>("copyJar") {
from(findByName("reobfJar") ?: findByName("shadowJar") ?: findByName("jar"))
into(pluginPath)
doLast {
println(pluginVersion)
println("Copied to plugin directory $pluginPath")
println(version)
}
}
named<DefaultTask>("build") {
dependsOn("copyJar")
}
}
}