我有一个使用编译时间常量的 AS3 项目。这在 FDT 中运行良好,并添加了如下编译器参数:
-define=CONFIG::buildver,"0.1"
但是在使用 ant 脚本构建时尝试复制它时:
<project name="ProjectName" default="compileMain" basedir=".">
<property file="build.properties" />
<target name="compileMain">
<exec executable="${mxmlc}">
<arg line='-define=CONFIG::testvar,"0.1"' />
<arg line="-source-path '${classesdir}'" />
<arg line="-library-path '${flex3libsdir}'" />
<arg line="-output '${bindir}/TestSwf.swf'" />
<arg line="-file-specs '${classesdir}/Test_Main.as'" />
</exec>
</target>
我得到“错误:配置值的初始化程序必须是编译时间常数。”
我尝试使用 -define+=CONFIG,但得到相同的响应。
有编译时间常数和蚂蚁经验的人有什么建议吗?