转载关于使用Ant打包Flex的一些脚本
2009-09-05 09:21
489 查看
<?xml version="1.0" encoding="utf-8"?> <project name="Flex Ant Builder Sample Project" basedir="."> <taskdef resource="flexTasks.tasks" classpath="D:/program files/Flex Builder 3/Flex Builder 3/sdks/flex_sdk_3/ant/lib/flextasks.jar"/> <property name="FLEX_HOME" value="D:/program files/Flex Builder 3/Flex Builder 3/sdks/flex_sdk_3"/> <property name="app_root" value="${basedir}"/> <property name="deploy_dir" value="bin-debug"/> <!-- could change --> <!-- compiled mxml/as file name --> <property name="filename" value="m_fangshou"/> <!-- compiled mxml/as file ext --> <property name="fileext" value="mxml"/> <!-- third party swc--> <!--<property name="third_party" value="d:/work/thirdparty/flexlib" />--> <!-- modular application's main application filename --> <property name="mainapp" value=""/> <!-- output package direction,end with / --> <property name="package" value="com/adobe/cairngorm/game/view/window/"/> <property name="flashplayer" value="d:/eclipse/adobe/flex builder 2 plug-in/player/debug/saflashplayer.exe"/> <property name="ie" value="c:\program files\internet explorer\iexplore.exe"/> <!-- compile a mxml/as file --> <target name="compile" depends="cleanCompile"> <mxmlc file="${app_root}/src/${package}${filename}.${fileext}" output="${deploy_dir}/${package}${filename}.swf" actionscript-file-encoding="utf-8" keep-generated-actionscript="false" warnings="false" incremental="true"> <!-- ***** source file path *******--> <compiler.source-path path-element="${basedir}/src"/> <!-- get default compiler options. --> <load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/> <!-- List of path elements that form the roots of ActionScript class hierarchies. --> <source-path path-element="${FLEX_HOME}/frameworks"/> <!-- List of SWC files or directories that contain SWC files. --> <compiler.library-path dir="${FLEX_HOME}/frameworks" append="true"> <include name="libs"/> <include name="../bundles/{locale}"/> </compiler.library-path> <compiler.library-path dir="src/assets/swc" append="true"> <include name="chengchi.swc"/> <include name="chengwai.swc"/> </compiler.library-path> <compiler.library-path dir="libs" append="true"> <include name="Cairngorm.swc"/> </compiler.library-path> <!-- ***** thirdparth swc ***** --> <compiler.include-libraries dir="libs" append="true"> <include name="cairngorm.swc" /> </compiler.include-libraries> <!-- set size of output swf file. <default-size width="500" height="600" /> --> </mxmlc> <delete> <!-- Deletes cache file --> <fileset dir="${app_root}/${package}" includes="${fileName}*.cache" defaultexcludes="false"/> </delete> </target> <!-- compile mxml file and Generate a Link Report for the embed module --> <target name="CompileAndGenerateLinkReport"> <mxmlc file="${app_root}/${package}${fileName}.${fileExt}" link-report="${app_root}/${package}${fileName}_LinkReport.xml" output="${DEPLOY_DIR}/${package}${fileName}.swf" actionscript-file-encoding="UTF-8" keep-generated-actionscript="false" incremental="true"> <!-- Get default compiler options. --> <load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/> <!-- List of path elements that form the roots of ActionScript class hierarchies. --> <source-path path-element="${FLEX_HOME}/frameworks"/> <source-path path-element="${app_root}"/> <!-- List of SWC files or directories that contain SWC files. --> <compiler.library-path dir="${FLEX_HOME}/frameworks" append="true"> <include name="libs"/> <include name="../bundles/{locale}"/> </compiler.library-path> <!-- Set size of output SWF file. --> <default-size width="500" height="600"/> </mxmlc> <delete> <!-- Deletes cache file --> <fileset dir="${app_root}/${package}" includes="${fileName}*.cache" defaultexcludes="false"/> </delete> </target> <!-- compile Modular mxml file with mainApp's Link Report --> <target name="CompileModuleWithLinkReport"> <mxmlc file="${app_root}/${package}${fileName}.${fileExt}" load-externs="${app_root}/${mainApp}_LinkReport.xml" output="${DEPLOY_DIR}/${package}${fileName}.swf" actionscript-file-encoding="UTF-8" keep-generated-actionscript="false" incremental="true"> <!-- Get default compiler options. --> <load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/> <!-- List of path elements that form the roots of ActionScript class hierarchies. --> <source-path path-element="${FLEX_HOME}/frameworks"/> <!-- List of SWC files or directories that contain SWC files. --> <compiler.library-path dir="${FLEX_HOME}/frameworks" append="true"> <include name="libs"/> <include name="../bundles/{locale}"/> </compiler.library-path> <!-- Set size of output SWF file. --> <default-size width="500" height="600"/> </mxmlc> <delete> <!-- Deletes cache file --> <fileset dir="${app_root}/${package}" includes="${fileName}*.cache" defaultexcludes="false"/> </delete> </target> <!-- wrapper a swf with html express-installation template--> <target name="wrapper" depends="cleanWrapper"> <html-wrapper title="Actor's lines in web" width="100%" height="100%" application="flexApp" swf="${fileName}" version-major="9" version-minor="0" version-revision="0" history="true" template="express-installation" output="${DEPLOY_DIR}/${package}"/> <move file="${DEPLOY_DIR}/${package}index.html" tofile="${DEPLOY_DIR}/${fileName}.html"/> <copy todir="${DEPLOY_DIR}/assets"> <fileset dir="./assets"/> </copy> </target> <!-- clean preview previous compile file --> <target name="cleanCompile"> <delete dir="${app_root}/${package}generated"/> <delete> <fileset dir="${deploy_dir}/${package}" includes="${fileName}*.swf"/> </delete> </target> <!-- clean preview previous wrapper file --> <target name="cleanWrapper"> <delete> <!-- Deletes history.swf --> <fileset dir="${DEPLOY_DIR}/${package}" includes="history.swf" defaultexcludes="false"/> <!-- Deletes playerProductInstall.swf --> <fileset dir="${DEPLOY_DIR}/${package}" includes="playerProductInstall.swf" defaultexcludes="false"/> <!-- Deletes ${fileName}.html --> <fileset dir="${DEPLOY_DIR}/${package}" includes="${fileName}*.html" defaultexcludes="false"/> <!-- Deletes history.htm --> <fileset dir="${DEPLOY_DIR}/${package}" includes="$history.htm" defaultexcludes="false"/> <!-- Deletes history.js and AC_OETags.js --> <fileset dir="${DEPLOY_DIR}/${package}" includes="*.js" defaultexcludes="false"/> <!-- Deletes all assets --> <fileset dir="${DEPLOY_DIR}/assets" includes="*.*"/> </delete> </target> <target name="run" depends="compile" description="Compile and run it."> <exec executable="${FLASHPLAYER}"> <arg value="${deploy_dir}/${package}${fileName}.swf"/> </exec> </target> <target name="runie" depends="compile" description="Compile and run it."> <exec executable="${IE}"> <arg value="${basedir}\${deploy_dir}\${package}${fileName}.html"/> </exec> </target> </project>
相关文章推荐
- 关于Access发布使用打包软件的一些疑问解答
- 转载:使用 Ant 打包 Android 应用
- 使用Ant脚本打包
- 关于socket 绑定过程中对地址初始化使用的htonl函数的一些理解(转载)
- 关于项目既要使用ant脚本又要使用maven pom.xml文件的问题
- 使用ANT脚本编译、打包、部署到tomcat,启动、停止tomcat
- ant 打包等一些命令的使用
- cocos2d-x 2.1.4 使用create_project.py脚本创建项目+ant打包项目
- 关于Android Studio使用Gradle多渠道打包的一些记录
- 关于apply属性使用的一些例子(转载来自用户:tan_dan)
- 【原】关于使用jieba分词+PyInstaller进行打包时出现的一些问题的解决方法
- 关于Java使用Ant打包,编译AIDL时出错的问题
- 关于linux下内存使用的一些疑惑[转载]
- greensock是个很不错的类库,故转载了一些关于其中类使用方法的文章。
- 使用Ant 和 Maven打包发布命令行程序(转载)
- 使用ant脚本,对java web项目,编译、打包、发布部署到tomcat
- 关于Access发布使用打包软件的一些疑问解答
- 关于使用ant打包百度地图无法使用问题
- 使用Ant构建web项目 从编译到测试 生成测试报告 打包 邮件发送 远程下载tomcat 部署运行一条龙服务之ant脚本
- 使用 Flex Ant Tasks 构建 Flex 项目-第 I 部分:为 Flex 创建构建脚本