I'm using the Ant tasks from Adobe labs, and when I run Ant
via Flex Builder 2, it generates our output .swf differently
compared to running the Ant task from a shell. We noticed this
because it is causing a user-noticeable issue on our webapp.
I'm hoping someone might have some insight into why this
happens, and/or ideas on how to get the Ant execution working
First off, let me explain my setup. I am using a separate
bundle of Ant 1.7 (all the members of my team are using the same
Ant version from a well-defined location). I copied flexTasks.jar
and flexTasks.tasks to the ant\lib directory. I have Flex Builder
use this bundle of Ant (Run menu -> External Tools ->
External Tools, choose the Ant configuration, go to Classpath tab,
set Ant home).
Here is my "flexc" target:
Compile Flex sources into tds_flex.swf, and generates the
html wrappers too
<target name="flexc" description="Builds the flex
<html-wrapper title="product name here"
version-major="9" version-minor="0" version-revision="0"
When we execute this target within Flex Builder, the
resulting application works. When we execute the target from a
shell, the resulting application does not "work". (The definition
of "work" in this context is that a user can get to our webapp and
have it load completely. When it doesn't work, the browser shows a
message "Waiting for history.htm" in the status bar.) The cause of
this issue has been traced to the generated history.swf file; if we
save a copy of this file from a good build, and copy it over the
resulting history.swf from a bad build, then the webapp works.
I've also found that executing my Ant flexc target within
Eclipse will also generate a working webapp (which isn't too
surprising considering Flex Builder is based on Eclipse), and
executing the target from within IntelliJ will not make a good
The only thing I could think of is that Eclipse/Flex Builder
is invoking Ant differently. Does anyone have any insight into
finding out how it is doing this?
I have no guesses as to what might be causing the difference,
but when I'm debugging ant issues, I often use the -verbose flag.
One option for dealing with the difference is to rebuild the Flex
Ant tasks using the history.swf that works for you. The Flex Ant
tasks include all the source, templates, and a build.xml for
Another option is to get the Ant tasks that now ship with the
Flex 3 SDK and try them out. The new templates no longer use
history.swf. You can get the Flex 3 SDK beta here: