Deploying to a Network Share
I’ve worked at loads of companies where the services department/desk handles your deployments to development or production servers.
The process works like this: you zip your deployment materials, including all your assets (SWF, XML, etc.), copy the zip file over to a network share, and send an email to one of the system or network administrators, who then receives the email in a ticketing system and handles the deployment. So many tedious steps for something that should be so simple. Sound familiar?
With Ant, you can automate even this process.
Let’s start with copying everything we want to a directory and
cleaning out all the files we don’t want. We already used the copy and mkdir tasks, but the fileset and exclude tasks are new ones.
fileset creates a set from any
given directory; and with include or
exclude, you can choose the files you
want to select or not select. For example:
<target name="7.cleanup-and-export" depends="6.test-in-browser">
<mkdir dir="${project.deploy.path}" />
<mkdir dir="${project.zip.path}" />
<copy overwrite="true" todir="${project.zip.path}">
<fileset dir="${project.web.path}/">
<exclude name="**/.settings/**" />
<exclude name="**/*.as3_classpath" />
<exclude name="**/*.project" />
<exclude name="**/.svn/**" />
</fileset>
</copy>
<eclipse.refreshLocal resource="${project.name}" depth="infinite" />
</target>To summarize, we create directories if we don’t have them yet, select files we want from a different directory, and filter ...