Chandan,

Ant-contrib tasks will help you. MXMLC takes only one mxml to comile it. So
Ant-Contrib task (foreach) will allow you to loop through all the mxmls and
pass one by one to mxmlc.

If you wanna to compile the mxmls which contains the remote calls (blazeds
or LCDS calls) then you will have to include the required parametes to the
mxmlc compiler to compile the services.config file. and it will really help
you reduce the size of swf file.

<target name="flex-compile" description="Build each MXML file">
                <foreach target="build-each-mxml" param="file">
                <path>
                                <fileset dir="${flex.src.dir}">
                                        <include name="**/*.mxml"/>
                                                   </fileset>
                        </path>
        </foreach>
    </target>

<target name="build-each-mxml" description="Builds a mxml file">
                <echo>Each File Name: ${file}</echo>
                        <exec executable="${mxmlc.exe}">
                                         <arg value="${file}" />
                                       </exec>
        </target>

Cheers!!!!!!!

Thanks,
Sammi


chan-8 wrote:
> 
> 
> Hi All,
> 
> I am using ant script to compile mxml files. I could write the script
> to compile single mxml file. However, I need to compile all the mxml
> file under one directory. I do not find any way to do it. If any body
> has any idea or worked on it, please let us know.
> 
> Following is the ant script which we are using to compile single mxml
> file.
> 
> <?xml version="1.0" encoding="utf-8"?>
> <project name="My App Builder" basedir=".">
>     <taskdef resource="flexTasks.tasks" classpath="${basedir}/libs/
> flexTasks.jar"/>
>     <property name="FLEX_HOME" value="D:\Program Files\Adobe\Flex
> Builder 3\sdks\3.1.0"/>
>     <property name="APP_ROOT" value="src"/>
>     <property name="DEPLOY_DIR" value="D:\output"/>
>     <target name="main">
>             <mxmlc dir="${APP_ROOT}/mychart/bar.mxml" >
>             <load-config filename="${FLEX_HOME}/frameworks/flex-
> config.xml"/>
>             <source-path  path-element="${FLEX_HOME}/frameworks"/>
>             </mxmlc>
>      </target>
> </project>
> 
> Note: I have copied flextasks.jar in the lib directory of the ant.
> 
> 
> I need to compile all the mxml files which are present under mychart
> directory.
> Awaiting for your kind response. This is really an urgent requirement
> so early response will be really appricated.
> 
>       Let me know if you need more information on this.
> 
> Thanks & Regards,
> Chandan
> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google Groups
> "Flex India Community" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/flex_india?hl=en
> -~----------~----~----~----~------~----~------~--~---
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/-flex_india%3A17039--How-to-compile-multiple-mxml-files-using-ant-script.-tp20830271p28047739.html
Sent from the Flex India mailing list archive at Nabble.com.

-- 
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en.

Reply via email to