2009-12-14 128 views
0

剛剛將我的Flex應用程序移動到Ant上,並帶有一個基本的ant腳本,我得到這個愚蠢的錯誤:mxmlc不支持「file」屬性。我查看了docos,看起來我的代碼是正確的,所以看起來很順利。Flex-Ant:mxmlc不支持「文件」屬性

<!-- load previously defined configuration properties file --> 
<property file="build.properties" /> 

<!-- points to our flexTasks.jar we copied to the libs folder to distribute with the project --> 
<taskdef resource="flexTasks.tasks" classpath="${basedir}/libs/flexTasks.jar"/> 

<!-- delete and recreate the DEPLOY dir --> 
<target name="init"> 
    <delete dir="${DEPLOY_DIR}" /> 
    <mkdir dir="${DEPLOY_DIR}" />  
</target> 

<!-- Build and output the Main.swf--> 
<target name="compile flex project" depends="init"> 
    <mxmlc file="${SRC_DIR}/DNASupport.mxml" 
     actionscript-file-encoding="UTF-8" 
     keep-generated-actionscript="false" 
     incremental="true" 
     optimize="true" 
     output="${DEPLOY_DIR}/Main.swf"> 
     <license product="flexbuilder3" serial-number="137740016118223699076222" /> 
     <load-config filename="${FLEX_HOME}/frameworks/flex-config.xml" /> 
     <source-path path-element="${app_root_dir}/src" /> 
     <source-path path-element="${FLEX_HOME}/frameworks" /> 
     <load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/> 
     <source-path path-element="${FLEX_HOME}/frameworks"/> 
     <compiler.debug>false</compiler.debug>   
    </mxmlc> 
</target> 

+0

您可以發佈您的build文件?我相信mxmlc應該使用文件屬性來知道要編譯的文件。 – 2009-12-14 00:14:54

+0

啊對不起,隊友以爲我在那裏,但它沒有出現。確定這裏是 – Doz 2009-12-14 20:41:19

+0

你的$ {SRC_DIR}是否解析爲一個空格的路徑? (即「/文件和設置/」,因爲它會打破mxmlc – 2009-12-15 10:12:50

回答

1

您使用的柔性Ant任務?

這是我的 「典型」 的一部分建立文件

<taskdef resource="flexTasks.tasks" /> 
... 
<target name="compile"> 
    <mxmlc file="Main.mxml" debug="true" output="main.swf"> 
    <load-config filename="${FLEX_HOME}/frameworks/flex-config.xml" /> 
    <source-path path-element="${FLEX_HOME}/frameworks" /> 
    <source-path path-element="${src}" /> 
    </mxmlc> 
</target> 

希望這有助於