FLEX提高编译效率解决方案
- 格式:docx
- 大小:101.82 KB
- 文档页数:9
提高Flex编译效率方案 一.问题描述: ............................................................................................................................................. 1 二.解决方案: ............................................................................................................................................. 1 三.编译效率测试 ......................................................................................................................................... 2 四.推荐方案 ................................................................................................................................................. 9
一.问题描述: 编译效率是开发效率中的一个重要环节,以下几种情况使得FlexBuilder的编译效率低下,1).开发人员的机器配置太低(要求2G以上内存),2).工程中加载的模块太多甚至模块间有关联,3).每次修改都自动编译整个项目。除了机器要求之外,以下分析并提供了四种能够提高编译效率的方式。
二.解决方案: 1. 采用模块化开发,不开发的就不引用,这样可大大加快编译速度。开发人员各司其职,最后发布的时候再统一builder。 2. 把 Build Automatically 选项去掉,模块编译改用手动 Build,修改完善之后才进行Build,该方式为增量编译。
3. 采用fsch + ant编译模块,fsch是一个编译的后台程序,需要在开发机器上安装,通过ant执行 build.xml文件来调用fsch服务,build文件中的执行如下: value="-library-path+=${THIRD_PARTY}/YLZFlex.swc;${THIRD_PARTY}/YLZFlex_core.swc;${THIRD_PARTY}/YLZFlex_report.swc" /> 这种方式产生的模块swf文件较采用FlexBuilder合并代码编译的结果小,但是ant编译目前无法结合应用程序Main.mxml方式编译,因此编译结果的模块需要添加样式文件,如:。
4. 安装YLZPlugin eclipse插件,在Flex模块文件上点击右键菜单“编译Flex模块”,这种方式编译简单,编译效率高而且不需要每次要编译一个模块就修改ant文件
三.编译效率测试 以下测试环境: CPU 2.4GHZ 内存:2G 开发工具Myeclipse8.5+FlexBuilder -Xmx768m -XX:MaxPermSize=256m -XX:ReservedCodeCacheSize=64m
1. 采用fsch + ant 的方式编译 第一次编译: Buildfile: E:\workspace\YLZCBP\ant\build-fsch.xml [echo] E:\workspace\YLZCBP [echo] C:\Program Files (x86)\Fcsh Server/fcsh.jar buildfcsh: [fcsh] Server is not responding. Probably it is stopped. Trying to launch... [fcsh] Server started [fcsh] Trying to connect... Attempt 1 of 5 [fcsh] Paused for 2 seconds... [fcsh] Trying to connect... Attempt 2 of 5 [fcsh] Connection established [fcsh] Send command: mxmlc E:\workspace\YLZCBP/flex-src//modules/sysmanager/SysorgManager.mxml -output=D:\greensoftware\tomcat5.5.20\webapps\YLZCBP\swf//modules/sysmanager/SysorgManager.swf -load-config=D:\flex\sdks\4.0.0/frameworks/flex-config.xml -source-path=E:\workspace\YLZCBP/flex-src -library-path+=E:\workspace\YLZCBP/flex-lib/YLZFlex.swc;E:\workspace\YLZCBP/flex-lib/YLZFlex_core.swc;E:\w orkspace\YLZCBP/flex-lib/YLZFlex_report.swc -link-report=E:\workspace\YLZCBP/flex-src/Main_report.xml -theme=D:\flex\sdks\4.0.0/frameworks/themes/Halo/halo.swc [fcsh] fcsh: Assigned 1 as the compile target id [fcsh] Loading configuration file D:\flex\sdks\4.0.0\frameworks\flex-config.xml [fcsh] E:\workspace\YLZCBP\flex-src\com\ylzinfo\sysmanager\entity\Sysfunction.as(9): col: 21 Warning: variable“TYPE_FOLDER”没有类型声明。 [fcsh] public static var TYPE_FOLDER="0"; //节点 [fcsh] ^ [fcsh] E:\workspace\YLZCBP\flex-src\com\ylzinfo\sysmanager\entity\Sysfunction.as(10): col: 21 Warning: variable“TYPE_LEAF”没有类型声明。 [fcsh] public static var TYPE_LEAF="1"; //叶子 [fcsh] ^ [fcsh] E:\workspace\YLZCBP\flex-src\com\ylzinfo\sysmanager\entity\Sysfunction.as(11): col: 21 Warning: variable“TYPE_BUTTON”没有类型声明。 [fcsh] public static var TYPE_BUTTON="2"; //按钮 [fcsh] ^ [fcsh] E:\workspace\YLZCBP\flex-src\com\ylzinfo\commons\Globals.as(11): col: 21 Warning: variable“SERVICE_CURRENTUSER”没有类型声明。 [fcsh] public static var SERVICE_CURRENTUSER="loadCurrentUser"; [fcsh] ^ [fcsh] E:\workspace\YLZCBP\flex-src\com\ylzinfo\commons\Globals.as(12): col: 21 Warning: variable“SERVICE_LOGIN”没有类型声明。 [fcsh] public static var SERVICE_LOGIN="syslogin"; [fcsh] ^ [fcsh] E:\workspace\YLZCBP\flex-src\com\ylzinfo\commons\Globals.as(13): col: 21 Warning: variable“SERVICE_LOGOUT”没有类型声明。 [fcsh] public static var SERVICE_LOGOUT="syslogout"; [fcsh] ^ [fcsh] E:\workspace\YLZCBP\flex-src\com\ylzinfo\commons\Globals.as(15): col: 21 Warning: variable“SERVICE_MENU”没有类型声明。 [fcsh] public static var SERVICE_MENU="sysfunction"; [fcsh] ^ [fcsh] E:\workspace\YLZCBP\flex-src\com\ylzinfo\commons\Globals.as(16): col: 21 Warning: variable“SERVICE_SYSCODE”没有类型声明。 [fcsh] public static var SERVICE_SYSCODE="syscode"; [fcsh] ^ [fcsh] E:\workspace\YLZCBP\flex-src\com\ylzinfo\commons\Globals.as(21): col: 24 Warning: variable“SERVICE_SYSFUNCTIONQUERY”没有类型声明。 [fcsh] public static var SERVICE_SYSFUNCTIONQUERY="sysfunctionquery"; [fcsh] ^ [fcsh] E:\workspace\YLZCBP\flex-src\com\ylzinfo\commons\Globals.as(23): col: 21 Warning: variable“SERVICE_REPORTS”没有类型声明。 [fcsh] public static var SERVICE_REPORTS="loadStatisticalReports"; [fcsh] ^