1、提高 Flex 编译效率方案一问题描述: .1二解决方案: .1三编译效率测试 .2四推荐方案 .9一问题描述:编译效率是开发效率中的一个重要环节,以下几种情况使得 FlexBuilder 的编译效率低下,1).开发人员的机器配置太低(要求 2G 以上内存) ,2).工程中加载的模块太多甚至模块间有关联,3).每次修改都自动编译整个项目。除了机器要求之外,以下分析并提供了四种能够提高编译效率的方式。 二解决方案: 1. 采用模块化开发,不开发的就不引用,这样可大大加快编译速度。开发人员各司其职,最后发布的时候再统一 builder。2. 把 Build Automatically 选项去掉,模
2、块编译改用手动 Build,修改完善之后才进行 Build,该方式为增量编译。3. 采用 fsch + ant 编译模块,fsch 是一个编译的后台程序,需要在开发机器上安装,通过 ant 执行 build.xml 文件来调用 fsch 服务,build 文件中的执行如下:这种方式产生的模块 swf 文件较采用 FlexBuilder 合并代码编译的结果小,但是 ant 编译目前无法结合应用程序 Main.mxml 方式编译,因此编译结果的模块需要添加样式文件,如:。4. 安装 YLZPlugin eclipse 插件,在 Flex 模块文件上点击右键菜单“编译 Flex模块”,这种方式编译简
3、单,编译效率高而且不需要每次要编译一个模块就修改ant 文件三编译效率测试以下测试环境:CPU 2.4GHZ内存:2G开发工具 Myeclipse8.5+FlexBuilder -Xmx768m-XX:MaxPermSize=256m-XX:ReservedCodeCacheSize=64m1. 采用 fsch + ant 的方式编译第一次编译:Buildfile: E:workspaceYLZCBPantbuild-fsch.xmlecho E:workspaceYLZCBPecho C:Program Files (x86)Fcsh Server/fcsh.jarbuildfcsh:fcs
4、h Server is not responding. Probably it is stopped. Trying to launch.fcsh Server startedfcsh Trying to connect. Attempt 1 of 5fcsh Paused for 2 seconds.fcsh Trying to connect. Attempt 2 of 5fcsh Connection establishedfcsh Send command: mxmlc E:workspaceYLZCBP/flex-src/modules/sysmanager/SysorgManage
5、r.mxml -output=D:greensoftwaretomcat5.5.20webappsYLZCBPswf/modules/sysmanager/SysorgManager.swf -load-config=D:flexsdks4.0.0/frameworks/flex-config.xml -source-path=E:workspaceYLZCBP/flex-src -library-path+=E:workspaceYLZCBP/flex-lib/YLZFlex.swc;E:workspaceYLZCBP/flex-lib/YLZFlex_core.swc;E:workspac
6、eYLZCBP/flex-lib/YLZFlex_report.swc -link-report=E:workspaceYLZCBP/flex-src/Main_report.xml -theme=D:flexsdks4.0.0/frameworks/themes/Halo/halo.swc fcsh fcsh: Assigned 1 as the compile target idfcsh Loading configuration file D:flexsdks4.0.0frameworksflex-config.xmlfcsh E:workspaceYLZCBPflex-srccomyl
7、zinfosysmanagerentitySysfunction.as(9): col: 21 Warning: variable“TYPE_FOLDER”没有类型声明。fcsh public static var TYPE_FOLDER=“0“; /节点fcsh fcsh E:workspaceYLZCBPflex-srccomylzinfosysmanagerentitySysfunction.as(10): col: 21 Warning: variable“TYPE_LEAF”没有类型声明。fcsh public static var TYPE_LEAF=“1“; /叶子fcsh fc
8、sh E:workspaceYLZCBPflex-srccomylzinfosysmanagerentitySysfunction.as(11): col: 21 Warning: variable“TYPE_BUTTON”没有类型声明。fcsh public static var TYPE_BUTTON=“2“; /按钮fcsh fcsh E:workspaceYLZCBPflex-srccomylzinfocommonsGlobals.as(11): col: 21 Warning: variable“SERVICE_CURRENTUSER”没有类型声明。fcsh public stati
9、c var SERVICE_CURRENTUSER=“loadCurrentUser“;fcsh fcsh E:workspaceYLZCBPflex-srccomylzinfocommonsGlobals.as(12): col: 21 Warning: variable“SERVICE_LOGIN”没有类型声明。fcsh public static var SERVICE_LOGIN=“syslogin“;fcsh fcsh E:workspaceYLZCBPflex-srccomylzinfocommonsGlobals.as(13): col: 21 Warning: variable
10、“SERVICE_LOGOUT”没有类型声明。fcsh public static var SERVICE_LOGOUT=“syslogout“;fcsh fcsh E:workspaceYLZCBPflex-srccomylzinfocommonsGlobals.as(15): col: 21 Warning: variable“SERVICE_MENU”没有类型声明。fcsh public static var SERVICE_MENU=“sysfunction“;fcsh fcsh E:workspaceYLZCBPflex-srccomylzinfocommonsGlobals.as(
11、16): col: 21 Warning: variable“SERVICE_SYSCODE”没有类型声明。fcsh public static var SERVICE_SYSCODE=“syscode“; fcsh fcsh E:workspaceYLZCBPflex-srccomylzinfocommonsGlobals.as(21): col: 24 Warning: variable“SERVICE_SYSFUNCTIONQUERY”没有类型声明。fcsh public static var SERVICE_SYSFUNCTIONQUERY=“sysfunctionquery“; fc
12、sh fcsh E:workspaceYLZCBPflex-srccomylzinfocommonsGlobals.as(23): col: 21 Warning: variable“SERVICE_REPORTS”没有类型声明。fcsh public static var SERVICE_REPORTS=“loadStatisticalReports“; fcsh fcsh E:workspaceYLZCBPflex-srccomylzinfocommonsGlobals.as(24): col: 21 Warning: variable“SERVICE_REPORTS_STATISTICA
13、L”没有类型声明。fcsh public static var SERVICE_REPORTS_STATISTICAL=“setStatisticalReports“; fcsh fcsh E:workspaceYLZCBPflex-srccomylzinfocommonsGlobals.as(27): col: 21 Warning: variable“SERVICE_LOCALDB”没有类型声明。fcsh public static var SERVICE_LOCALDB=“localDBService“; fcsh fcsh E:workspaceYLZCBPflex-srccomylz
14、infosysmanagerSystemUtil.as(26): col: 30 Warning: return value for function“init”没有类型声明。fcsh public static function init() fcsh fcsh E:workspaceYLZCBPflex-srccomylzinfosysmanagerSystemUtil.as(74): col: 39 Warning: return value for function“reloadSyscode”没有类型声明。fcsh public static function reloadSysco
15、de() fcsh fcsh E:workspaceYLZCBPflex-srccomylzinfosysmanagerSystemUtil.as(79): col: 11 Warning: variable“datas”没有类型声明。fcsh var datas=res.getArrayDatas(); fcsh fcsh E:workspaceYLZCBPflex-srccomylzinfosysmanagerSystemUtil.as(97): col: 8 Warning: variable“params”没有类型声明。fcsh var params = new Object(); f
16、csh fcsh E:workspaceYLZCBPflex-srccomylzinfosysmanagerSystemUtil.as(109): col: 12 Warning: variable“i”没有类型声明。fcsh for(var i=0;irows.length;i+) fcsh fcsh E:workspaceYLZCBPflex-srccomylzinfosysmanagerSystemUtil.as(120): col: 52 Warning: return value for function“onLoadFunctionSuccess”没有类型声明。fcsh funct
17、ion onLoadFunctionSuccess(res:ResponseEntity) fcsh fcsh E:workspaceYLZCBPflex-srccomylzinfosysmanagerSystemUtil.as(122): col: 10 Warning: variable“rows”没有类型声明。fcsh var rows=res.datas;fcsh fcsh E:workspaceYLZCBPflex-srccomylzinfosysmanagerSystemUtil.as(151): col: 8 Warning: variable“params”没有类型声明。fcs
18、h var params = new Object(); fcsh fcsh E:workspaceYLZCBPflex-srccomylzinfosysmanagerSystemUtil.as(221): col: 50 Warning: return value for function“onLoadReportSuccess”没有类型声明。fcsh function onLoadReportSuccess(res:ResponseEntity)fcsh fcsh E:workspaceYLZCBPflex-srcviewsSysroleGrantWindow.mxml(26): Warn
19、ing: ewZ文_application has been deprecated since 4.0. Please use FlexGlobals.topLevelApplication.fcsh var window:SysroleGrantWindow = SysroleGrantWindow(PopUpManager.createPopUp(Application.application as DisplayObject, SysroleGrantWindow , true) ; fcsh E:workspaceYLZCBPflex-srcviewsSysroleGrantWindo
20、w.mxml(28): Warning: return value for function“doCloseWindow”没有类型声明。fcsh function doCloseWindow()fcsh E:workspaceYLZCBPflex-srcviewsSysroleGrantWindow.mxml(40): Warning: return value for function“close”没有类型声明。fcsh public function close() fcsh E:workspaceYLZCBPflex-srcviewsSysroleGrantWindow.mxml(46)
21、: Warning: return value for function“onLoadFunctionSuccess”没有类型声明。fcsh private function onLoadFunctionSuccess(res:ResponseEntity) fcsh E:workspaceYLZCBPflex-srcviewsSysroleGrantWindow.mxml(60): Warning: return value for function“initFunctiontree”没有类型声明。fcsh public function initFunctiontree()fcsh E:w
22、orkspaceYLZCBPflex-srcviewsSysroleGrantWindow.mxml(72): Warning: return value for function“init”没有类型声明。fcsh private function init()fcsh E:workspaceYLZCBPflex-srcviewsSysroleGrantWindow.mxml(77): Warning: return value for function“onSaveFunctionSuccess”没有类型声明。fcsh private function onSaveFunctionSucce
23、ss(res:ResponseEntity) fcsh E:workspaceYLZCBPflex-srcviewsSysroleGrantWindow.mxml(80): Warning: return value for function“save”没有类型声明。fcsh private function save()fcsh E:workspaceYLZCBPflex-srcviewsSysroleGrantWindow.mxml(86): Warning: variable“i”没有类型声明。fcsh for(var i=0;ifunctions.length;i+)fcsh E:wo
24、rkspaceYLZCBPflex-srcviewsSysroleGrantWindow.mxml(92): Warning: variable“i”没有类型声明。fcsh for(var i=0;ipartfunctions.length;i+)fcsh E:workspaceYLZCBPflex-srcviewsSysroleGrantWindow.mxml(92): Warning: 变量定义重复。fcsh for(var i=0;ipartfunctions.length;i+)fcsh E:workspaceYLZCBPflex-srcviewsSysorgGrantWindow.m
25、xml(40): Warning: ewZ文_application has been deprecated since 4.0. Please use FlexGlobals.topLevelApplication.fcsh var window:SysorgGrantWindow = SysorgGrantWindow(PopUpManager.createPopUp(Application.application as DisplayObject, SysorgGrantWindow , true) ; fcsh E:workspaceYLZCBPflex-srcviewsSysorgG
26、rantWindow.mxml(42): Warning: return value for function“doCloseWindow”没有类型声明。fcsh function doCloseWindow()fcsh E:workspaceYLZCBPflex-srcviewsSysorgGrantWindow.mxml(62): Warning: return value for function“grantOrg”没有类型声明。fcsh private function grantOrg()fcsh E:workspaceYLZCBPflex-srcviewsSysorgGrantWi
27、ndow.mxml(70): Warning: variable“i”没有类型声明。fcsh for(var i=0;iitems.length;i+)fcsh E:workspaceYLZCBPflex-srcviewsSysreportGrantWindow.mxml(34): Warning: return value for function“doCloseWindow”没有类型声明。fcsh function doCloseWindow()fcsh E:workspaceYLZCBPflex-srcviewsSysreportGrantWindow.mxml(46): Warning
28、: return value for function“close”没有类型声明。fcsh public function close() fcsh E:workspaceYLZCBPflex-srcviewsSysreportGrantWindow.mxml(52): Warning: return value for function“onLoadReportSuccess”没有类型声明。fcsh private function onLoadReportSuccess(res:ResponseEntity) fcsh E:workspaceYLZCBPflex-srcviewsSysre
29、portGrantWindow.mxml(66): Warning: return value for function“initReportList”没有类型声明。fcsh public function initReportList()fcsh E:workspaceYLZCBPflex-srcviewsSysreportGrantWindow.mxml(78): Warning: return value for function“init”没有类型声明。fcsh private function init()fcsh E:workspaceYLZCBPflex-srcviewsSysr
30、eportGrantWindow.mxml(83): Warning: return value for function“onSaveReportSuccess”没有类型声明。fcsh private function onSaveReportSuccess(res:ResponseEntity) fcsh E:workspaceYLZCBPflex-srcviewsSysreportGrantWindow.mxml(86): Warning: return value for function“save”没有类型声明。fcsh private function save()fcsh E:w
31、orkspaceYLZCBPflex-srcmodulessysmanagerSysorgManager.mxml(46): Warning: variable“lastRollOverIndex”没有类型声明。fcsh private var lastRollOverIndex;fcsh E:workspaceYLZCBPflex-srcmodulessysmanagerSysorgManager.mxml(48): Warning: variable“state”没有类型声明。fcsh private var state=“default“;fcsh E:workspaceYLZCBPfl
32、ex-srcmodulessysmanagerSysorgManager.mxml(53): Warning: return value for function“result”没有类型声明。fcsh function result(res:ResponseEntity)fcsh E:workspaceYLZCBPflex-srcmodulessysmanagerSysorgManager.mxml(57): Warning: variable“datas”没有类型声明。fcsh var datas=res.getArrayDatas(); fcsh E:workspaceYLZCBPflex
33、-srcmodulessysmanagerSysorgManager.mxml(120): Warning: return value for function“yesFunction”没有类型声明。fcsh function yesFunction()fcsh E:workspaceYLZCBPflex-srcmodulessysmanagerSysorgManager.mxml(134): Warning: return value for function“onDeleteSuccess”没有类型声明。fcsh function onDeleteSuccess(res:ResponseE
34、ntity)fcsh E:workspaceYLZCBPflex-srcmodulessysmanagerSysorgManager.mxml(157): Warning: return value for function“doReset”没有类型声明。fcsh private function doReset()fcsh E:workspaceYLZCBPflex-srcmodulessysmanagerSysorgManager.mxml(167): Warning: return value for function“doSave”没有类型声明。fcsh private functio
35、n doSave()fcsh E:workspaceYLZCBPflex-srcmodulessysmanagerSysorgManager.mxml(175): Warning: return value for function“onAddSuccess”没有类型声明。fcsh function onAddSuccess(res:ResponseEntity) fcsh E:workspaceYLZCBPflex-srcmodulessysmanagerSysorgManager.mxml(202): Warning: return value for function“onUpdateS
36、uccess”没有类型声明。fcsh function onUpdateSuccess(res:ResponseEntity)fcsh E:workspaceYLZCBPflex-srcmodulessysmanagerSysorgManager.mxml(211): Warning: 变量定义重复。fcsh var rs:RemoteService=new RemoteService(“sysorgupdate“); fcsh E:workspaceYLZCBPflex-srcmodulessysmanagerSysorgManager.mxml(225): Warning: return
37、value for function“initContentMenu”没有类型声明。fcsh public function initContentMenu()fcsh E:workspaceYLZCBPflex-srcmodulessysmanagerSysorgManager.mxml(267): Warning: return value for function“clickGrantorg”没有类型声明。fcsh function clickGrantorg(event:Event)fcsh E:workspaceYLZCBPflex-srcmodulessysmanagerSysor
38、gManager.mxml(275): Warning: return value for function“callback”没有类型声明。fcsh function callback()fcsh E:workspaceYLZCBPflex-srcmodulessysmanagerSysorgManager.mxml(298): Warning: return value for function“clickGrant”没有类型声明。fcsh function clickGrant(event:Event)fcsh E:workspaceYLZCBPflex-srcmodulessysman
39、agerSysorgManager.mxml(331): Warning: return value for function“clickReportGrant”没有类型声明。fcsh function clickReportGrant(event:Event)fcsh E:workspaceYLZCBPflex-srcmodulessysmanagerSysorgManager.mxml(369): Warning: return value for function“onValidateSuccess”没有类型声明。fcsh function onValidateSuccess(res:R
40、esponseEntity) fcsh E:workspaceYLZCBPflex-srcmodulessysmanagerSysorgManager.mxml(405): Warning: variable“i”没有类型声明。fcsh for(var i=0;iobj.length;i+)fcsh E:workspaceYLZCBPflex-srcmodulessysmanagerSysorgManager.mxml(469): Warning: return value for function“onLoadPRRolesSuccess”没有类型声明。fcsh private functi
41、on onLoadPRRolesSuccess(res:ResponseEntity) fcsh E:workspaceYLZCBPflex-srcmodulessysmanagerSysorgManager.mxml(498): Warning: Data binding will not be able to detect assignments to “sysorg“.fcsh ns1:YLZTree id=“sysorgTree“ fcsh E:workspaceYLZCBPflex-srcmodulessysmanagerSysorgManager.mxml(498): Warnin
42、g: Data binding will not be able to detect assignments to “parent“.fcsh ns1:YLZTree id=“sysorgTree“ fcsh D:flexsdks4.0.0frameworkslibsspark.swc$defaults.css(26): Warning: The style backgroundColor is only supported by type ponents.BorderContainer with the theme(s) spark.fcsh D:flexsdks4.0.0framework
43、slibsspark.swc$defaults.css(99): Warning: The style borderColor is only supported by type ponents.Panel with the theme(s) spark.fcsh D:flexsdks4.0.0frameworkslibsspark.swc$defaults.css(97): Warning: The style backgroundColor is only supported by type ponents.Panel with the theme(s) spark.fcsh D:flex
44、sdks4.0.0frameworkslibsspark.swc$defaults.css(101): Warning: The style dropShadowVisible is only supported by type ponents.Panel with the theme(s) spark.fcsh D:flexsdks4.0.0frameworkslibsspark.swc$defaults.css(100): Warning: The style cornerRadius is only supported by type ponents.Panel with the the
45、me(s) spark.fcsh D:flexsdks4.0.0frameworkslibsspark.swc$defaults.css(99): Warning: The style borderAlpha is only supported by type ponents.Panel with the theme(s) spark.fcsh D:flexsdks4.0.0frameworkslibsspark.swc$defaults.css(168): Warning: The style borderColor is only supported by type ponents.TitleWindow with the theme(s) spark.fcsh D:flexsdks4.0.0frameworkslibsspark.swc$defaults.css(170): Warning: The style dropShadowVisible is only supported by type ponents.TitleWindow with the theme(s) spark.fcsh D:flexsdks4.0.0frameworkslibsspa