On the surface this seems like a lot of work for something FB can achieve for us very simply, but as we'll discover the further we get through these tutorials, it becomes a very powerful tool in our hands. Hopefully you'll use these powers for good rather than evil...
I'm actually going to provide the build file this time, and then we are going to work our way through it. I'm not going to provide a full set of learning ANT documentation, there is plenty of that out there if you are interested.
- Turn off every "build before..." setting you can find in FB, they slow things down and through off what we want to deploy!
- Add another folder to your setup folder called build, and under that add a file called build.xml.
- Make sure the FLEX_HOME environment variable is set to the Flex SDK you want to use.
- Grab the Flex Tasks jar file from your SDK folder and place it into the libs directory of your project.
We now need to get this running.
- Open the ANT view in Flex Builder. You should have this already installed if you've followed the previous parts of the tutorial.
- Choose to add a buildfile and choose the projects buildfile
Double click the compile target, and assuming everything has been set up properly, the SWF will be generated in the target directory.
We can clean the folder structure back up by running the clean task, ready to be committed to source control once we are satisfied that the code works.