Flex 4.5 - 漫长的构建过程 [英] Flex 4.5 - to long build process

查看:34
本文介绍了Flex 4.5 - 漫长的构建过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用 flex 4.5 开发应用程序.该应用程序运行良好(完全没有性能问题),但我们需要花费很长时间来编译和构建它.一个小改动,比如在 mxml 文件中添加注释或按 Enter 键,然后重建大约需要 3 分钟.你不能那样工作.

We are developing an app using flex 4.5. The app runs just fine (no performance issues at all) but it takes us forever to compile and build it. A minor change, like just add a comment or press enter in an mxml file and rebuild takes about 3 minutes. You just cant work that way.

这是一个大约有 1300 个文件的大型项目.我们还使用 Parsley 作为 IOC 容器和一些 cairngorm 导航.我们也使用 Maven (Flex mojos),但我说的是普通的 Eclipse 构建 (Ctrl + B).

It is a large project with about 1300 files. We also use Parsley as IOC container and a beat of cairngorm navigation. We also use Maven (Flex mojos) but I am talking about a normal eclipse build (Ctrl + B).

我们将一些代码分离到不同的 SWC 中,并且我们所有的图形都存储在不同的资源 SWF 中.

We separated some of the code to a different SWC and all of our graphics are stored in a different resource SWF.

请问,您有什么建议吗?

Please, Do you have any suggestions?

问候,伊多

推荐答案

总结

  • 关闭自动构建
  • 关闭不相关的项目
  • 重新映射 Ctrl+B
  • 封装应用程序域

关闭自动构建

安装 FlashBuilder 时要做的第一件事是关闭自动构建功能".除非您处理非常小的项目,否则 Flex 编译器在后台不断构建时会变慢.它位于菜单 > 项目 > 自动构建.

First thing to do when you install FlashBuilder is turning off the automatic building "feature". The Flex compiler is waaay to slow to constantly build in the background unless you work on very small projects. It's in menu > Project > Build Automatically.

关闭不相关的项目

任何打开的项目都会消耗内存.尽可能多地关闭.

Any open project eats away memory. Close as many as you can.

重新映射 Ctrl+B

由于您使用 Ctrl+B 键绑定来启动构建过程,您应该知道这实际上将构建您的整个工作区.每个打开的项目都将被构建.当您有很多依赖项时,这将花费大量时间.

Since you use the Ctrl+B keybinding to launch the build process, you should know that this will actually build your entire workspace. Every single project that is open will be built. When you have a lot of dependencies that's gonna take a whole lot of time.

这就是为什么我重新映射 Ctrl+B 组合以构建我目前正在处理的项目.一个小的缺点是有时您必须手动"构建一些项目,但这在很大程度上被时间增加所抵消.

That's why I remap the Ctrl+B combo to just build the project that I'm currently working on. A small donwside is that sometimes you have to go 'manually' build a few projects, but that's largely outweighed by the time gain.

转到菜单 > 窗口 > 首选项.在搜索框中输入key".单击常规"下的主题键".现在在右侧的搜索框中输入build".选择自动构建",然后单击解除绑​​定命令"按钮.ctrl+B 绑定应该会消失.现在选择Build Project",然后选择Binding"输入字段(左下角)并按Ctrl+B.保存并完成.

Go to menu > Window > Preferences. Type "key" in the search box. Click the topic "keys" under "general". Now type "build" in the searchbox on the right. Select "Build Automatically" and click the "Unbind Command" button. The ctrl+B binding should disappear. Now select "Build Project", then select the "Binding" input field (lower left) and hit Ctrl+B. Save and you're done.

封装应用程序域

我没有一个项目超过 200 个文件(通常甚至少于 100 个).由于您的项目由 1300 个文件组成,因此我假设它没有单一的功能.所以你应该能够将它分割成单独的库;最好是每个应用领域一个.这将允许您编译应用程序的大量部分,并具有在应用程序中清楚地分离某些关注点的额外好处.

I don't have a single project that is bigger than 200 files (usually even less than 100). Since your project consists of 1300 files I assume that it is does not have one monolithic function. So you should be able to slice it up into separate libraries; preferably one for each application domain. This will allow you to compile sizeable bits of the application and has the added benefit of clearly separating some concerns within your application.

这篇关于Flex 4.5 - 漫长的构建过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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