Flash Builder(Flex)ANT构建和调试

时间:2011-01-06 13:11:47

标签: flex debugging ant

我正在尝试使用ANT和Flash Builder 4进行编译和调试。 编译很简单,但无法让调试器工作。

我想在Flash Builder中使用ANT调试SWF文件,这样断点,控制台跟踪和所有内容都可以正常工作。

到目前为止我的脚本。构建* .as到* .swf并从bin-debug移动到deploy文件夹。 如何为创建的SWF启动Flash Builder调试器?


<target name="Compile level 1">
    <antcall target="compile flex file">
        <param name="file" value="GameOffice"/>
    </antcall>
    <antcall target="open player">
        <param name="file" value="GameOffice.swf"/>
    </antcall>
</target>

<target name="compile flex file">
    <mxmlc file="${SRC_DIR}/${file}.as" output="${BUILD_DIR}/${file}.swf" 
        actionscript-file-encoding="UTF-8" 
        keep-generated-actionscript="true" 
        incremental="true" 
        static-link-runtime-shared-libraries="true"
        show-actionscript-warnings="true"
        failonerror="true"
        debug="true"
        optimize="false">

        <load-config filename="${FLEX_HOME}/frameworks/flex-config.xml" />
        <source-path path-element="${FLEX_HOME}/frameworks" />

        <compiler.include-libraries dir="${basedir}/libs" append="true">
            <include name="HelloThereLibGames.swc" />
            <include name="HelloThereLibStructure.swc" />
            <include name="HelloThereLibUtils.swc" />
        </compiler.include-libraries>

        <metadata description="Hello There Production">
            <contributor name="Fredrick Bäcker" />
        </metadata>

    </mxmlc>
    <copy todir="${DEPLOY_DIR}" file="${BUILD_DIR}/${file}.swf"/> 
</target>

3 个答案:

答案 0 :(得分:3)

我在Google上尝试了一次点击:http://blogs.4point.com/armaghan.chaudhary/2009/04/remote-debugging-using-flex-builder-ide.html

我不明白你为什么要在flashbuilder中使用ant构建。好像穿过水流?

IMHO自动构建脚本属于像hudson这样的CI环境。我认为它帮了自己一个忙,让我的开发环境处理本地构建和调试的模糊。

无论如何,祝你好运

答案 1 :(得分:0)

假设您正在使用本地Web服务器,您只需在Flash Builder中打开调试套接字,方法是将调试启动配置设置为空白html页面(例如about:blank),然后将浏览器打开到localhost(或者你设置的任何网址。

在这种情况下,您将使用ant运行构建,点击调试以打开套接字,然后切换到您的Web浏览器并加载localhost。

答案 2 :(得分:0)

我意识到这个答案可能有点晚了,但迟到总比没有好!

当你知道如何时,真的很简单。我前一段时间做了一篇博客文章,应该告诉你如何:

http://blog.tiltdigital.com/flex/running-flash-builder-4-in-debug-mode-from-apache-ant/

基本上,您只需要在项目属性中将Ant Builder添加到Flash Builder的“构建器”属性中。然后,您可以使用构建脚本来编译/调试,就像通常使用Flash Builder编译器/调试器一样。