Hi, I finally managed to spend some time to convert some flex projects 
to ant flex tasks. My issue is that adobe yet again has been arrogant 
and badly supporting me trying to transfer my Flex license from PC to 
Mac because its not even a dual license and the Mac version wasn't 
available at the time ;)  I'm away from my pc at the moment so I was 
forced into a corner. I may add these onto the wiki shortly :)

ANT_HOME in eclipse is set to a non bundled ant which is 1.7.
FLEX_HOME is the newest sdk version not bundled with flex builder.

Here is some example build scripts, I guess each main mxml application 
needs its own build file.

<?xml version="1.0" encoding="utf-8"?>
<project name="VideoPlayer" basedir=".">
    <taskdef resource="flexTasks.tasks" 
classpath="${ANT_HOME}/lib/flexTasks.jar" />       
    <property name="FLEX_HOME" value="/usr/local/flex_sdk_2"/>
    <property name="SRC_DIR" value="${basedir}/src"/>
    <property name="DEPLOY_DIR" value="${basedir}/bin"/>
    <target name="main">
        <mxmlc
            file="${SRC_DIR}/VideoPlayer.mxml"
            output="${DEPLOY_DIR}/VideoPlayer.swf"
            actionscript-file-encoding="UTF-8"
            keep-generated-actionscript="true"
            incremental="true"
        >
            <!-- 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. -->
            <source-path path-element="${FLEX_HOME}/frameworks"/>
            <!-- 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="${basedir}/lib" />
            </compiler.library-path>
           
            <compiler.library-path dir="${basedir}" append="true">
                            <include name="lib" />
             </compiler.library-path>
            <!-- Set size of output SWF file. -->
            <default-size width="500" height="600" />
        </mxmlc>
    </target>
    <target name="clean">
        <delete dir="${SRC_DIR}/generated"/>
        <delete>
            <fileset dir="${DEPLOY_DIR}" includes="VideoPlayer.swf"/>
        </delete>   
    </target>       
</project>


A build for the as3corelib project, clobbers the files into a classes 
syntax to add into the flex library

<?xml version="1.0" encoding="utf-8"?>
<project name="as3corelib" basedir=".">
   <taskdef resource="flexTasks.tasks" 
classpath="${ANT_HOME}/lib/flexTasks.jar" />
   <property name="FLEX_HOME" value="/usr/local/flex_sdk_2"/>       
   <property name="DEPLOY_DIR" value="${basedir}/bin"/>
   <property name="COMPONENT_ROOT" value="components"/>
   <target name="main">
  
      <fileset dir="${basedir}/src" id="src.files">
         <include name="**/**"/>
       </fileset>
       <pathconvert
                    property="corelib_classes"
                    pathsep=" "
                    dirsep="."
                    refid="src.files">
                    <map from="${basedir}/src/" to=""/>
          
          
                    <mapper>
                       <chainedmapper>
                          <globmapper from="*.as" to="*"/>
                       </chainedmapper>
                    </mapper>
                   
              </pathconvert>
      
       <compc
           include-classes="${corelib_classes}"
           output="${DEPLOY_DIR}/as3corelib.swc">
           <source-path path-element="${basedir}/src"/>           
         
       </compc>       
   </target>
   <target name="clean">
       <delete>
           <fileset dir="${DEPLOY_DIR}" includes="as3corelib.swc"/>
       </delete>   
   </target>       
</project>



_______________________________________________
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org

Reply via email to