我正在将现有的构建脚本从<mxmlc />转换为<compc />以生成swc。
然而,构建失败了,并给出了错误:
[compc] C:\xxxx\LogViewer.mxml(32): Error: Access of undefined property VERSION.
[compc]
[compc] private static const VERSION:String = CONFIG::VERSION;在我的ant任务中,我定义了以下内容:
<compc compiler.as3="true" output="${output.dir}/${swc.name}.swc" incremental="true" fork="true" maxmemory="512m" compiler.show-deprecation-warnings="false">
<load-config filename="${FLEX_HOME}/frameworks/flex-config.xml" />
<source-path path-element="${srcdir}" />
<include-sources dir="${srcdir}" includes="*" />
<external-library-path dir="${swc.libs.dir}" append="true">
<include name="*.swc" />
</external-library-path>
<external-library-path dir="${output.common.swc.dir}" append="true">
<include name="*.swc" />
</external-library-path>
<compiler.define name="CONFIG::VERSION" value="${build.version}" />
<compiler.define name="CONFIG::RELEASE" value="${config.release}" />
<compiler.define name="CONFIG::DEBUG" value="${config.debug}" />
<compiler.define name="CONFIG::AUTOMATION" value="false" />
</compc>这种方法在任务中工作得很好,但现在失败了。
在compc中使用编译器常量的正确方法是什么?
发布于 2011-04-19 09:38:17
字符串值需要放在单引号中。例如:
<compiler.define name="CONFIG::VERSION" value="'${build.version}'" />Flex Ant任务真的非常令人沮丧,这主要是因为缺乏文档。我为此挣扎了一段时间,直到我弄明白。
发布于 2011-01-11 15:05:13
我们在构建中做了类似的事情,我能看到的唯一区别是我们没有编译器的位:
<define name="CONFIG::build" value="5" />https://stackoverflow.com/questions/4342109
复制相似问题