This is a very simple build.xml for Ant, which compiles your MXML application and copies the SWF to a specific folder. Put it into your projects' root folder and replace bin-release
with your desired export folder. Also adjust the path to your Flex SDK as well as to flexTasks.jar
and Application.mxml
.
<?xml version="1.0" encoding="utf-8"?>
<project name="Builder" basedir="." default="build">
<target name="init">
<property name="FLEX_HOME" value="C:/Program Files/Adobe/Adobe Flash Builder 4.6/sdks/4.6.0" />
<taskdef resource="flexTasks.tasks" classpath="${basedir}/libs/flexTasks.jar" />
</target>
<target name="compile">
<mxmlc file="${basedir}/src/Application.mxml"
output="app.swf"
keep-generated-actionscript="false"
optimize="true">
<source-path path-element="${basedir}/src" />
</mxmlc>
</target>
<target name="export">
<copy file="app.swf" todir="bin-release" />
</target>
<target name="build" depends="init, compile, export" />
You can run this build.xml automatically if you add an Ant builder under Project properties
- Builders
.