1 Reply Latest reply on Nov 8, 2007 10:14 AM by Paul Reilly

    Adobe Ant peculiarity -- "Waiting for history.htm"

    k1cheng
      Hi,

      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 consistently.

      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 front-end">
      <taskdef resource="flexTasks.tasks" classpath="flexTasks.jar"/>
      <mxmlc file="${dir.war}\tds_flex.mxml"/>
      <html-wrapper title="product name here" application="tds_flex" swf="tds_flex"
      version-major="9" version-minor="0" version-revision="0"
      history="true" template="express-installation"/>
      </target>

      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 build.

      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?

      Thanks,
      KaJun