如何确定 MXMLC 编译哪些文件 [英] How to determine what files MXMLC compiles
问题描述
我需要一种方法来以编程方式记录在 MXMLC 编译中使用的源文件.理想情况下,会有一个标志传递给 MXMLC,让它报告它正在编译的源文件的完整列表,但似乎没有这样的标志.一般情况下,您只需将 main.mxml 文件传递给 MXMLC,它就会启动并编译所需的所有内容,而不会告诉您它在做什么.据我所知,您也无法明确列出要编译的文件;它将自动解析引用并编译引用的源代码,而无需任何方式来控制该行为或对其进行报告.
I need a way to programmatically record what source files are consumed in an MXMLC compile. Ideally there would be a flag to pass to MXMLC to have it report the complete list of source files it is compiling, but there doesn't seem to be such a flag. It seems generally you just pass a main.mxml file to MXMLC and it goes off and compiles everything it needs to without telling you what it's doing. As far as I can tell, you also cannot explicitly list the files for it to compile; it will resolve references automatically and compile referenced sources without any way to control that behavior or report on it.
如果编译器无法提供此信息并且用户无法控制此行为,我能想到的唯一其他选择是为 MXML 编写我自己的源代码扫描程序,它将遍历代码树中的所有引用以提供报告MXMLC应该编译什么,尽管这显然容易出错,而且肯定不是我所期待的.
If the compiler cannot supply this information and a user cannot control this behavior, the only other option I can think of is write my own source code scanner for MXML that will traverse all the references in a code tree to give a report of what MXMLC should be compiling, though that's obviously error prone and certainly not something I'm looking forward to.
当然,由于我对 Flex 没有很多经验,因此我可能遗漏了一个明显的答案.
Of course, since I don't have a whole lot of experience with Flex, there may be an obvious answer that I'm missing.
谢谢
推荐答案
您应该在链接报告中找到您想要的内容:
You should find what you're after in the link report:
将此参数添加到您的编译器参数:
Add this param to your compiler arguments:
-link-report output.xml
它为您提供了大量信息,因此还有一个 方便的 AIR 工具,用于解析结果.
It gives you a tonne of information, so there's also a handy AIR tool for parsing the results.
这篇关于如何确定 MXMLC 编译哪些文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!