我通过 Flex 构建路径/源路径添加了类目录,现在“构建工作区"需要永远 [英] I added class directory via Flex Build Path/Source Path, and now 'building workspace' takes forever

查看:29
本文介绍了我通过 Flex 构建路径/源路径添加了类目录,现在“构建工作区"需要永远的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从 Flash 到 Flashbuilder.

I am coming from flash to flashbuilder.

我的计算机上有一个目录 AS3_classes_dir,用于存储我的所有类,包括我的 greensock 和 papervision 包.在我制作的每个 flash 应用程序中,我都会将该目录包含在源路径中,以便我可以导入我可能需要的任何内容.在 flash 中编译(使用 ctrl/enter)只需要很少的时间;只编译专门导入的类.

I have a directory, AS3_classes_dir, on my computer that stores all of my classes, including my greensock and papervision packages. In every flash app that I make I include that directory in the Source Path, so that I can import whatever I may need. Compiling in flash (using ctrl/enter) takes very little time; only the classes that are specifically imported are compiled.

所以今天我在 flashbuilder 中做到了这一点,通过 Flex 构建路径/源路径包含 AS3_classes_dir ...但现在编译时间是几分钟,即使我什至没有导入任何来自内部的课程.

So today I did that in flashbuilder, included AS3_classes_dir via Flex Build Path/Source Path ... but now the compile time are a couple of minutes, even though I am not even importing ANY of the classes from within.

我没有打开任何其他项目.

I do not have any other projects open.

推荐答案

FlashBuilder 和 Flash Pro 的最大区别在于前者会将所有引用的类加载到内存中.这对于代码提示(或智能感知)、自动导入和 IDE 中的警告/错误消息工作是必要的(可能还有一些我现在没有想到的其他功能.如果你让 FB 总是加载所有类你可能有,那么你一定会遇到记忆墙.

The big difference between FlashBuilder and Flash Pro is that the former will load all the referenced classes into memory. This is necessary for the code hinting (or intellisense), the automatic imports and the warning/error messages in the IDE to work (and probably some other functionalities that I'm not thinking of right now. If you make FB always load all classes you possibly have, then you're bound to hit a memory wall.

因此,将所有课程都放在一个大项目中并不是一种好方法.它也不是从可维护性的角度来看(在团队中这将是一场噩梦),但这是一个不同的讨论.所以我觉得你应该重新考虑一下.请注意,我理解您不愿意这样做,但从长远来看,让您的依赖项更有条理是值得的.

Therefor having one big project with all your classes is simply not a good approach. It also isn't from a maintainability point of view (in a team it would be a nightmare), but that's a different discussion. So I think you should reconsider it. Note that I understand your reluctance to do so, but in the long run it'll pay off to keep your dependencies more organized.

因此,您应该做的第一件事是将庞大的项目切成可以独立存在的较小部分(库项目),然后仅将您需要的依赖项链接到主项目中.有两种主要方法可以链接主项目中的其他项目.在项目属性中,转到Flex 库构建路径"并选择库路径"选项卡.

So the first thing you should do, is cutting that huge project into smaller pieces (library projects) that can stand on their own and then link only the dependencies you need into the main project. There are two main ways to link other projects in your main project. In the project properties, go to 'Flex library build path' and select the tab 'Library path'.

  • 添加项目..."允许您从 FlashBuilder 工作区添加另一个项目.如果您要在处理主项目时对依赖项项目进行大量更改,请使用此选项.请注意,这比其他选项慢,因为每次编译主项目时都会编译依赖项.
  • 添加 SWC 文件夹..."和添加 SWC..."可让您添加已编译的库.如果依赖项目相对稳定并且几乎不会改变,请使用此选项.

我希望这些信息足以让您开始组织您的项目.我还写了关于类似问题的另一个答案,其中包含一些可能对您有所帮助的绩效和组织技巧:Flex 4.5 - 漫长的构建过程

I hope this is enough info to get you started organizing your projects. I have also written another answer on a similar question with some performance and organizational tips that might be helpful to you: Flex 4.5 - to long build process

这篇关于我通过 Flex 构建路径/源路径添加了类目录,现在“构建工作区"需要永远的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