【问题标题】:How to include additional compiler arguments when using mxmlc ant task?使用 mxmlc ant 任务时如何包含其他编译器参数?
【发布时间】:2009-03-04 12:46:29
【问题描述】:

Flex Builder 允许在属性下的编译器选项中设置额外的编译器参数。它设置参数;

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

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

干杯,

迈克

【问题讨论】:

    标签: apache-flex ant service mxmlc


    【解决方案1】:

    您应该可以将其设置为 mxmlc 任务的属性:

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

    【讨论】:

    • mxmlc ant 任务上没有 services 属性。我发现我不得不使用如下所述的 任务依赖 mxml.exe
    【解决方案2】:

    我不知道。

    如果您仍然无法在文档中找到该任务,您可以随时使用带有子节点的任务。

    例子:

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

    【讨论】:

      【解决方案3】:

      我遇到了同样的问题,服务属性无法在 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>
      

      【讨论】:

        【解决方案4】:

        这是通过以下方式完成的:

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

        【讨论】:

          【解决方案5】:

          大多数编译器选项都可用作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 作为(注释良好的)示例.

          【讨论】:

            猜你喜欢
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 2020-05-30
            相关资源
            最近更新 更多