views:

636

answers:

2

Our application has over 15 different top-level mxml files to create individual controls that are used in our pages.

We are using Ant to do our automated builds, and are calling the mxmlc task for each mxml file separately (See question 78230 similar example). Running the compiler separately for each mxml file, however, is already adding up to a considerable amount of time. Our build time is approaching 10 minutes, 5 minutes for compiling our flex apps, and 5 minutes for compiling hundreads of java classes, building jars, installer etc. Each flex compile run is reasonably quick (15-20 seconds), but they add up.

Is there a way to compile all of them with one call to mxmlc?

A: 
  1. Why not use Flex Builder to compile everything automatically?
  2. Are the mxml files components and/or modules? I think that mxmlc compiles them automatically it they're linked to by the main application, but I'm not sure...
Aethex
They are modules. Each is compiled into an independent swf file to show on a particular page. We have a part html/part flex webapp where we are inserting different flex modules into different pages.Is there a better design for that type of setup than completely independent mxml files?
Nathan Voxland
Modules are meant to be integrated into the main app. Putting each module in a different page seems like poor practice. Why not code the entire thing in Flex? Separate modules provide different UIs. You can also compile each module into a swc or library file and include them as a library using a compiler argument (I forget which one that is).
Aethex
+1  A: 

One way to speed it up a bit is to compile everything but the top-level classes into one big SWC using compc, then compiling the top-level classes and using the SWC as a library. That way classes that are used by more than one application will only be compiled once.

However, a large contributor to the time it takes to compile a Flex application is the JVM startup time, and each compile will start up it's own JVM (plus one for the Ant process). One way to avoid this is to use the Flex Compiler Shell (fcsh) instead of Ant, but that has it's downsides of course. Another way is to try HellFire, which runs the compiler in a separate always-on process, meaning no more waiting for the JVM to start.

Theo