The other Andrew Hunt

Another Flash Blog!

Archive for the ‘FlexBuilder’ tag

Using ANT in your Flash Development and Be a Better Person! Part 1

with 2 comments

OK, long time coming, but here we go. There’s too much material for one blog post, so I’m going to break it down over a few blog entries. This series is based on a talk that I gave to the fabulous flashcodersny group, on Aug 13 2008.

ANT is a fantastic tool for automating your Flash development workflow. ANT allows you to write powerful tasks to do just about anything you could desire: compiling Flash (AS2 or AS3), file system operations, ftp’ing files, setting version numbers, generate code documentation, play annoying sounds, etc.

I’ve been hearing about ANT for a while, but only came to adopting it after some frustration with the Flex Builder workflow. At my shop, we have Flash developers who use FDT and, more recently, Flex Builder. We like to check the final SWF into SVN when we have a release build. This allows us to just export a copy of our build files and push them to the server when we want to deploy. Works well enough, and it means that I don’t have to be present for weekend pushes!

I’ve heard compelling arguments about why putting SWFs into version control is a bad idea, but it’s really very convenient, and you don’t need a developer with the fully configured environment for deployments. Anybody who knows how to use the version control system can perform a deploy.

But, Flex Builder will not let you work this way! The default workflow creates a bin-debug folder where your compiled SWFs end up. You cannot check this directory into SVN. I understand their rationale for this, but it’s annoying, and has tripped up a lot of developers. And you can’t customize the workflow too much with Flex Builder, you have to do it their way. Also, the default version that Flex Builder compiles is a debug version, not a release version, so you would not want to check it in anyway. Also, I wanted our developers to be able to use FDT, Flash, or Flex Builder as they wished, on the same project, and the Flex Builder workflow made this difficult.

So, I turned to ANT to get around these issues, which I was able to work out. But, then I realized how much more I could get from ANT, and I find I’m using it more and more with every project, and it’s especially made my life much easier with complicated deployments (4 different server environments requiring different configurations). I’m using ANT on every project now and it’s become widely adopted in my department.

The solution to a unified workflow was to adopt ANT tasks for all Flash compilation. We compile projects the same way whether we’re using FDT, Flex Builder, or Flash. You can execute all of these tasks from within Eclipse, or from the command line if that’s how you roll. The entry on compiling Flash (AS2 or AS3) is part 4 of this series.

Part 2 will introduce basic ANT functionality and the files for my sample project.

Useful Links

You can get the full story on ANT here.

I found these 2 posts very useful for getting set up with ANT in Eclipse/Flex Builder:

Jody Brewster’s Installing Ant in Flex Builder 3

Ryan Taylor’s article on using ANT with FDT3

Written by admin

July 21st, 2008 at 6:26 pm

Posted in AS3 Development

Tagged with , , , , ,