Skip to content
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
7f553b6
chore: centralize build versions and remove Maven Local
demoth Oct 1, 2026
126a11f
chore: update github ci actions
demoth Oct 1, 2026
01493da
chore: simplify dependency repositories
demoth Oct 1, 2026
7d9be07
chore: update JUnit to 5.10.5
demoth Oct 1, 2026
c4a14eb
chore: upgrade CSV, Jackson and Logback dependencies
demoth Oct 1, 2026
1d8e98f
chore: upgrade git-properties and simplify resource wiring
demoth Oct 1, 2026
1f52983
chore: use standard Cake application distributions
demoth Oct 1, 2026
e8b443c
chore: enable configuration cache for JVM builds
demoth Oct 1, 2026
6aa5c20
chore: upgrade Gradle wrapper to 9.8.0
demoth Oct 1, 2026
1b6319d
chore: simplify Java and Kotlin toolchain configuration
demoth Oct 1, 2026
c68e914
chore: upgrade Kotlin and align runtime libraries
demoth Oct 1, 2026
0118126
chore: upgrade kotlinx serialization to 1.11.0
demoth Oct 1, 2026
9e69cc7
chore: remove unused coroutine and KTX async dependencies
demoth Oct 1, 2026
0c6847e
chore: make Graal native builds opt-in
demoth Oct 1, 2026
bbd61a2
chore: upgrade Beryx and simplify runtime packaging
demoth Oct 1, 2026
607bcc7
chore: correct build docs and report launcher failures
demoth Oct 1, 2026
28ef5b6
chore: upgrade the matched libGDX graphics stack
demoth Oct 1, 2026
53e5513
chore: upgrade Graal tooling and simplify native resources
demoth Oct 1, 2026
b15b4c8
fix: register native libGDX audio constructors
demoth Oct 1, 2026
483b53d
chore: upgrade Java toolchain and runtimes to 25 LTS
demoth Oct 1, 2026
39aeef8
refactor: share Cake desktop and native build configuration
demoth Oct 1, 2026
a7e3907
1.2.1
demoth Oct 1, 2026
7231c26
fix: macos launcher: pass missed args into the restarted command
demoth Oct 1, 2026
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
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 21
uses: actions/setup-java@v2
- uses: actions/checkout@v7
- name: Set up JDK 25
uses: actions/setup-java@v6
with:
distribution: 'adopt'
java-version: '21'
distribution: 'temurin'
java-version: '25'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
Expand Down
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Other implementations are located in ../quake. You can refer to them for compari
- Do not delete existing comments if they are not addressed in the change.

## Testing Guidelines
- Primary test framework is JUnit 4 (see root `build.gradle`); Kotlin tests live alongside Java tests.
- Primary test framework is JUnit 5 (Jupiter; see root `build.gradle`); Kotlin tests live alongside Java tests.
- Run all tests with `./gradlew test` or target a module with `./gradlew :qcommon:test`.
- Test classes should be in the same package as the module they verify.
- Keep tests deterministic and colocated with the module they verify.
Expand All @@ -55,4 +55,4 @@ Other implementations are located in ../quake. You can refer to them for compari

## Configuration Tips
- Jake2 requires original Quake2 data files. If auto-detection fails, pass a base dir: `+set basedir "/path/to/Quake 2"`.
- JDK 21 is recommended (11 and 17 also work)
- JDK 25 is required to build; JVM distributions require Java 25 or newer.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Currently, Jake2 supports most platforms supported by Java.

Requirements:

* jdk version 21 recommended (11 and 17 also work)
* JDK 25 is required to build; JVM distributions require Java 25 or newer.

Documentation & Info
--------------------
Expand Down
39 changes: 13 additions & 26 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile

plugins {
id 'org.jetbrains.kotlin.jvm' version "$kotlinVersion" apply false
id 'org.jetbrains.kotlin.plugin.serialization' version "$kotlinVersion" apply false
id 'com.gorylenko.gradle-git-properties' version '2.5.7' apply false
alias(libs.plugins.kotlinJvm) apply false
alias(libs.plugins.kotlinSerialization) apply false
alias(libs.plugins.gitProperties) apply false
}

