Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build
on:
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: "21"
distribution: "temurin"
cache: "gradle"

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew build --no-daemon --stacktrace

8 changes: 4 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,21 @@ jobs:
with:
distribution: temurin
java-version: "21"
cache: gradle

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4

- name: Make Gradle wrapper executable
run: chmod +x ./gradlew

- name: Build Dokka (multi-module)
run: ./gradlew dokkaHtmlMultiModule --no-daemon
- name: Build Dokka (single-module)
run: ./gradlew dokkaHtml --no-daemon

- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: build/dokka/htmlMultiModule
path: build/dokka/html

deploy:
needs: build
Expand All @@ -52,4 +53,3 @@ jobs:
id: deployment
uses: actions/deploy-pages@v4


18 changes: 0 additions & 18 deletions .woodpecker/build.yml

This file was deleted.

165 changes: 79 additions & 86 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,113 +1,106 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.gradle.api.plugins.JavaPluginExtension
import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.api.tasks.testing.Test
import java.util.Calendar
import java.util.TimeZone

plugins {
// Root is an aggregator. Subprojects apply Kotlin + publishing.
kotlin("jvm") version "2.2.21" apply false
kotlin("plugin.serialization") version "2.2.21" apply false
// Match real plugin projects: allow Kotlin version to be controlled externally (e.g. via gradle.properties systemProp.kotlin_version).
val kotlin_version: String by System.getProperties()
kotlin("jvm").version(kotlin_version)
`java-library`
`maven-publish`
id("org.jetbrains.dokka") version "2.0.0"
}

allprojects {
group = "cc.modlabs"
version = System.getenv("VERSION_OVERRIDE") ?: Calendar.getInstance(TimeZone.getTimeZone("UTC")).run {
"${get(Calendar.YEAR)}.${get(Calendar.MONTH) + 1}.${get(Calendar.DAY_OF_MONTH)}.${
String.format("%02d%02d", get(Calendar.HOUR_OF_DAY), get(Calendar.MINUTE))
}"
}
group = "cc.modlabs"
version = System.getenv("VERSION_OVERRIDE") ?: "1.0-SNAPSHOT"

repositories {
maven("https://nexus.modlabs.cc/repository/maven-mirrors/")
}
repositories {
maven("https://nexus.modlabs.cc/repository/maven-mirrors/")
}

subprojects {
apply(plugin = "org.jetbrains.kotlin.jvm")
apply(plugin = "java-library")
apply(plugin = "maven-publish")
apply(plugin = "org.jetbrains.dokka")
// Root build only wires compilation + testing.
// Publishing is configured per-module later (kept out of root to avoid Gradle plugin ordering pitfalls).
dependencies {
// Provided by the Hytale server runtime; we only compile against it.
compileOnly("com.hypixel.hytale:Server:2026.01.13-dcad8778f")

dependencies {
add("testImplementation", kotlin("test"))
add("testImplementation", "io.kotest:kotest-runner-junit5:5.9.1")
add("testImplementation", "io.kotest:kotest-assertions-core:5.9.1")
add("testImplementation", "io.mockk:mockk:1.13.14")
}
testImplementation(kotlin("test"))
testImplementation("io.kotest:kotest-runner-junit5:5.9.1")
testImplementation("io.kotest:kotest-assertions-core:5.9.1")
testImplementation("io.mockk:mockk:1.13.14")
}

tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
options.release.set(21)
}
tasks.test {
useJUnitPlatform()
}

