How to use bat batch to compile SWF Projects

Source: Internet
Author: User

When using FB and other ide To compile multi-module game projects, in addition to adding and removing modules, the Compilation speed is also very slow. Using BAT to compile SWF projects is fast and stable.

In this example, the batchcompute will re-compile gameloader.swf,main.swf and compile the corresponding sub-modules.

 

1 @ echo off 2 for/F "tokens = 1-4 delims = :. "% H in (" % time % ") do set start _ = % H % I % J % K 3 :: record compilation start time 4 set code = "D: \ XX \ XXX" 5: Set the code Path 6 set pub = "D: \ XX \ XXX \ bin-Debug "7 set target = % pub % 8: Set the output path 9 10 set flex_sdk =" D: \ Program Files (x86) \ Adobe Flash builder 4.6 \ sdks \ 3.6.0 "11: Set the SDK Location 12 set DEBUG = false13: Set whether to compile the SDK to debug version 14 15 set module_list = (modulea, moduleb, modulec) 16: List of sub-modules to be compiled 17 18 set APP = % code % \ SRC \ main. AS19: Project main module 20 set loader = % code % \ SRC \ gameloader. as21: Project loading class 22 23 ECHO is compiling gameloader.swf... 24% flex_sdk % \ bin \ mxmlc-target-player = 11.2 -- DEBUG = % debug %-define = config: Debug, % debug %-25 26 incremental = true-show-ActionScript-warnings = true-static-link-runtime-shared-libraries = true 27 28-strict = true-library-path + = % code % \ Lib-link-Report = % target % \ loadreport. XML-output = % target % 29 30 \ gameloader.swf % loader % 31 32 ECHO is compiling main.swf... 33% flex_sdk % \ bin \ mxmlc-target-player = 11.2 -- DEBUG = % debug %-define = config: Debug, % debug %-34 35 incremental = true-show-ActionScript-warnings = true-static-link-runtime-shared-libraries = true 36 37-strict = true-library-path + = % code % \ Lib-load-externs = % target % \ loadreport. XML-link-Report = 38 39% target % \ mainreport. XML-output = % target % \ main.swf % APP % 40 41 42 set module_target = % pub % \ modules43 set module_code = % code % \ SRC \ modules44 set module_cmd =-source-Path = % code % \ Src-source-Path = % code % \ SRC \ modules-allow-source-path-45 46 overlap = true-target-player = 11.2 -- DEBUG = % debug %-define = config:: Debug, % debug %-47 48 incremental = true-show-ActionScript-warnings = true-static-link-runtime-shared-libraries = true 49 50-strict = true-library-path + = % code % \ Lib-load-externs = % target % \ mainreport. xml51 52 for % I in % module_list % do (53 echo compiling % I... 54% flex_sdk % \ bin \ mxmlc % module_cmd %-output = % module_target % \ % I .swf % module_code % \ % I. as55) 56 57 for/F "tokens = 1-4 delims = :. "% H in (" % time % ") do set now _ = % H % I % J % K58 :: record compilation End Time 59 set/a diff _ = (% Now _ %-% start _ %)/10060 echo % Diff _ % ?? 61 pause

 

Modify parameters such as code, pub, flex, app, loader, module_target, and module_code to compile your own project. Use module_list and debug to select the sub-module to be compiled, whether the debug version has been generated.

 

If you are not familiar with BAT, refer to the following Tutorial:
Bat batch processing tutorial
BAT for Loop
Flex mxmlc compilation Command Options

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.