I believe I figured out what the Ant/Eclipse conflict was. I have Eclipse set on automated build, and I have Ant set up so it cleans up the old class files before compiling. I guess Eclipse still thinks the files are compiled but can't find them because they've been deleted.
What I've been doing to fix this is cleaning my project in Eclipse, and this must cause it to rebuild. So long as I'm only using Ant to create backups and set up releases, this shouldn't be a big deal. I just wanted to know what was going on.
I will try out ant code similar to cylab's when I build the next release. Thank you for posting that. I may take a look at IzPack later, but the game I'm working on now is targetted at Windows machines anyways.
I started having another strange problem with Ant today. Here's the part of my build script that creates the files for the release:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
| <target name="release" depends="compile"> <mkdir dir="${release.dir}"/> <jar destfile="${jar.path}"> <fileset dir="${build.dir}" includes="**/*.class"/>
<manifest> <attribute name="Built-By" value="${user.name}"/> <attribute name="Main-Class" value="${mainclass}"/>
<section name="common"> <attribute name="Specification-Title" value="${ant.project.name}"/> <attribute name="Specification-Version" value="${version}"/> <attribute name="Specification-Vendor" value="Cow God Games"/> <attribute name="Implementation-Title" value="common"/> <attribute name="Implementation-Version" value="${version} ${TODAY}"/> <attribute name="Implementation-Vendor" value="Cow God Games"/> </section> <section name="${mainclass}"> <attribute name="Sealed" value="false"/> </section> </manifest> </jar>
<copy todir="${release.dir}" includeEmptyDirs="false"> <fileset dir="${build.dir}" excludes="demo license.txt,error.log,**/*.class,**/Thumbs.db" /> </copy>
<copy todir="${release.embeddedjre.dir}" includeEmptyDirs="false"> <fileset dir="${jrebundle.dir}" excludes="**/Thumbs.db" /> </copy>
<mkdir dir="${demo.dir}"/> <copy todir="${demo.dir}" includeEmptyDirs="false"> <fileset dir="${release.dir}" excludes="full license.txt" /> <fileset file="${build.dir}/demo license.txt" /> </copy> </target> |
Since the code is already compiled, this snippet does the following: create the release directory, create the jar file, copy the "build" files (e.g. art, music, etc.) into the release directory, copy the JVM into the release directory, create the demo directory, and copy the entire release into the demo directory.
The issue is that the demo and release versions are supposed to include different licenses (demo license and full license, respectively). I believe I have the file sets set up that way, but both licenses appear in both versions.
One option would be to copy all the files and then delete the appropriate files, but that seems like too much of a hack.
I will insert the Inno Setup execution in there before the next release.