generated from FairyProject/fairy-bukkit-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
executable file
·89 lines (74 loc) · 2.92 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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
fun properties(key: String) = project.findProperty(key).toString()
plugins {
// Java plugin
id("java-library")
// Fairy plugin
id("io.fairyproject")
// Dependency management plugin
id("io.spring.dependency-management") version "1.1.0"
//Kotlin plugin
id("org.jetbrains.kotlin.jvm") version "1.9.23" apply false
//Shadow plugin, provides the ability to shade fairy and other dependencies to compiled jar
id("com.github.johnrengelman.shadow") version "7.1.2"
}
group = properties("group")
version = properties("version")
// Fairy configuration
fairy {
name.set(properties("name"))
// Main Package
mainPackage.set(properties("package"))
// Fairy Package
fairyPackage.set("io.fairyproject")
bukkitProperties().bukkitApi = "1.13"
bukkitProperties().foliaSupported = true
bukkitProperties().description = "Fairy framework in library form"
}
runServer {
version.set(properties("spigot.version"))
}
dependencies {
runtimeOnly("io.fairyproject:bukkit-bootstrap")
api("io.fairyproject:bukkit-platform")
api("io.fairyproject:mc-animation")
api("io.fairyproject:bukkit-command")
api("io.fairyproject:bukkit-gui")
api("io.fairyproject:mc-hologram")
api("io.fairyproject:core-config")
api("io.fairyproject:bukkit-xseries")
api("io.fairyproject:bukkit-items")
api("io.fairyproject:mc-nametag")
api("io.fairyproject:mc-sidebar")
api("io.fairyproject:bukkit-visibility")
api("io.fairyproject:bukkit-visual")
api("io.fairyproject:bukkit-timer")
api("io.fairyproject:bukkit-nbt")
api("io.fairyproject:mc-tablist")
}
// Repositories
repositories {
mavenCentral()
maven(url = uri("https://oss.sonatype.org/content/repositories/snapshots/"))
maven(url = uri("https://repo.codemc.io/repository/maven-public/"))
// Spigot's repository for spigot api dependency
maven(url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots/"))
maven(url = uri("https://repo.imanity.dev/imanity-libraries"))
}
// Dependencies
dependencies {
// Spigot dependency
compileOnly("org.spigotmc:spigot-api:${properties("spigot.version")}-R0.1-SNAPSHOT")
}
tasks.withType(ShadowJar::class.java) {
// Relocate fairy to avoid plugin conflict
relocate("net.kyori", "io.fairyproject.libs.kyori")
relocate("com.cryptomorin.xseries", "io.fairyproject.libs.xseries")
relocate("org.yaml.snakeyaml", "io.fairyproject.libs.snakeyaml")
relocate("com.google.gson", "io.fairyproject.libs.gson")
relocate("com.github.retrooper.packetevents", "io.fairyproject.libs.packetevents")
relocate("io.github.retrooper.packetevents", "io.fairyproject.libs.packetevents")
relocate("io.fairyproject.bootstrap", "io.fairyproject.library.bootstrap")
relocate("de.tr7zw.changeme.nbtapi", "io.faryprojects.libs.nbtapi")
archiveFileName.set("fairy-lib-plugin.jar")
}