AIR移动应用自动化编译的问题
AIR移动应用自动化编译的问题
大家都知道Flex SDK针对 Ant编译提供了扩展包flexTasks.jar。我参与的项目也都是用Ant进行编译打包的,本次我们依然选择用Ant进行编译打包。不过不同的是之前都是web应用,而这次是移动应用。所以在编译打包的过程中会存在一些差异。
1、 主模块编译得到swf文件
<!-- 编译成swf文件 -->
<target name="compile" description="Create the mian.swf" depends="init"> <echo>编译mian.swf文件</echo> <mxmlc file="${MAIN_DIR}/src/Main.as" output="${MAIN_DIR}/bin/Main.swf" debug="${DEBUG}" configname="airmobile" swf-version="${SWF_VERSION}"> <source-path path-element="${MAIN_DIR}/src"/> <library-path dir="${LIBS_DIR}/module" includes="*.swc" append="true"/> <library-path dir="${LIBS_DIR}/frame" includes="*.swc" append="true"/> </mxmlc></target>
<target name="packageIpa" description="Create the ipa package" depends="compile"> <exec executable="${FLEX_HOME}/bin/adt.bat" failonerror="true"> <arg line="-package"/> <!--打安装包指令--> <arg line="-target ${IPA_TARGET}"/> <!--安装包类型debug或release --> <arg line="-storetype ${STORETYPE}"/> <!—证书类型--> <arg line="-keystore ${KEYSTORE}"/> <!—证书文件--> <arg line="-storepass ${STOREPASS}"/> <!—证书密码--> <arg line="-provisioning-profile ${PROVISIONING_PROFILE}"/><!—证书配置文件--> <arg line="${IPA_NAME}"/> <!—ipa包的名字--> <arg line="${CONFIG_XML}"/> <!—移动应用的配置文件main-app.xml--> [color=red]<arg line="-C ${MAIN_DIR}/bin"/> [/color] <!—设置adt的工作路径--> <arg line="Main.swf"/> <!—swf文件--> <arg line="assets/"/> <!—资源文件夹--> <arg line="app.xml"/> <!—其他项目配置资源--> <arg line="appResourceConfig.xml"/> <!—其他项目配置资源--> </exec></target>