add makefile - #1263
Draft
MaatheusGois wants to merge 4 commits into
Draft
Conversation
- start: use 'setsid nohup ...</dev/null &' so the gradle wrapper's child
JVM is in a new session and SIGHUP from the parent shell can't reap it.
The previous plain 'nohup ... &' kept dying when 'make' exited.
- start: drive the readiness loop from a configurable START_TIMEOUT (default
600s). The hard-coded 4-min cap silently failed on every cold build
(~4 min compile + engine startup) and trained users to ignore the warning.
- stop/status: when .server.pid is missing or points to a recycled pid,
fall back to scanning the listener on the game port instead of erroring.
Verify the saved pid is still a java/gradle process before signalling —
refuse to kill an unrelated process that happens to have the same number.
- clean: wipe */build and .gradle to clear poisoned Kotlin incremental
caches ('Storage for [.../class-attributes.tab] is already registered'
when a previous run died mid-write).
MaatheusGois
force-pushed
the
makefile-only
branch
from
September 5, 2026 00:41
c41300f to
1e5f86e
Compare
Owner
Yeah that's what I was thinking, makefile's are more C world to me it's not something I come across very often in JVM, gradle you can use of course but it's better to use it built into your IDE; though I can appreciate not everyone wants to use IntelliJ like me. Though the start/stop commands are nice for developers I kinda of want to discourage those who don't know what they're doing from installing programs and executing arbitrary commands that they won't know the consequences of, and for easy setups point them to releases instead. Though you could argue ofc that gradle is just abstracting that away, but I am more familiar and comfortable with it at least. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a top-level
Makefileso contributors can start/stop/status the server without remembering the gradle wrapper invocation.Currently the documented path is
./gradlew :game:rundirectly, with no way to background it cleanly or check whether it's already running. This wraps the lifecycle in five recipes:make start— start the server in the background, wait for port 43594 to listen, tail the logmake stop— gracefully shut down (SIGTERM → 15s grace → SIGKILL), clearing any leftover listenermake status— show pid + port state + last log linesmake restart—stop+startmake logs—tail -f server.logmake clean— wipe*/buildand.gradle(fixes the "Storage for [.../class-attributes.tab] is already registered" failure when a previous build died mid-write)START_TIMEOUToverrides the readiness wait (default 600s) —make start START_TIMEOUT=900.Notable behavior
startusessetsid nohup ...</dev/nullso the gradle worker's child JVM is in a new session and survives the parent shell exit (the previousnohup ... &form kept getting SIGHUP'd whenmakereturned).stopand the port-cleanup fallback both verify the saved pid is still ajava/bash/shprocess before signalling, so a recycled pid or an unrelated listener won't get killed.Draft because
I want a maintainer sanity check on whether a Makefile belongs in the repo at all (some projects prefer a script in
scripts/or a launchd plist), and on the chosen lifecycle approach before this gets merged. Happy to restructure — e.g. dropstart/stop/statusand only keepclean, since./gradlew :game:runis one line — if that's preferred. The actual gradle commands are unchanged from what the README already recommends.