IntelliJ IDEA is mostly compatible with the build system for KoLMafia out of this box with one big exception.
The first is caused by the code that looks at the compiled KoLConstants.class file for the Constants "RELEASED" and "REVISION". If RELEASED is false, then the version is appended. Since the default value in the code is "true", it isn't there unless we make the configuration change it.
So, the patch refactors the build target "compile", adding antcalls to the new targets "set.version" and "set.released.false". Everywhere we made those replaces, I switched it to antcall, to make it more consistent. Additionally, I added those two antcall targets to my IntelliJ build. And now it works like I want...
I only tested the things I could test, and since it's the build system, hopefully it can be well tested, but it looks like it should be correct: it should be transparent to anyone doing anything except my IDE-related refactoring.

View attachment build.refactor.patch
- If you use the default application-type run action, there's no revision number in the version string
- If you use ANT target daily, it can't set the working directory properly
- If you use a JAR application Run task, it can't handle changing jar file names.
The first is caused by the code that looks at the compiled KoLConstants.class file for the Constants "RELEASED" and "REVISION". If RELEASED is false, then the version is appended. Since the default value in the code is "true", it isn't there unless we make the configuration change it.
So, the patch refactors the build target "compile", adding antcalls to the new targets "set.version" and "set.released.false". Everywhere we made those replaces, I switched it to antcall, to make it more consistent. Additionally, I added those two antcall targets to my IntelliJ build. And now it works like I want...
I only tested the things I could test, and since it's the build system, hopefully it can be well tested, but it looks like it should be correct: it should be transparent to anyone doing anything except my IDE-related refactoring.

View attachment build.refactor.patch
Last edited: