Hi,

I am new to Flex and have been working to create an ant build that
will automate the build process used by the flex builder plugin for
eclipse.  I am having problems generating a workable swf from my
project in ant, when the same source works fine when built with Eclipse.

Here are the details for my project.  We broke the project out into
three modules: air, common and web.  Both air and web utilize the
source from the common module.  The common module is linked through
the flex build path in eclipse.  For ant, I added both the web and
common source path to the mxmlc task.  We are also using the Cairngorm
library which I add to the compile-libraries and external-libraries
when building.  

Below is the ant build file:
<?xml version="1.0"?>

<project default="compile-flex" basedir="." name="RRS Flex Tasks">
        <property environment="env"/>
        <taskdef resource="flexTasks.tasks"
classpath="${env.FLEX_HOME}/ant/lib/flexTasks.jar" />
        <taskdef name="mxmlc" classname="flex.ant.MxmlcTask"
classpath="${env.FLEX_HOME}/ant/lib/flexTasks.jar" />
        
        <!-- Define Properties -->
        <property name="FLEX_HOME" value="${env.FLEX_HOME}"/>
        <property name="WEB_ROOT" value="src/main/flex/web"/>  
        <property name="COMMON_ROOT" value="src/main/flex/common"/>
        
        <target name="compile-flex">
         
                <mxmlc 
            file="${WEB_ROOT}/src/WebClient.mxml" 
            output="${WEB_ROOT}/Web.swf"
            actionscript-file-encoding="UTF-8"
            keep-generated-actionscript="true"
            incremental="true"
                        compiler.show-actionscript-warnings="false"
                        compiler.show-binding-warnings="false"
                        compiler.show-unused-type-selector-warnings="false"
                        compiler.strict="false">
                        
            <!-- Get default compiler options. -->
            <load-config
filename="${FLEX_HOME}/frameworks/flex-config.xml"/>            
            <!-- List of path elements that form the roots of
ActionScript class hierarchies. -->
                        <compiler.source-path 
path-element="${COMMON_ROOT}/src"/>
                        <compiler.source-path path-element="${WEB_ROOT}/src"/>
                        
                        <external-library-path dir="${COMMON_ROOT}/libs"
includes="Cairngorm.swc"/>
                        <compiler.include-libraries 
dir="${FLEX_HOME}/frameworks"
append="true">
                <include name="libs" />
                <include name="../bundles/{locale}" />
                <include name="${COMMON_ROOT}/libs" />
                <include name="${COMMON_ROOT}/libs/Cairngorm.swc" />
            </compiler.include-libraries>
                        <!-- List of SWC files or directories that contain SWC 
files. -->
            <compiler.library-path dir="${FLEX_HOME}/frameworks"
append="true">
                <include name="libs" />
                <include name="../bundles/{locale}" />
                <include name="${COMMON_ROOT}/libs" />
                <include name="${COMMON_ROOT}/libs/Cairngorm.swc" />
            </compiler.library-path>
        </mxmlc>

     </target>  

</project>

I have searched the web and also looked through adobe labs ant tasks,
as well as the help list for the mxmlc compiler, but I have had no
luck.  Any ideas or thoughts would be greatly appreciated.

Thank you in advance!
TJ Greenier

Reply via email to