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

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

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

干杯,

麦克

有帮助吗?

解决方案

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

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

其他提示

不是我知道的。

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

示例:

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

我遇到的问题是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>

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

<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是正确的。

大多数编译器选项可用作 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中指定我想要的所有选项,至少语法是记录得更好,您可以随时使用SDK中的 flex-config.xml air-config.xml 作为 - 评论)样本。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top