3 Replies Latest reply on Feb 2, 2010 9:49 PM by jake_flex

    Problems in Flex Ant

    skolman83

      Here is the Build file I am using:

       

      <?xml version="1.0" encoding="UTF-8" standalone="no"?>

      <project basedir="." default="build" name="Project_name">

      <property environment="env"/>

      <property name="FLEX_HOME" value="C:/Program Files/Flex 3.4"/>

      <property name="APP_ROOT" value="./src"/>

      <property name="Project_name.location" value="../Project_name"/>

      <taskdef resource="flexTasks.tasks" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar"/>

      <target name="build">

      <mxmlc file="${APP_ROOT}/AdminConsole.mxml">

      <source-path path-element="${FLEX_HOME}/frameworks"/>

      <library-path>

      <path-element>${Project_name.location}/src</path-element>

      </library-path>

      </mxmlc>

      </target>

      </project>

       

       

      I have a flex library I want to use located in another flex project in eclipse. So I am using the library-path element but when I run the build.xml file, this is the error i get:

       

      BUILD FAILED

      *************\build.xml:9: library-path doesn't support the nested "path-element" element.

       

      I tried it as an attribute for library-path but I still get a similar error:

       

      *************\build.xml:9: library-path doesn't support the "path-element" attribute

      What am I doing wrong?

        • 1. Re: Problems in Flex Ant
          jake_flex

          You should use compiler.library-path to include libraries.

           

          Try the following

           

          <?xml version="1.0" encoding="UTF-8" standalone="no"?>
          <project basedir="." default="build" name="Project_name">
           <property environment="env"/>
           <property name="FLEX_HOME" value="C:/Program Files/Flex 3.4"/>
           <property name="APP_ROOT" value="./src"/>
           <property name="Project_name.location" value="../Project_name"/>
           <taskdef resource="flexTasks.tasks" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar"/>
          <target name="build">
           <mxmlc file="${APP_ROOT}/AdminConsole.mxml">
           <source-path path-element="${FLEX_HOME}/frameworks"/>
           <compiler.library-path>
           <include name="${Project_name.location}/src" />
           </compiler.library-path>
           </mxmlc>
          </target>
          </project>
          

           

          Although, I don't know what are you planning to include, and whether you should use compiler.library-path for that.

          • 2. Re: Problems in Flex Ant
            skolman83 Level 1

            Thanks, that worked!

             

            how about for external-library-path? I tried

             

            <compiler.external-library-path

            path-element="${project_name.location}/bin/project_name.swc"/>

             

            But it gave this error:

            compiler.external-library-path doesn't support the "path-element" attribute

             

            and this is all documented anywhere?

            • 3. Re: Problems in Flex Ant
              jake_flex Level 2

              I haven't used external library-path ever. Can't you use the same compiler.library-path tag? Just add another nested include tag.

               

              The documentation is really poor on the Flex Ant Tasks. The only one I know is

               

              http://livedocs.adobe.com/flex/3/html/help.html?content=anttasks_1.html

               

              which is not very descriptive and does not cover all the options available.