0 Replies Latest reply on Jan 11, 2013 12:57 AM by gadzhimari

    Trouble with FLEX_HOME environment in OS X

    gadzhimari

      Hi. I try to run ant script. In command line it's work fine, but in FlashBuilder it doesn't work.

       

      I put this line in .zshrc file

      export FLEX_HOME=/Applications/Adobe\ Flash\ Builder\ 4.7/sdks/4.6.0/
      

       

      build.xml file:

      <?xml version="1.0"?>
      <project name="helloworld" basedir="../" default="compile">
        <!-- Set up prefix for all environment variables -->
        <property environment="env" />
                <fail unless="env.FLEX_HOME" message="FLEX_HOME needs to be defined as an environment variable or in the Ant build." />
        <!-- Load user properties to overrride defaults -->
        <property file="${basedir}/build/build.properties" />
        <!-- System environment must contain FLEX_HOME variable that points to Flex SDK -->
        <property name="FLEX_HOME" location="${env.FLEX_HOME}" />
        <!-- Set up Flex tasks in Ant -->
        <taskdef resource="flexTasks.tasks" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar" />
      
        <!-- Create directories needed for the build process -->
        <target name="init" description="Initializes project and destination folders.">
        <echo message="Project: ${ant.project.name}" />
        <echo message="Flex SDK: ${FLEX_HOME}" />
        <echo message="Flex home is ${env.FLEX_HOME}" />
        <mkdir dir="${bin.dir}" />
        </target>
      
        <target name="compile" depends="init" description="Compiles the application.">
        <mxmlc file="${src.dir}/${application.name}.as" output="${bin.dir}/${application.name}.swf">
        <load-config filename="${FLEX_HOME}/frameworks/flex-config.xml" />
      
        <source-path path-element="${src.dir}" />
      
        </mxmlc>  
        <echo message="The ${application.name}.swf has been created in ${bin.dir}" />
        </target>
      
      </project>