Skip to Main Content
Automating ActionScript Projects with Eclipse and Ant
book

Automating ActionScript Projects with Eclipse and Ant

by Sidney de Koning
October 2011
Intermediate to advanced content levelIntermediate to advanced
98 pages
2h 18m
English
O'Reilly Media, Inc.
Content preview from Automating ActionScript Projects with Eclipse and Ant

Creating a Zip File

Now that we have all the files we want copied over in a directory, we want to zip the contents of that folder. I prefer zip over different compression file formats, mainly because it does not matter if you are on a Windows, Mac, or *Nix machine. Users in production environments, as well as home users that you need to send zip files to, can uncompress them.

As you can see, a lot of Ant tasks use the same nested elements, like fileset. If you wanted to merge multiple zip files in one archive, you would have to use zipgroupfileset.

Finally, we clean up the temp folders by using the delete task, and then refresh the workspace to see the changes:

<target name="8.create-deployment-zip" description="Create a zip file" depends="7.cleanup-and-export">
    <zip file="${project.deploy.path}${file.separator}${project.name}_${current.date.time}.zip">
        <fileset dir="${project.zip.path}/">
            <include name="**/*" />
        </fileset>
    </zip>
    <!-- create a property to store zip file name in -->
    <property
        name="deployment.zip.file"                             
        value="${project.deploy.path}${file.separator}${project.name}_
${current.date.time}.zip"/>
    <!-- delete the deploy files from the file system -->
    <delete dir="${project.zip.path}/" />
    <eclipse.refreshLocal resource="${project.name}" depth="infinite" />
</target>

As you might have noticed, we also create a property for the name of our zip file, so we can use it later in the chained-up process by calling ${deployment.zip.file}.

We have now gone through all the steps for creating ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

AdvancED ActionScript 3.0: Design Patterns

AdvancED ActionScript 3.0: Design Patterns

Ben Smith
ActionScript 3.0 Cookbook

ActionScript 3.0 Cookbook

Joey Lott, Darron Schall, Keith Peters
Migrating to Swift from Flash and ActionScript

Migrating to Swift from Flash and ActionScript

Radoslava Leseva Adams, Hristo Lesev

Publisher Resources

ISBN: 9781449314736Errata PageSupplemental Content