Hi,
I am having difficulties building a QTP-enabled application via the Ant
mxmlc/compc tasks.
The structure of the project is a Library Project (Common.swc) and a Main Flex
Application (Main.swf), which links to the Library Project.
Building the application using Flex Builder (including the four automation/QTP
libraries) produces a SWF around 1.8MB is size, which is recognised by QTP.
Running the same build via an Ant script, produces a SWF around 1.1MB in size,
which is not recognised by QTP as a Flex Application (only a
MacromediaFlashPlayerActiveX object).
Below are the four different builds and their results:
Flex Builder (No Automation)
Common.swc - 1.5MB
Main.swf - 1.1MB
Flex Builder (Automation)
Flex Compiler arguments:
-include-libraries "automation/qtp.swc" "automation/automation.swc"
"automation/automation_agent.swc" "automation/automation_dmv.swc"
Common.swc - 2.8MB
Main.swf - 1.8MB - Recognised in QTP
Ant (No Automation)
<compc output="Common\Common.swc" include-classes="${compc.classes}"
include-file="${compc.assets}">
<source-path path-element="Common\src" />
<library-path dir="${libs.dir}" append="true">
<include name="*.swc" />
</library-path>
</compc>
<mxmlc file="Main\Main.mxml" output="Bin\Main.swf">
<source-path path-element="Main\src" />
<library-path dir="${libs.dir}" append="true">
<include name="*.swc" />
</library-path>
<library-path file="Common\Common.swc" append="true"/>
</mxmlc>
Common.swc - 1.5MB
Main.swf - 1.1MB
Ant (Automation)
<compc output="Common\Common-automation.swc" include-classes="${compc.classes}"
include-file="${compc.assets}">
<source-path path-element="Common\src" />
<library-path dir="${libs.dir}" append="true">
<include name="*.swc" />
</library-path>
<include-libraries dir="${automation.dir}" append="true">
<include name="automation.swc" />
<include name="automation_agent.swc" />
<include name="automation_dmv.swc" />
<include name="qtp.swc" />
</include-libraries>
</compc>
<mxmlc file="Main\Main.mxml" output="Bin\Main-automation.swf">
<source-path path-element="Main\src" />
<library-path dir="${libs.dir}" append="true">
<include name="*.swc" />
</library-path>
<library-path file="Common\Common-automation.swc" append="true"/>
<include-libraries dir="${automation.dir}" append="true">
<include name="automation.swc" />
<include name="automation_agent.swc" />
<include name="automation_dmv.swc" />
<include name="qtp.swc" />
</include-libraries>
</mxmlc>
Common-automation.swc - 2.8MB
Main-automation.swf - 1.1MB - Not recognised in QTP
I have successfully used Ant to build QTP-enabled applications in the past,
although never with a linked SWC.
Am I doing something wrong, or is this potentially a bug with the Ant
mxmlc/compc tasks?
Thanks,
Peter