破晓 发表于 2015-9-9 10:24:14

Ant编译打包AIR程序

至于怎么用Ant编译AS项目我就不在这里具体说了。直接看XML配置文件好了一个编译target和一个打包的target。需要注意的是签名文件,必须和build.xml文件同个目录


<!-- 编译成swf文件 -->
      <target name="compile" depends="init">
                <echo>编译成swf文件</echo>
                <mxmlcfile="${SRC_DIR}/AutoUpdateAIR.mxml"
                            output="${DEPLOY_DIR}/AutoUpdateAIR.swf"
                            debug="${DEBUG}"
                              optimize="${OPTIMIZE}"
                            locale="${LOCALE}"
                              configname="air">
                <load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
                <source-path path-element="${SRC_DIR}"/>
            <library-path dir="${FLEX_HOME}/frameworks/libs" includes="*.swc" append="true"/>
            <library-path dir="${FLEX_HOME}/frameworks/libs/air" includes="*.swc" append="true"/>
            <library-path dir="${FLEX_HOME}/frameworks/locale" includes="${LOCALE}" append="true"/>
                </mxmlc>
      </target>
      
      <!-- 打包成一个AIR文件包 -->
      <target name="packageAIR" description="Create the AIR package" depends="compile">
                <echo>打包成AIR安装包</echo>
                <!-- 注意,linux下面是adt,windows下面是adt.bat-->
                <exec executable="${FLEX_HOME}/bin/adt.bat" failonerror="true">
                        <arg line="-package" />
                        <arg line="-tsa none" />
                        <arg line="-storetype pkcs12" />
                        <arg line="-keystore AutoUpdateAIR.p12" />
                        <arg line="-storepass 123456" />
                        <arg line="${DEPLOY_DIR}/AutoUpdateAIR.air" />
                        <arg line="${SRC_DIR}/AutoUpdateAIR-app.xml" />
                        <arg line="-C ${DEPLOY_DIR} AutoUpdateAIR.swf" />
                </exec>
      </target>具体的可以看我提供的源文件(需要回复):




**** Hidden Message *****



build.properties
配置文件信息,ant文件调用的
FLEX_HOME= D:/greenSoft/Adobe/Adobe Flash Builder 4.6/sdks/4.6.0

# Project locations for source files, libraries and output
SRC_DIR=${basedir}/src
LIBS_DIR =${basedir}/libs
DEPLOY_DIR =${basedir}/deploy

# Compilation settings
DEBUG=false
OPTIMIZE=true
LOCALE=en_US






本文来自:http://bbs.9ria.com/thread-152061-1-1.html

页: [1]
查看完整版本: Ant编译打包AIR程序