Flash Builder で Ant ビルド スクリプトを実行しようとすると、エラーが発生します。だから私export FLEX_HOME=/Applications/Adobe\ Flash\ Builder\ 4.7/sdks/4.6.0/
は私の.zshrc
. これはコマンド ラインでは正常に機能しますが、FB では機能しません。
build.xml
<?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}" />
<delete dir="${bin.dir}" />
<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>
そしてエラー
Buildfile: /Users/gadzimari/Documents/Adobe Flash Builder 4.7/helloworld/build/build.xml
BUILD FAILED
/Users/gadzimari/Documents/Adobe Flash Builder 4.7/helloworld/build/build.xml:5: FLEX_HOME needs to be defined as an environment variable or in the Ant build.
Total time: 302 milliseconds