Flash Builder如何确定要包含哪些sdk库? [英] How does Flash Builder determine which sdk libraries to include?
问题描述
在Flash Builder中创建新项目时,如何确定将哪个sdk库包含在构建路径中?
如果我创建一个新的普通 Actionscript 项目并选择Flex 4.1 ,以下库会显示在构建路径中:
如果我回去切换到Flex 3.5 它只包括:
如果我制作一个新的 Flex Web 项目并选择Flex 3.5 它包括:
这些值在Flash Builder中硬编码,还是以某种方式从SDK配置文件读取它们?我查看了所有的XML配置文件,如flex-config.xml和air-config.xml,看起来这个信息不存在于任何地方。
谢谢。 / b>
经过大量的反复试验和一些反编译器检查,我得到了答案:
- Flash Builder从sdk框架目录加载flex-config.xml或air-config.xml文件(取决于项目类型)。
- 它通过
library-path
和library-external-path
中列出的每个条目将其添加到类路径,如果它是一个SWC。如果条目是一个目录,它会扫描SWCs的目录并包含它们。
- 每个项目类型都有一个硬编码的排除列表,告诉Flash Builder哪些SWC离开类路径。对于一个简单的动作项目这个列表有17个项目。对于Flex Web项目,列表仅包含
flex.swc
。这个排除列表被写入到.actionScriptProperties
文件中。 - 所有剩余的(未排除的)SWC会自动添加到类路径中。在
.actionScriptProperties
文件中不需要输入。 (也就是说,您可以在.swc扩展名中引入任何具有.swc扩展名的文件,Flash Builder将包含它。)
When creating a new project in Flash Builder, how does it determine which sdk libraries to include in the build path?
If I create a new plain Actionscript project and select Flex 4.1 the following libraries show up in the build path:
- playerglobal
- textLayout
- osmf
- flash-integration
- flex
- utilities
If I go back and switch to Flex 3.5 it only includes:
- playerglobal
- flex
- utilities
If I make a new Flex Web project and select Flex 3.5 it includes:
- playerglobal
- framework
- automation
- automation_agent
- automation_dmv
- automation_flashflexkit
- datavisualization
- qtp
- rpc
- utilities
Are these values hardcoded in Flash Builder or is it somehow reading them from the SDK config files? I looked through all the xml config files like flex-config.xml and air-config.xml and it doesn't look like this information exists anywhere.
Thanks.
After a lot of trial and error and some inspection with a decompiler I have the answer:
- Flash Builder loads either the flex-config.xml or air-config.xml file (depending on the project type) from the sdk frameworks directory.
- It goes through each entry listed in
library-path
andlibrary-external-path
adds it to the classpath if it is a SWC. If the entry is a directory it scans that directory for SWCs and includes them. - Each project type has a hardcoded list of exclusions which tell Flash Builder which SWCs to leave out of the classpath. For a plain actionscript project this list has 17 items. For a Flex Web project the list consists only of
flex.swc
. This list of exclusions is written to the.actionScriptProperties
file. - Any remaining (not excluded) SWCs are automatically added to the classpath. No entry is necessary in the
.actionScriptProperties
file. (i.e. You can throw any file with a .swc extension in the frameworks/libs directory and Flash Builder will include it.)
这篇关于Flash Builder如何确定要包含哪些sdk库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!