我见过很多例子,比如e.g. here,人们通过引用元素中的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>此操作失败,并出现一系列表单错误:
[compc] Error: could not find source for resource bundle ...我可以通过这一次更改来构建它:
<include name="locale/en_US"/>由Flex Builder 3生成的配置文件实际上将其呈现为"locale/{locale}“(注意缺少$)。我也试过了,结果也一样(失败了)。
现在,我可以直接注入en_US,因为我们在相当长的一段时间内不会做本地化包,但我最终需要让它工作。而且,我不能让它以它应该工作的方式工作,这让我很恼火!
发布于 2010-04-28 20:46:52
我认为这里的问题是${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>https://stackoverflow.com/questions/2724306
复制相似问题