Terasology
Terasology copied to clipboard
`--args` overrides default arguments instead of appending them
What you were trying to do
Start a headless server and override its default configuration.
./gradlew server --args="--override-default-config=override.cfg"
What actually happened
A headed Terasology game started.
How to reproduce
- Run
./gradlew server
and notice that it starts a headless server - Stop the headless server
- Run
./gradlew server --args="--override-default-config=override.cfg"
and notice that it starts headed Terasology (main menu UI) - Stop the game
- Run
./gradlew server --args="--override-default-config=override.cfg --headless"
and notice that it starts a headless server
Workaround
Add --headless
argument
./gradlew server --args="--override-default-config=override.cfg --headless"
One potential pitfall to look out for while addressing this:
If you do have --args
always append to the gradle task's default args instead of replacing them, you get duplicates.
For example, gradlew game --args=--homedir=server
would end up as
Terasology --homedir=. --homedir=server
at which point Terasology's argument processor (picocli) will complain that homedir can't be both .
and server
.
@jdrueckert
Oh it is my change #4916
But server
didn't work before :D
@keturn
Yeah. I already fix it in #4916.
--homedir=.
was from kotlin build script.
--homedir=server
was from server
task
Maybe better provide gradle's parameter there?
Which gradle parameter?
Which gradle parameter?
create parameter Like -PadditionalArgs=..