使用 Flex Ant Tasks 构建 Flex 项目

1. 安装ant,然后复制FLEX_HOME/sdks/4.0.0/ant/lib下面的flexTasks.jar到ANT_HOME/lib

 

2. build.properties

 

# change this to your Flex SDK directory path
FLEX_HOME=D:/Adobe/Adobe Flash Builder 4 Plug-in/sdks/4.0.0
# this points to your project's src directory
# {$basedir} is a default variable that can be used in any Ant
script
# and it points to the project's root folder [ flex_ant_pt1_Tasks ]
in this case
SRC_DIR =${basedir}/src
# points to the project's libs directory
LIBS_DIR =${basedir}/libs
# this is the folder we want to publish the swf to
DEPLOY_DIR = ${basedir}/DEPLOY

 

3. build.xml

 

<project name="Flex Ant Tasks Build Script" default="compile flex project">
 
   <!-- load previously defined configuration properties file -->
   <property file="build.properties" />
                              
   <!-- points to our flexTasks.jar we copied to the libs folder to distribute with the project -->
   <taskdef resource="flexTasks.tasks" classpath="${basedir}/libs/flexTasks.jar"/> 
                              
   <!-- delete and create the DEPLOY dir again -->
   <target name="init">
      <delete dir="${DEPLOY_DIR}" />
      <mkdir dir="${DEPLOY_DIR}" />       
   </target>
                              
   <!-- Build and output the Main.swf-->
   <target name="compile flex project" depends="init">
      <mxmlc file="${SRC_DIR}/Main.mxml" output="${DEPLOY_DIR}/Main.swf">
         <load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
         <source-path path-element="${FLEX_HOME}/frameworks"/>
         <compiler.debug>false</compiler.debug>             
      </mxmlc>
   </target>
 
</project>

 

4. 在Flex Builder中创建一个Flex项目,新建一个Main.mxml

 

5.cmd进入到刚才创建的Flex项目目录,执行ant命令。注意:build.properties,build.xml放在刚才创建的Flex项目根目录下

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值