Using ANT to compile Flex files

Hi All,

The below example will show how to use ANT to compile Flex files to generate .SWF files.

Step 1: Install FLEX SDK3.1   e.g   c:/flex3.1

Step 2: Create a build.xml    e.g. build.xml

Step 3: Add the below ant task defination  in the Build.xml
<taskdef resource=”flexTasks.tasks” classpath=”c:/flex3.1/ant/lib/flexTasks.jar”/>

Step 4: Crate an Ant Task
<target name=”compileFlex”>
<mxmlc file=”/flex/src/Index.mxml”
incremental=”true”
debug=”false”
optimize=”true”
warnings=”false”
services=”flex/services-config.xml”
output=”build/project/view/index.swf”
classpath=”c:/flex3.1/ant/lib/flexTasks.jar”>
<load-config filename=”c:/flex3.1/frameworks/flex-config.xml”/>
<compiler.library-path dir=”lib/swc” append=”true”>
<include name=”*.swc” />
</compiler.library-path>

</mxmlc>

</target>

Thanks

R Vashi.

Advertisements

2 thoughts on “Using ANT to compile Flex files

    • Hi Rakesh,

      Flex SDK is required. But if you have Flex 3.0 installed then you can use the SDK from there which comes with Flex builder.

      You can find it in the below Home location of Flex Builder
      C:\Program Files\Adobe\Flex Builder 3\sdks\3.0.0

      Thanks
      R Vashi.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.