Monday, 19 October 2009

“Updating Duplicate Resources”?

What is Flex Builder doing when it tells you it is “Updating duplicate resources” at the end of building your application? During this step Flex Builder copies over various files other than the compiled SWFs to your output directory. These files include everything in your html-template folder and any non-embedded source files. Depending on where you build to, this can take a fair bit of time. For example, if you build to a directory on a non-local web server.

There are a few ways to minimise this and hence speed up your builds a little. The first is to unselect the “Copy non-embedded files to output folder” option on your projects’ compiler settings. This option causes any files under your source directory to be copied to the output directory if they have not been compiled into the SWF. You may however need this option if you keep files such as assets under your source folder that need to be loaded by your application from the build location.

The second thing you can do is to only keep required things in your html-template folder. By default this contains a Flash Player installer SWF and history files, in reality you probably only want to distribute these with you release builds and not copy them over every time you compile the application as a developer (hopefully you have Flash Player installed!). The problem may be even worse if you build modules, because each one of these may have an html-template directory. Sometimes it is convenient to keep other files in your html-template, such as assets, xml data files, etc. If the content of these has not changed since you last build then there is no need to copy these over again as it just adds time to your compilation. I would suggest just copying these over manually when they change or creating a simple script to do it for you. You could even link this script into Flex Builder as an External Tool so that you can run it from Flex Builder.

No comments:

Post a Comment