Flash Builder 如何确定要包含哪些 sdk 库? [英] How does Flash Builder determine which sdk libraries to include?
问题描述
在 Flash Builder 中创建新项目时,它如何确定要在构建路径中包含哪些 sdk 库?
When creating a new project in Flash Builder, how does it determine which sdk libraries to include in the build path?
如果我创建一个新的普通 Actionscript 项目并选择 Flex 4.1,构建路径中会显示以下库:
If I create a new plain Actionscript project and select Flex 4.1 the following libraries show up in the build path:
- 全球玩家
- 文本布局
- osmf
- 闪存集成
- 弹性
- 实用程序
如果我返回并切换到 Flex 3.5,它只包括:
If I go back and switch to Flex 3.5 it only includes:
- 全球玩家
- 弹性
- 实用程序
如果我创建一个新的 Flex Web 项目并选择 Flex 3.5,它包括:
If I make a new Flex Web project and select Flex 3.5 it includes:
- 全球玩家
- 框架
- 自动化
- automation_agent
- automation_dmv
- automation_flashflexkit
- 数据可视化
- qtp
- rpc
- 实用程序
这些值是在 Flash Builder 中硬编码的还是从 SDK 配置文件中读取的?我查看了所有 xml 配置文件,如 flex-config.xml 和 air-config.xml,但看起来这些信息不存在任何地方.
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.
谢谢.
推荐答案
经过大量的反复试验和一些反编译器检查后,我得到了答案:
After a lot of trial and error and some inspection with a decompiler I have the answer:
- Flash Builder 从 sdk 框架目录加载 flex-config.xml 或 air-config.xml 文件(取决于项目类型).
- 它遍历
library-path
中列出的每个条目,如果它是 SWC,library-external-path
会将其添加到类路径中.如果条目是目录,它会扫描该目录中的 SWC 并将其包含在内. - 每个项目类型都有一个硬编码的排除项列表,这些排除项告诉 Flash Builder 哪些 SWC 不包括在类路径之外.对于一个普通的 actionscript 项目,这个列表有 17 个项目.对于 Flex Web 项目,该列表仅包含
flex.swc
.此排除项列表将写入.actionScriptProperties
文件. - 任何剩余(不排除)SWC 都会自动添加到类路径中.
.actionScriptProperties
文件中不需要任何条目.(即,您可以将任何扩展名为 .swc 的文件放入 frameworks/libs 目录中,Flash Builder 将包含它.)
- 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屋!