4 Replies Latest reply on Feb 23, 2007 9:47 AM by lli123

    Who has a example of Ant for build SWF?

    lli123
      Can anyone give me a example to use Ant build the SWF?

      Thanks,
      lucy
        • 1. Re: Who has a example of Ant for build SWF?
          michael_ramirez44 Level 1
          Do you want an ant build file using Flex 2 Ant or just regular Ant?
          • 2. Who has a example of Ant for build SWF?
            lli123 Level 1
            just regular Ant.

            I have create a build file, but when I run Ant by
            C:\ant162\bin\ant -lib C:\DialogFlow\3rdpartyjar/flexTasks.jar -buildfile antFlexBuild.xml main

            I always get error: "Builder was unexpected at this time.". Who has idea about this error?

            This is my antFlexBuild.xml :
            <?xml version="1.0" encoding="utf-8"?>
            <!-- antFlexBuild.xml -->
            <project name="My App Builder" basedir=".">
            <taskdef resource="flexTasks.tasks" classpath="C:\DialogFlow\3rdpartyjar/flexTasks.jar" />
            <property name="FLEX_HOME" value="C:\Adobe\Flex Builder 2\Flex SDK 2"/>
            <property name="APP_ROOT" value="C:\DialogFlow\"/>
            <property name="DEPLOY_DIR" value="c:/omk"/>
            <target name="main">
            <mxmlc
            file="${APP_ROOT}/DialogFlow.mxml"
            output="${DEPLOY_DIR}/DialogFlow.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="locale/{en_US}" />
            </compiler.library-path>
            <!-- Set size of output SWF file. -->
            <default-size width="500" height="600" />
            </mxmlc>
            </target>
            <target name="clean">
            <delete dir="${APP_ROOT}/generated"/>
            <delete>
            <fileset dir="${DEPLOY_DIR}" includes="DialogFlow.swf"/>
            </delete>
            </target>
            </project>


            Thanks,
            lucy
            • 3. Re: Who has a example of Ant for build SWF?
              michael_ramirez44 Level 1
              Try exlcuding -lib C:\DialogFlow\3rdpartyjar/flexTasks.jar since you already specify the full path with the taskdef.
              • 4. Re: Who has a example of Ant for build SWF?
                lli123 Level 1
                I did, but it still not working.

                Some time it show error: "Builder was unexpected at this time.". and some time no error in the command line, but no swf be builded.