This repository has been archived by the owner on Apr 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
/
build.gradle.kts
59 lines (50 loc) · 1.86 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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
java
id("com.github.johnrengelman.shadow") version "7.1.0"
}
allprojects {
apply(plugin = "java")
apply(plugin = "com.github.johnrengelman.shadow")
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
}
subprojects {
tasks.withType<ShadowJar> {
val platformName = project.name.capitalize()
archiveFileName.set("EpicGuard$platformName-${project.version}.jar")
relocate("org.spongepowered.configurate", "me.xneox.epicguard.libs.configurate")
relocate("org.apache.commons", "me.xneox.epicguard.libs.apachecommons")
relocate("com.fasterxml", "me.xneox.epicguard.libs.fasterxml")
relocate("com.maxmind", "me.xneox.epicguard.libs.maxmind")
relocate("com.google.common", "me.xneox.epicguard.libs.googlecommons")
relocate("com.typesafe.config", "me.xneox.epicguard.libs.config")
relocate("com.zaxxer.hikari", "me.xneox.epicguard.libs.hikari")
relocate("io.leangen.geantyref", "me.xneox.epicguard.libs.geantyref")
// Minimize, but exclude drivers shaded in the velocity platform.
minimize {
exclude(dependency("mysql:.*:.*"))
exclude(dependency("org.xerial:sqlite-jdbc:.*"))
}
// Copy compiled platform jars to '/build' directory for convenience.
doLast {
copy {
from(archiveFile)
into("${rootProject.projectDir}/build")
}
}
}
tasks.withType<JavaCompile> {
options.encoding = Charsets.UTF_8.name()
options.release.set(16)
}
// For Waterfall and Paper platforms: set version
tasks.withType<ProcessResources> {
filesMatching("plugin.yml") {
expand("version" to project.version)
}
}
}