views:

3891

answers:

4

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

+2  A: 

Not that I know of.

You could always use the task with subnodes if you still are unable to find it in the docs.

Example:

<exec executable="${mxmlc.exe}" dir="${basedir}">
    <arg line="-source-path '${flex2sdk.locale.dir}'" />
    <arg line="-locale en_US" />
</exec>
tousdan
A: 

You should be able to set it as an attribute on the mxmlc task:

<mxmlc services="../services-config.xml"/>
Christophe Herreman
There is no services attribute on the mxmlc ant tasks. I found that I had to fall back on the mxml.exe using the <exec> tasks as stated below
Kevin
A: 

Hi, I have a similar problem I want to include the services compiler argument in my ant script, the same that is defined in Flex Builders 'Additional Compiler Arguments'. When I add it as a services attribute and run the build it gives an error saying a context root needs to be defined. If I add this as an attribute I get the following error:

....\WEB-INF\flex\services-config.xml: Error: Channel definition, mx.messaging.channels.RTMPChannel, can not be found.

Anyone any ideas on this??

Any help much appreciated.

A: 

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.

Ed Haack