启用控制台输出EXEC Ant任务 [英] Enabling Console output for exec ANT task
问题描述
在Eclipse中我推出使用以下Macrodef从ANT嵌入的SWF的HTML页面:
Inside eclipse I'm launching an html page with a swf embedded from ANT using the following Macrodef:
<macrodef name="runhtml">
<attribute name="url" />
<attribute name="browser" default="${app.browser.firefox}" />
<sequential>
<exec
executable="open"
vmlauncher="true"
spawn="false"
failonerror="true">
<arg line="-a '@{browser}'" />
<arg line="@{url}" />
</exec>
</sequential>
</macrodef>
尽管该SWF包含痕迹,我没有得到从他们在控制台中的任何输出的事实。可能是什么原因?
Despite the fact that the swf contains traces, I am not getting any output from them in the console. What could be causing this?
推荐答案
为了从Flash得到的痕迹,你需要运行Flash调试器(FDB)。幸运的是,它带有的Flex SDK。 (http://www.adobe.com/devnet/flex/flex-sdk-download.html)
In order to get traces from Flash you need to run the Flash Debugger (FDB). Luckily it comes with the Flex SDK. (http://www.adobe.com/devnet/flex/flex-sdk-download.html)
这是我使用Ant来启动Flash调试器,而这又是因为目标是一个HTML文件将启动您的浏览器采样任务。如果目标是一个SWF文件,然后它会在一个独立的窗口FDB只需运行。
This is a sample task that I am using in Ant to launch the Flash Debugger, which in turn will launch your browser because the target is an HTML file. If the target was a SWF file then it would simply run in a standalone FDB window.
<target name="launch-browser">
<echo file="${basedir}/build/.fdbinit">run file://${outputdir}/swf/index.html
continue</echo>
<exec executable="${sdk.flex}bin/fdb" spawn="false" dir="build">
<arg line="-unit"/>
</exec>
</target>
这个任务将首先编写一个名为.fdbinit文件,其中包含了FDB启动时将运行命令。然后将它与-unit FDB开始,以确保它保持正确连接到Ant构建器(我其实不是这个100%,但它是必需的)。这会给你的浏览器,并痕迹(也实际调试器的控制)的终端窗口。
This task will first write a file called .fdbinit which contains the commands that fdb will run when launched. Then it starts fdb with -unit to make sure it stays properly attached to the ant builder (I'm actually not 100% on this but it is required). This will give you the browser, and the traces (also the actual debugger control) in your terminal window.
-
另外,使用原来的macrodef,如果你有你的机器上安装Flash调试播放器;您可以配置您的Flash播放器编辑您的mm.cfg文件中,并设置TraceOutputFileEnable和TraceOutputFileName选项写的痕迹到一个文件中。
Alternatively, using your original macrodef, if you have the Flash Debug Player installed on your machine ; you can configure your Flash Player to write the traces to a file by editing your mm.cfg file and setting the TraceOutputFileEnable and TraceOutputFileName options.
这个文件在/库/ Application Support发现/ Macromedia公司的OSX。
This file is found in /Library/Application Support/Macromedia on OSX.
有关的mm.cfg相关的和额外的文档:
的http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7fc9.html
Relevant and additional docs for mm.cfg: http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7fc9.html
这篇关于启用控制台输出EXEC Ant任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!