Flex Builder allows additional compiler arguments to be set in the compiler options, under properties. It sets the argument;
-services ".../services-config.xml"
Is there a way to set the same argument when using the ant task mxmlc?
Cheers,
Mike
I was having the same issues with the services attribute not being available for use in the ant tasks so I added the option to fix the problem:
<mxmlc file="path" output="path to output" >
<compiler.services>${path-to-services}</compiler.services>
<load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
<source-path path-element="${FLEX_HOME}/frameworks"/>
<compiler.debug>false</compiler.debug>
<compiler.context-root>/PATWeb</compiler.context-root>
</mxmlc>
This is accomplished by the following:
<target name="compileApp">
<mxmlc file="src/app.mxml"
...other options
services="[path to your services-config.xml]"
context-root="[path to where your gateway file is]">
...
</target>
This is how we are currently building the mxml app... which means Christophe was correct.
Most of the compiler options are available as either attributes or tags for the mxmlc
task, however some options are missing, or work in somewhat unexpected way. Worst thing is lack of proper documentation for the flex Ant tasks.
Sometimes I find it easier to do this:
<mxmlc file="Main.as" output="bin/app.swf">
<load-config filename="${FLEX_HOME}/flex-config.xml" />
<load-config filename="build/config.xml" />
</mxmlc>
And then specify all the options I want in build/config.xml, at least the syntax is documented better, and you can always use flex-config.xml
or air-config.xml
from your SDK as a (well-commented) sample.