代码之家  ›  专栏  ›  技术社区  ›  Mike

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

  •  3
  • Mike  · 技术社区  · 16 年前

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

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

    在使用ant任务mxmlc时,是否有方法设置相同的参数?

    干杯,

    迈克

    5 回复  |  直到 9 年前
        1
  •  3
  •   Christophe Herreman    16 年前

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

    <mxmlc services="../services-config.xml"/>
    
        2
  •  3
  •   James Fassett    15 年前

    我不知道。

    如果在文档中仍然找不到该任务,则可以将其与子节点一起使用。

    例子:

    <exec executable="${mxmlc.exe}" dir="${basedir}">
        <arg line="-source-path '${flex2sdk.locale.dir}'" />
        <arg line="-locale en_US" />
    </exec>
    
        3
  •  1
  •   Jrobertiko    13 年前

    我有相同的问题,服务属性在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
  •  0
  •   Ed Haack    15 年前

    这是通过以下方式实现的:

    <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应用程序的方式…这意味着克里斯托夫是对的。

        5
  •  0
  •   Gene Pavlovsky jpmuc    9 年前

    大多数编译器选项都可用作 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 ,您可以随时使用 flex-config.xml air-config.xml 从您的SDK作为一个(注释良好的)示例。

    推荐文章