October 2011
Intermediate to advanced
98 pages
2h 18m
English
Instead of making a zip file from only one directory, we create a backup of the complete project. So, besides using SVN and not losing your code, we create a failsafe and back up all our files (this zip file can later be committed to SVN, too, of course):
<target name="10.create-backup-zip" description="Create a zip file that holds all the project files" depends="build.create-timestamp">
<zip file="${project.backup.path}${file.separator}backup_${project.name}_${current.date.time}.zip">
<fileset dir="${basedir}/">
<include name="**/*" />
<exclude name="**/.settings/**" />
<exclude name="**/*.as3_classpath" />
<exclude name="**/*.project" />
<exclude name="**/.svn/**" />
</fileset>
</zip>
<eclipse.refreshLocal resource="${project.name}" depth="infinite" />
</target>We exclude a lot of hidden files (settings and other miscellaneous files—stuff we can do without); we only want a backup of the complete project.
The build.properties file also needs to be adjusted slightly. The following is only the project properties defined; the rest, we can leave alone:
# Project Properties project.name=sample project.document.class=Main project.file.extension=.as project.src.path=${basedir}${file.separator}src project.bin.path=${basedir}${file.separator}bin project.template.path=${basedir}${file.separator}template project.debug.path=${basedir}${file.separator}debug project.deploy.path=${basedir}${file.separator}deploy project.assets.path=${basedir}${file.separator}assets ...