Files
hytale-gravity-flip/build.gradle.kts
T
kayjaydee b046f44ab5 feat(02-01): add GravityFlipRegion POJO + BuilderCodec with round-trip tests
- GravityFlipRegion holds Name (String) + Box (Hytale AABB) + Enabled (boolean),
  serialised through a BuilderCodec keyed on "Name"/"Box"/"Enabled".
- Validators.nonNull() applied to Name and Box (correct package is
  com.hypixel.hytale.codec.validation.Validators, not codec.builder).
- Server jar 2026.03.26 uses com.hypixel.hytale.math.vector.Vector3d for Box.min/max
  (NOT org.joml.Vector3d, which only appeared in newer builds).
- 3 JUnit 5 round-trip tests cover name/box/enabled, enabled=false, and empty name.
- testImplementation added for the Server artifact so codec encode/decode is
  reachable from unit tests.
2026-04-23 00:41:36 +02:00

77 lines
1.9 KiB
Kotlin

plugins {
id("java-library")
id("com.gradleup.shadow") version "9.3.1"
}
group = findProperty("pluginGroup") as String? ?: "com.mythlane"
version = findProperty("pluginVersion") as String? ?: "0.1.0"
description = findProperty("pluginDescription") as String? ?: "Hytale Gravity Flip"
val hytaleServerVersion: String by project
repositories {
mavenLocal()
mavenCentral()
maven {
name = "hytale"
url = uri("https://maven.hytale.com/release")
}
}
dependencies {
compileOnly("com.hypixel.hytale:Server:$hytaleServerVersion")
implementation("com.google.code.gson:gson:2.10.1")
implementation("org.jetbrains:annotations:24.1.0")
// Tests need the Hytale Server API (codecs, ExtraInfo, BsonValue) on the classpath.
testImplementation("com.hypixel.hytale:Server:$hytaleServerVersion")
testImplementation("org.junit.jupiter:junit-jupiter:5.10.0")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(25))
}
}
tasks {
compileJava {
options.encoding = Charsets.UTF_8.name()
options.release = 25
}
processResources {
filteringCharset = Charsets.UTF_8.name()
val props = mapOf(
"group" to project.group,
"version" to project.version,
"description" to project.description,
"hytaleServerVersion" to hytaleServerVersion
)
inputs.properties(props)
filesMatching("manifest.json") {
expand(props)
}
}
shadowJar {
archiveBaseName.set("hytale-gravity-flip")
archiveClassifier.set("")
relocate("com.google.gson", "com.mythlane.gravityflip.libs.gson")
}
jar {
enabled = false
}
build {
dependsOn(shadowJar)
}
test {
useJUnitPlatform()
}
}