将编译器常量与结合使用;蚂蚁任务
我正在将现有构建脚本从
转换为
以生成 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 中使用编译器常量的正确方法是什么?
I'm converting an existing build script from <mxmlc />
to <compc />
to generate a swc.
However, the build is failing, giving the error:
[compc] C:\xxxx\LogViewer.mxml(32): Error: Access of undefined property VERSION.
[compc]
[compc] private static const VERSION:String = CONFIG::VERSION;
In my ant task, I have the following defined:
<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>
This approach worked fine with the task, but is now failing.
What's the correct way to use compiler constants with compc?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
字符串值需要放在单引号中。例如:
Flex Ant 任务确实非常令人沮丧,主要是由于缺乏文档。我为此苦苦挣扎了一段时间,直到我弄清楚了。
String values need to be put in single quotes. For instance:
The Flex Ant tasks really are incredibly frustrating, mainly due to the lack of documentation. I struggled with this for a while until I figured it out.
我们在构建中做了类似的事情,我看到的唯一区别是我们没有编译器位:
We do something similar in our build, and the only difference I can see is that we don't have the compiler bit: