This repository was archived by the owner on Mar 9, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
109 lines (96 loc) · 3.93 KB
/
build.gradle.kts
File metadata and controls
109 lines (96 loc) · 3.93 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
107
108
109
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
java
`java-library`
id("com.mineplex.sdk.plugin") version "1.21.10"
id("com.gradleup.shadow") version "9.1.0"
}
repositories {
mavenLocal()
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/")
}
dependencies {
// Mineplex BOM for dependency management
implementation(platform(libs.mineplex.bom))
// MongoDB driver for DataStorageModule
implementation(libs.mongodb.driver.sync)
// PostgreSQL JDBC driver for ManagedDBModule
implementation(libs.postgresql)
// MySQL JDBC driver for ManagedDBModule
implementation(libs.mysql)
// HikariCP connection pool for ManagedDBModule
implementation(libs.hikaricp)
// Caffeine cache for key field caching
implementation(libs.caffeine)
// Kafka clients for MessagingModule
implementation(libs.kafka.clients)
// Jackson YAML (only YAML, core Jackson comes from SDK)
implementation(libs.jackson.yaml)
// Test dependencies
testImplementation(libs.junit.jupiter)
testImplementation(libs.mockito.core)
testImplementation(libs.mockito.junit.jupiter)
}
group = "net.plexverse.enginebridge"
version = "1.2.8"
description = "engine-bridge"
tasks {
build {
dependsOn(withType<ShadowJar>())
}
processResources {
filesMatching("plugin.yml") {
filter { line ->
line.replace("@version@", project.version.toString())
}
}
}
named<ShadowJar>("shadowJar") {
archiveClassifier.set("all-local")
isZip64 = true
from(sourceSets.main.get().output)
configurations = listOf(project.configurations.runtimeClasspath.get())
// Include Mineplex SDK classes from compile classpath
project.configurations.compileClasspath.get().resolvedConfiguration.resolvedArtifacts
.filter { it.moduleVersion.id.group.startsWith("com.mineplex") }
.forEach { artifact ->
if (artifact.file.exists() && artifact.file.extension == "jar") {
from(project.zipTree(artifact.file)) {
include("com/mineplex/**")
exclude("META-INF/**")
}
}
}
// Include Jackson modules from SDK dependencies (they're transitive dependencies of the SDK)
// This includes all Jackson artifacts that are transitive dependencies
// EXCEPT jackson-datatype-jsr310 (JavaTimeModule) - we use the server's version to avoid version incompatibility
project.configurations.compileClasspath.get().resolvedConfiguration.resolvedArtifacts
.filter {
val group = it.moduleVersion.id.group
val name = it.moduleVersion.id.name
// Include all Jackson datatype, module, and dataformat artifacts
// BUT exclude jsr310 (JavaTimeModule) - use server's version instead
((group == "com.fasterxml.jackson.datatype") && name != "jackson-datatype-jsr310") ||
(group == "com.fasterxml.jackson.module") ||
(group == "com.fasterxml.jackson.dataformat" && name == "jackson-dataformat-yaml")
}
.forEach { artifact ->
if (artifact.file.exists() && artifact.file.extension == "jar") {
from(project.zipTree(artifact.file)) {
include("com/fasterxml/jackson/**")
exclude("META-INF/**")
}
}
}
mergeServiceFiles()
exclude("org/bukkit/**")
exclude("org/spigotmc/**")
exclude("io/papermc/**")
// Relocate Jackson YAML to avoid conflicts (SDK already includes core Jackson)
relocate(
"com.fasterxml.jackson.dataformat.yaml",
"net.plexverse.enginebridge.relocated.jackson.dataformat.yaml"
)
}
}