Apache flex 为什么';t${locale}在我的<;compc>;蚂蚁任务?

Apache flex 为什么';t${locale}在我的<;compc>;蚂蚁任务?,apache-flex,ant,locale,compc,Apache Flex,Ant,Locale,Compc,我已经看到了许多示例,其中人们通过引用元素中的locale属性来包括locale资源包。出于某种原因,这对我不起作用。以下是我为这项任务准备的: <compc output="${deploy.dir}/myfrmwrk.swc" locale="en_US"> <source-path path-element="${basedir}/src/main/flex"/> <include-sources dir="${basedir}/src/mai

我已经看到了许多示例,其中人们通过引用元素中的locale属性来包括locale资源包。出于某种原因,这对我不起作用。以下是我为这项任务准备的:

<compc output="${deploy.dir}/myfrmwrk.swc" locale="en_US">
    <source-path path-element="${basedir}/src/main/flex"/>
    <include-sources dir="${basedir}/src/main/flex" includes="*" />
    <include-libraries file="${basedir}/libs"/>
    <compiler.external-library-path dir="${FLEX_HOME}/frameworks/libs/player/9" append="true">
        <include name="playerglobal.swc"/>
    </compiler.external-library-path>
    <compiler.library-path dir="${FLEX_HOME}/frameworks" append="true">
        <include name="libs"/>
        <include name="locale/${locale}"/>
    </compiler.library-path>
    <load-config filename="${basedir}/fb3config.xml" />
</compc>
我可以通过以下一个更改进行构建:

<include name="locale/en_US"/>

Flex Builder 3生成的配置文件实际上将其呈现为“locale/{locale}”(请注意,$丢失)。我也尝试过,但结果都一样(失败)


现在,我可以直接注入en_US,因为我们在相当长的一段时间内不会做本地化包,但我最终需要让它工作起来。而且,我不能让它按应该的方式工作,这让我很烦

我认为这里的问题是,
${locale}
被ant解释为属性,而不是传递给
compc
任务的字符串文本。我的意思是,ant看到
${locale}
并认为需要替换构建文件中定义的属性
locale
的值。当然,这根本不是你想要的,事情也因此变得很糟糕

我在构建文件中所做的工作就是删除
$
前缀,一切似乎都按预期工作。因此,您的示例如下所示:

<compc output="${deploy.dir}/myfrmwrk.swc" locale="en_US">
    <source-path path-element="${basedir}/src/main/flex"/>
    <include-sources dir="${basedir}/src/main/flex" includes="*" />
    <include-libraries file="${basedir}/libs"/>
    <compiler.external-library-path dir="${FLEX_HOME}/frameworks/libs/player/9" append="true">
        <include name="playerglobal.swc"/>
    </compiler.external-library-path>
    <compiler.library-path dir="${FLEX_HOME}/frameworks" append="true">
        <include name="libs"/>
        <!-- Ditch the dollar sign and things should work! -->
        <include name="locale/{locale}"/>
    </compiler.library-path>
    <load-config filename="${basedir}/fb3config.xml" />
</compc>

<compc output="${deploy.dir}/myfrmwrk.swc" locale="en_US">
    <source-path path-element="${basedir}/src/main/flex"/>
    <include-sources dir="${basedir}/src/main/flex" includes="*" />
    <include-libraries file="${basedir}/libs"/>
    <compiler.external-library-path dir="${FLEX_HOME}/frameworks/libs/player/9" append="true">
        <include name="playerglobal.swc"/>
    </compiler.external-library-path>
    <compiler.library-path dir="${FLEX_HOME}/frameworks" append="true">
        <include name="libs"/>
        <!-- Ditch the dollar sign and things should work! -->
        <include name="locale/{locale}"/>
    </compiler.library-path>
    <load-config filename="${basedir}/fb3config.xml" />
</compc>