subprojects {
Expand All @@ -13,35 +10,25 @@ subprojects {
apply plugin: 'jacoco'

group = 'org.demoth'
version = '1.2.0'
version = '1.2.1'
ext.appName = 'cake'

java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}

tasks.withType(JavaCompile).configureEach {
options.incremental = true
options.release = 21
}

tasks.withType(KotlinJvmCompile).configureEach {
compilerOptions.jvmTarget.set(JvmTarget.JVM_21)
kotlin {
jvmToolchain(25)
}

dependencies {
testImplementation(libs.junitJupiterApi)
testImplementation(libs.junitJupiterParams)
testRuntimeOnly(libs.junitPlatformLauncher)
testRuntimeOnly(libs.junitJupiterEngine)
implementation(platform(rootProject.libs.kotlinBom))
testImplementation(rootProject.libs.junitJupiterApi)
testImplementation(rootProject.libs.junitJupiterParams)
testRuntimeOnly(rootProject.libs.junitPlatformLauncher)
testRuntimeOnly(rootProject.libs.junitJupiterEngine)
}

tasks.withType(Test).configureEach {
useJUnitPlatform()
// Explicitly allow libGDX/LWJGL to load native libraries without Java 25 warnings.
jvmArgs '--enable-native-access=ALL-UNNAMED'
finalizedBy(tasks.named('jacocoTestReport'))
}

Expand Down
52 changes: 52 additions & 0 deletions cake/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,58 @@ Main desktop entrypoint:

- [`Lwjgl3GameLauncher.kt`](cake-client/src/main/kotlin/org/demoth/cake/lwjgl3/Lwjgl3GameLauncher.kt)

## JVM distributions

Build portable ZIPs with Java 25:

```sh
./gradlew :cake:cake-client:distZip :cake:cake-modelviewer:distZip
```

Each launcher's `build/distributions/` contains a ZIP with `bin/` launch scripts
and `lib/` application/dependency JARs. Extract the entire ZIP and run
`bin/cake-client` or `bin/cake-modelviewer` (the `.bat` script on Windows).
Pass an asset path to the model viewer; Quake 2 game data remains external.
Comment thread
demoth marked this conversation as resolved.
Resolved

For a local installation, use `:cake:cake-client:installDist` or
`:cake:cake-modelviewer:installDist`; scripts are under the corresponding
`build/install/<application>/bin/` directory. JARs under `build/libs/` are normal
project JARs and need the distribution classpath. Use `distZip` instead of the
former custom `dist` task; standalone fat JARs are no longer produced.

The existing launcher helper supplies macOS first-thread startup by restarting
the JVM when needed. ZIPs require Java; bundled-runtime images and native
executables use the separate Beryx and Graal tasks.

Configuration cache is enabled for ordinary builds, JVM distributions, and run
tasks. Beryx 2.0.1 still requires `--no-configuration-cache` for
`runtime`, `runtimeZip`, `jpackageImage`, and `jpackage`, for example:

```sh
./gradlew :cake:cake-client:runtimeZip --no-configuration-cache
./gradlew :cake:cake-client:jpackageImage --no-configuration-cache
```

`runtimeZip` writes `build/image.zip`; `jpackageImage` writes an application
under `build/jpackage/`. Use the corresponding model-viewer tasks for that app.
These outputs bundle the project Java toolchain and target the build machine's
OS and architecture. Installers remain disabled.

## Native executables

Graal support is opt-in. Enable the native plugin and helpers when building an
experimental native executable:

```sh
./gradlew -PenableGraalNative=true :cake:cake-client:nativeCompile
./gradlew -PenableGraalNative=true :cake:cake-modelviewer:nativeCompile
```

These tasks require GraalVM 25 or newer with Native Image. Set `GRAALVM_HOME` to
that installation; Gradle can continue running on the regular project JDK.
Native resources are detected from the runtime classpath, including repository
assets and dependency libraries. Ordinary JVM builds and ZIPs omit the Graal helpers.

## BSP World Renderer

Cake now uses a dedicated Q2PRO-inspired world BSP batch renderer by default (no legacy per-face world `ModelBatch` path).
Expand Down
92 changes: 4 additions & 88 deletions cake/cake-client/build.gradle
Original file line number Diff line number Diff line change
@@ -1,95 +1,11 @@
plugins {
id 'application'
id 'org.beryx.runtime' version "$beryxRuntimePluginVersion"
id 'org.graalvm.buildtools.native' version "$graalNativeBuildToolsVersion" apply false
alias(libs.plugins.beryxRuntime)
alias(libs.plugins.graalNativeBuildTools) apply false
}

sourceSets.main.resources.srcDirs += [ rootProject.file('assets').path ]
def desktopAppName = 'cake-client'
def mainClassName = 'org.demoth.cake.lwjgl3.Lwjgl3GameLauncher'
application {
mainClass.set(mainClassName)
}
dependencies {
implementation libs.gdxControllersDesktop
implementation libs.gdxBackendLwjgl3
implementation(libs.gdxFreetypePlatform) {
artifact {
classifier = 'natives-desktop'
}
}
implementation(libs.gdxPlatform) {
artifact {
classifier = 'natives-desktop'
}
}
implementation project(':cake:core')
}

def jarName = "${desktopAppName}-${version}.jar"
def os = System.properties['os.name'].toLowerCase()
def iconsDir = project.file('icons')

run {
outputs.upToDateWhen { false }
workingDir = rootProject.file('assets').path
setIgnoreExitValue(true)

if (os.contains('mac')) jvmArgs += "-XstartOnFirstThread"
}

jar {
archiveFileName.set(jarName)
destinationDirectory = file("${project.layout.buildDirectory.asFile.get().absolutePath}/lib")
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
dependsOn configurations.runtimeClasspath
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
exclude('META-INF/INDEX.LIST', 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA')
dependencies {
exclude('META-INF/INDEX.LIST', 'META-INF/maven/**')
}
manifest {
attributes 'Main-Class': mainClassName
}
doLast {
file(archiveFile).setExecutable(true, false)
}
}

if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_14)) {
tasks.jpackageImage.doNotTrackState("This task both reads from and writes to the build folder.")
runtime {
options.set(['--strip-debug',
'--compress', '2',
'--no-header-files',
'--no-man-pages',
'--strip-native-commands',
'--vm', 'server'])
modules.set([
'jdk.unsupported'
])
distDir.set(file(project.layout.buildDirectory))
jpackage {
imageName = desktopAppName
skipInstaller = true
jpackageHome = javaHome.getOrElse("")
mainJar = jarName
if (os.contains('win')) {
imageOptions = ["--icon", new File(iconsDir, 'logo.ico').absolutePath]
} else if (os.contains('nix') || os.contains('nux') || os.contains('bsd')) {
imageOptions = ["--icon", new File(iconsDir, 'logo.png').absolutePath]
} else if (os.contains('mac')) {
imageOptions = ["--icon", new File(iconsDir, 'logo.icns').absolutePath]
}
}
}
mainClass.set('org.demoth.cake.lwjgl3.Lwjgl3GameLauncher')
}

tasks.register('dist') {
dependsOn 'jar'
}

if(enableGraalNative == 'true') {
apply plugin: 'org.graalvm.buildtools.native'
apply from: file("nativeimage.gradle")
}
apply from: rootProject.file('cake/desktop.gradle')
70 changes: 0 additions & 70 deletions cake/cake-client/nativeimage.gradle

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ object Lwjgl3GameLauncher {

private fun getDefaultConfiguration(videoMode: CakeVideoModeSettings): Lwjgl3ApplicationConfiguration {
return Lwjgl3ApplicationConfiguration().apply {
setTitle("Cake Engine v1.2.0")
setTitle("Cake Engine v1.2.1")
setOpenGLEmulation(Lwjgl3ApplicationConfiguration.GLEmulation.GL32, 3, 2)
setBackBufferConfig(
/* r = */ 8,
Expand Down
Loading
Loading