Release revision missing in my Main Interface window Title Bar after v1.7 upgrade

Ethelred

Member
After moving my build process over to a new compter as a result of the java v1.7 upgrade (as detailed in the "Building from the SVN?" thread), I noticed that the release revision is missing from my Main Interface window Title Bar. It just says
Code:
KoLmafia v16.3 Main Interface (Ethelred)
instead of e.g.,
Code:
KoLmafia v16.3 r14378 Main Interface (Ethelred)
which shows on a downloaded daily .jar file. I think this had actually broken sometime earlier on the old system and I never got around to trying to track it down. This seems like a good time to tackle it, what with new beginnings and all.

I'm not well versed in ant, build I've looked thru the build.xml file and it looks to me like the code in the daily target (shown here)
Code:
    <target name="daily" depends="clean,init,update,version">

        <replace
            file="${KoLConstants}"
            token="REVISION = null"
            value="REVISION = "${revision}"" />

        <replace
            file="${KoLConstants}"
            token="RELEASED = true"
            value="RELEASED = false" />

        <antcall target="compile" />

        <replace
            file="${KoLConstants}"
            token="REVISION = "${revision}""
            value="REVISION = null" />

        <replace
            file="${KoLConstants}"
            token="RELEASED = false"
            value="RELEASED = true" />

        <jar
            destfile="${dist}/${ant.project.name}-${revision}.jar"
            basedir="${build}"
            update="true"
            index="true"
            compress="true">

            <manifest>
                <attribute name="Main-Class" value="${main}" />
            </manifest>
            <zipgroupfileset dir="${lib}/jar">
                <include name="*.jar"/>
            </zipgroupfileset>
        </jar>

    </target>

Should cause KoLConstants.java to be updated with the proper revision, but that doesn't seem to be happening. If I look at KoLConstants.java, I see

Code:
    public static final String REVISION = "";

I would appreciate any help that anyone could provide with this. Thanks, in advance.

Sys details:
Mac OS X version 10.9.4
java version "1.7.0_55"
Apache Ant(TM) version 1.9.4 compiled on April 29 2014

Let me know if there is any additional information I can provide.
 
Last edited:

lostcalpolydude

Developer
Staff member
Should cause KoLConstants.java to be updated with the proper revision, but that doesn't seem to be happening. If I look at KoLConstants.java, I see

Code:
    public static final String REVISION = "";

That line is supposed to be changed to the revision number, then changed back to null. I'm guessing things will work again if you replace "" with null there.
 

fronobulax

Developer
Staff member
When I first started to build mafia my IDE decided to generate a build script. There is a thread around here where I was suggesting that the version should be in the title, ineffectively arguing with veracity who said it was already there and eventually coming to the realization that I had set the project up incorrectly. That was a couple years ago but I my core mistake was that I was only checking out the KoLmafia source and not the entire tree. So your problem might be related. The base of what I check out mow from SVN is high up enough the tree that it gets the documentation and the build xml files. Once that was in place I had to aggressively force the IDE to use and not modify the build file from SourceForge. Finally I had to tweak the mapping of IDE commands to targets in the build file. I seem to recall Daily being the most useful and that mapping some of the other targets to commands did not work as expected and I was never motivated enough to fix.

That said, there are circumstances where KoLConstants does not get "restored" after the build and at least once I have inadvertently checked in a changed version of the file that should not have been checked in.

All this has been on Windows 7 and NetBeans. I imported KoLmafia once on my work computer with IntelliJ and "things just worked". Your point about updating the "how to build" thread is noted but... A better place for the information would be a wiki page and my motivation to contribute will be enhanced if/when I decide to switch from NetBeans because getting to this point was too much work to tear down and redo just to verify a set of instructions.
 
Top