Not yet rated

Problem

You want to compile your swc using ant and flexsdk

Solution

Use flex ant tasks provided by adobe in flex SDK to compile your application. this is a example.

Detailed explanation

 

<?xml version="1.0"?>
<project name="Fisher Ant Task" default="main" basedir=".">
        <property name="FLEX_HOME" value="/work/apps/flexsdks/hero" />
        <taskdef resource="flexTasks.tasks" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar" />
        <property name="APP_SRC" value="${basedir}/src"/>
        <property name="OUTPUT" value="${basedir}/bin/simplemvc.swc"/>
        <target name="main" depends="clean,compile"/>
        <target name="clean">
                <delete dir="${OUTPUT}"/>
        </target>
        <target name="compile">   
        <fileset dir="${APP_SRC}" id="src.files">
            <include name="**/**"/>
        </fileset>
        <pathconvert property="src_classes" pathsep=" " dirsep="." refid="src.files">  
            <map from="\" to="/"/>  
            <map from="${APP_SRC}/" to=""/>  
            <mapper>  
                <chainedmapper>  
                    <globmapper from="*.as" to="*"/>  
                </chainedmapper>  
            </mapper>  
        </pathconvert>
     <compc output="${OUTPUT}" include-classes="${src_classes}" 
                        actionscript-file-encoding="UTF-8" keep-generated-actionscript="true" 
                        static-link-runtime-shared-libraries="true" debug="true">
                  <source-path path-element="${FLEX_HOME}/frameworks" />
                <source-path path-element="${APP_SRC}" />   
                        <compiler.library-path dir="${basedir}" append="true">
                                <include name="libs" />
                        </compiler.library-path>
     </compc>
  </target>
</project>

+
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. Permissions beyond the scope of this license, pertaining to the examples of code included within this work are available at Adobe.

Report abuse

Related recipes