Compiling dependent SWF files

AudioTool Ant buildLast night I spent about 9 hours writing a build script for the AudioTool allowing us to compile each plugin into its own SWF container. I think it is the first time a Flash project is taking more than 5 minutes for me to compile completly.

I figured out that it is definitly not easy to handle the mxmlc or compc in a way we needed it to be. The point is that we have for each plugin three modules A, B, C and a library D. A depends on D. B depends on A and D. C depends on A, B and D. Now to make it even more complex we have A, B, C and D in one project so that developing in this environment stays still simple. The solution to compile all modules in a way we need them to be was first generating unique entry points for the SWF files because we do not want to work with SWC libraries (or the SWF inside the SWC package). After having the unique entry points we compile D (and its dependencies as well) without including the source of A, B or C. Afterwards we can compile A. But B is dependent on A so we have to compile a SWF for A and then a SWC for A so B can link to A as an external library. C is also analog to this but needs B as a library as well. In the end it was 5am and I was happy to have the complete build working which generates a lot of SWF files and SWC libraries.

Since it is very hard to configure Ant for this (I was using XSL in the beginning for automated code generation) I started developing my own Ant tasks. I have to say that it is really simple and saved us hours of work. We have now one single XML file containing the dependencies and the Ant task will do the rest (code generation, compile tasks, etc.).

Related Posts

4 Responses to “Compiling dependent SWF files”


  1. 1 Craig

    You should take a look at Ivy. I think it would do just want you want. Its a sub-project of ANT and is still in incubation at Apache.
    http://ant.apache.org/ivy

    I’m using it now with a Flex project with a growing list of dependencies (and dependencies with dependencies) and it works great.

  2. 2 Astor Digital

    I’ve been using Maven 2 with flex-mojos to compile my dependent projects as well as applying the use of Gas 3 for code generation.

    http://maven.apache.org/
    http://code.google.com/p/flex-mojos/
    http://www.graniteds.org/confluence/display/DOC/2.5.+Gas3+Code+Generator

    Makes life a little more productive.

  3. 3 Astor Digital

    I’ve been using Maven 2, flex-mojos and Gas 3 for code generation.

  4. 4 Kim

    For this type of tasks we build Zarkov. A compiler wrapper for several compiler with compileroption autocompletion in eclipse. http://zarkov.bigsource.de
    Take a look, maybe it helps saving time.

Leave a Reply






Close
E-mail It