tasks.withType<KotlinCompile> {
compilerOptions.jvmTarget.set(JvmTarget.JVM_21)
}
kotlin {
val requestedJvmTargetStr: String = (System.getProperty("ktale_jvm_target") ?: "25").trim()

extensions.configure<KotlinJvmProjectExtension> {
jvmToolchain(21)
// Hytale plugins are expected to run on JVM 25.
// Kotlin may lag behind in classfile targets; clamp to the max supported by Kotlin (currently 24).
val effectiveJvmTargetStr: String = try {
org.jetbrains.kotlin.gradle.dsl.JvmTarget.fromTarget(requestedJvmTargetStr)
requestedJvmTargetStr
} catch (_: Throwable) {
logger.warn("Requested ktale_jvm_target=$requestedJvmTargetStr but Kotlin doesn't support it; using 24 for Kotlin bytecode.")
"24"
}

tasks.withType<Test>().configureEach {
useJUnitPlatform()
// Use JDK 21 to *compile*, but we can still emit newer Kotlin bytecode targets when supported.
// (This matches your requirement: JDK 21, target JVM 25 — with Kotlin clamped until it supports 25.)
jvmToolchain(21)
compilerOptions {
// Kotlin's supported JVM targets lag behind Java toolchains. Use string target for maximum compatibility.
// If your Kotlin version supports 25, this will work; otherwise set systemProp.ktale_jvm_target (e.g. 21).
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.fromTarget(effectiveJvmTargetStr))
}
}

// Publishing: keep it CI-safe by always enabling `mavenLocal()`, and only adding remote repos when creds exist.
extensions.configure<JavaPluginExtension> {
withSourcesJar()
java {
toolchain {
// JDK used for compilation.
languageVersion.set(JavaLanguageVersion.of(21))
}
withSourcesJar()
}

extensions.configure<PublishingExtension> {
repositories {
mavenLocal()
val user = System.getenv("NEXUS_USER")
val pass = System.getenv("NEXUS_PASS")
if (!user.isNullOrBlank() && !pass.isNullOrBlank()) {
maven {
name = "ModLabs"
url = uri("https://nexus.modlabs.cc/repository/maven-public/")
credentials {
username = user
password = pass
}
publishing {
repositories {
mavenLocal()
val user = System.getenv("NEXUS_USER")
val pass = System.getenv("NEXUS_PASS")
if (!user.isNullOrBlank() && !pass.isNullOrBlank()) {
maven {
name = "ModLabs"
url = uri("https://nexus.modlabs.cc/repository/maven-public/")
credentials {
username = user
password = pass
}
}
}
}

publications {
create<MavenPublication>("maven") {
from(components["java"])
pom {
name.set("KTale")
description.set("A speculative, adapter-based Kotlin server SDK foundation for Hytale (Day-1 oriented).")
url.set("https://github.com/ModLabsCC/ktale")
licenses {
license {
name.set("GPL-3.0")
url.set("https://github.com/ModLabsCC/ktale/blob/main/LICENSE")
}
publications {
create<MavenPublication>("maven") {
from(components["java"])
pom {
name.set("KTale")
description.set("Kotlin extensions + utilities for Hytale Server plugin development.")
url.set("https://github.com/ModLabsCC/ktale")
licenses {
license {
name.set("GPL-3.0")
url.set("https://github.com/ModLabsCC/ktale/blob/main/LICENSE")
}
developers {
developer {
id.set("ModLabsCC")
name.set("ModLabsCC")
email.set("contact@modlabs.cc")
}
}
scm {
connection.set("scm:git:git://github.com/ModLabsCC/ktale.git")
developerConnection.set("scm:git:git@github.com:ModLabsCC/ktale.git")
url.set("https://github.com/ModLabsCC/ktale")
}
developers {
developer {
id.set("ModLabsCC")
name.set("ModLabsCC")
email.set("contact@modlabs.cc")
}
}
scm {
connection.set("scm:git:git://github.com/ModLabsCC/ktale.git")
developerConnection.set("scm:git:git@github.com:ModLabsCC/ktale.git")
url.set("https://github.com/ModLabsCC/ktale")
}
}
}
}
Expand Down
40 changes: 0 additions & 40 deletions docs/auto-registration.mdx

This file was deleted.

52 changes: 0 additions & 52 deletions docs/commands.mdx

This file was deleted.

24 changes: 0 additions & 24 deletions docs/configs.mdx

This file was deleted.

Loading