使用mxmlc ant任务时如何包含其他编译器参数?

时间:2009-03-04 12:46:29

标签: flex ant service mxmlc

Flex Builder允许在属性下的编译器选项中设置其他编译器参数。它设定了论点;

-services ".../services-config.xml"

使用ant任务mxmlc时有没有办法设置相同的参数?

干杯,

麦克

5 个答案:

答案 0 :(得分:3)

不是我知道的。

如果您仍然无法在文档中找到该任务,则可以始终将该任务用于子节点。

示例:

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

答案 1 :(得分:3)

您应该能够将其设置为mxmlc任务的属性:

<mxmlc services="../services-config.xml"/>

答案 2 :(得分:1)

我遇到的问题是service属性无法在ant任务中使用,所以我添加了修复问题的选项:

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

答案 3 :(得分:0)

这可以通过以下方式完成:

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

这就是我们目前正在构建mxml应用程序的方式......这意味着Christophe是正确的。

答案 4 :(得分:0)

大多数编译器选项可用作mxmlc任务的属性或标记,但是缺少某些选项,或者以某种意外的方式工作。最糟糕的是缺少Flex Ant任务的适当文档。 有时我发现这样做更容易:

<mxmlc file="Main.as" output="bin/app.swf">
    <load-config filename="${FLEX_HOME}/flex-config.xml" />
    <load-config filename="build/config.xml" />
</mxmlc>

然后在build / config.xml中指定我想要的所有选项,至少语法是documented better,并且您始终可以使用SDK中的flex-config.xmlair-config.xml作为(评论很清楚)样本。

相关问题