小编Dec*_*ado的帖子

在动作脚本中定义

我正在尝试将构建号从Hudson传递到Flex应用程序.

我在条件编译中找到了Adobe的文档(http://livedocs.adobe.com/flex/3/html/help.html?content=compilers_21.html),它似乎应该解决它但我必须遗漏一些东西.

所以在我的ant构建文件中我有: -

<mxmlc
        file="${app.dir}/${application.name}.mxml"
        output="${dist.dir}/${application.name}.swf"
        context-root="${application.name}"
        debug="true"
        locale="${locales}"
        allow-source-path-overlap="true">
        <load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
        <compiler.library-path dir="${lib.dir}" append="true">
            <include name="*.swc" />
        </compiler.library-path>
        <define name="BUILD::BuildNumber" value="'20100707.800'"/>
        <source-path path-element="${src.dir}"/>
        <source-path path-element="${cfg.dir}"/>
        <source-path path-element="${locale.dir}" />
</mxmlc>
Run Code Online (Sandbox Code Playgroud)

然后我试图检索

public static const buildNumber:String = BUILD::BuildNumber;
Run Code Online (Sandbox Code Playgroud)

但是编译器拒绝接受:

SomeModel.as(31):col:47错误:访问未定义的属性BUILD.
[mxmlc] private static const _buildNumber:String = BUILD :: BuildNumber;

有什么建议?

apache-flex compilation const actionscript-3

6
推荐指数
1
解决办法
1282
查看次数

标签 统计

actionscript-3 ×1

apache-flex ×1

compilation ×1

const ×1