-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
144 lines (114 loc) · 3.56 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
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import xyz.jpenilla.resourcefactory.bukkit.BukkitPluginYaml
import xyz.jpenilla.resourcefactory.bukkit.bukkitPluginYaml
plugins {
kotlin("jvm") version "2.1.0"
id("io.papermc.paperweight.userdev") version "2.0.0-beta.14"
id("xyz.jpenilla.resource-factory-paper-convention") version "1.2.0"
id("com.gradleup.shadow") version "8.3.5"
id("maven-publish")
}
// build output location configuration
// both false = build to build/libs
val buildToMain = false
val buildToLobby = false
group = "foundation.esoteric"
version = "1.2.0"
description = "Required dependencies & core functionality for a Firework Wars server."
val paperApiVersion = "1.21.4"
val targetJavaVersion = 21
// authors
val rolyPolyVole = "rolyPolyVole"
val esotericEnderman = "Esoteric Enderman"
// plugin yml
val pluginName = "FireworkWarsCore"
val pluginAuthors = listOf(rolyPolyVole, esotericEnderman)
val pluginGithub = "https://github.com/fireworkwars/core-plugin"
val mainClassPath = "$group.fireworkwarscore.FireworkWarsCorePlugin"
repositories {
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/") {
name = "papermc-repo"
}
maven("https://oss.sonatype.org/content/groups/public/") {
name = "sonatype"
}
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
artifact(tasks.named("shadowJar").get()) {
classifier = null // Ensures it replaces the default JAR
}
groupId = group as String
version = rootProject.version as String
}
}
repositories {
maven {
name = "local"
url = uri("file://${rootProject.rootDir}/local-maven-repo")
}
}
}
dependencies {
paperweight.paperDevBundle("$paperApiVersion-R0.1-SNAPSHOT")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("org.apache.commons:commons-compress:1.26.0")
implementation("dev.jorel:commandapi-bukkit-shade-mojang-mapped:9.7.0")
api("fr.mrmicky:fastboard:2.1.3")
api("dev.triumphteam:triumph-gui:3.1.11")
}
kotlin {
jvmToolchain(targetJavaVersion)
compilerOptions {
optIn.add("kotlin.RequiresOptIn")
freeCompilerArgs.add("-Xjvm-default=all-compatibility")
}
}
tasks {
shadowJar {
minimize {
exclude(dependency("org.jetbrains.kotlin:kotlin-reflect"))
}
relocate("fr.mrmicky.fastboard", "foundation.esoteric.fireworkwarscore.libs.fastboard")
relocate("dev.triumphteam.gui", "foundation.esoteric.fireworkwarscore.libs.gui")
if (buildToMain) {
destinationDirectory.set(file("../firework-wars-plugin/run/plugins"))
} else if (buildToLobby) {
destinationDirectory.set(file("../firework-wars-lobby-plugin/run/plugins"))
}
}
build {
dependsOn(shadowJar)
}
assemble {
dependsOn(reobfJar)
}
compileJava {
options.encoding = Charsets.UTF_8.name()
options.release.set(21)
}
compileKotlin {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_21)
}
}
javadoc {
options.encoding = Charsets.UTF_8.name()
}
processResources {
filteringCharset = Charsets.UTF_8.name()
}
}
paperPluginYaml {
name = pluginName
description = project.description
authors = pluginAuthors
website = pluginGithub
apiVersion = paperApiVersion
main = mainClassPath
}
bukkitPluginYaml {
load = BukkitPluginYaml.PluginLoadOrder.STARTUP
}