グループのフレックスアプリを構築するためのantビルドスクリプトを作成しようとしていますが、SOの誰かが以前に見たことがあることを望んでいるいくつかの障害に遭遇しました。
SWC にビルドする 2 つのプロジェクトがあり、これらのコンポーネントにはリソース バンドルが含まれています。1 つの SWC には、もう 1 つの SWC が必要です。両方の SWC を使用するアプリケーション (SWF) に組み込む 1 つのプロジェクトがあります。
SWC をビルドしても、リソース バンドルが見つからないという苦情はありません。また、winzip で SWC を開くと、バンドルが表示されます (たとえば、/locale/EN_US にあります)。
ただし、SWF をビルドすると、2 つの swc でリソース バンドルが見つからないという苦情が寄せられますが、他のリソース バンドル (フレックス フレームワークのものなど) が見つからないという苦情はありません。これは私がantから受け取る種類のメッセージです:
[mxmlc] Error: Unable to resolve resource bundle "whatever" for locale "en_US".
[mxmlc]
確かに、私はこの落とし穴にぶつかった最初の人ではないので、ここで何が問題なのか誰か知っていますか? SWC または SWF を間違ってビルドしていますか?
参考までに、compc を使用したビルド タスクの 1 つを次に示します (何らかの理由で、開始ターゲット タグが表示されません)。
<path id="facet.sourcePath">
<pathelement location="${flex.facet.src}"/>
</path>
<property name="facet.sourcePath" refid="facet.sourcePath"/>
<echo message="sourcePath is ${facet.sourcePath}"/>
<fileset dir="${facet.sourcePath}" id="facet.sources">
<include name="**/*.as"/>
</fileset>
<pathconvert property="facet.classes" pathsep=" " refid="facet.sources">
<compositemapper>
<chainedmapper>
<globmapper from="*.as" to="*"/>
<globmapper from="${facet.sourcePath}\*" to="*" handledirsep="true" />
</chainedmapper>
<chainedmapper>
<globmapper from="*.mxml" to="*"/>
<globmapper from="${facet.sourcePath}\*" to="*" handledirsep="true" />
</chainedmapper>
</compositemapper>
</pathconvert>
<echo message="classes: ${facet.classes}"/>
<compc output="${flex.lib.output}/${facet.swc.name}" locale="EN_US"
include-classes="${facet.classes}" directory="false"
target-player="10.0.0"
>
<load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
<include-resource-bundles bundle="foo"/>
<include-resource-bundles bundle="bar"/>
<include-resource-bundles bundle="whatever"/>
<sp path-element="${flex.facet.dir}/locale/{locale}"/>
<keep-as3-metadata name="Bindable"/>
<keep-as3-metadata name="Remotable"/>
<keep-as3-metadata name="Embed"/>
<keep-as3-metadata name="Event"/>
<keep-as3-metadata name="ResourceBundle"/>
<source-path path-element="${flex.facet.src}"/>
<compiler.library-path append="true" dir="${flex.framework.lib}">
<include name="*.swc"/>
<include name="../locale/${locale}"/>
</compiler.library-path>
<compiler.library-path append="true" dir="${flex.rsm.lib}">
<include name="*.swc"/>
</compiler.library-path>
</compc>
</target>
ここに私のmxmlcタスクがあります:
<target name="flex.webapp.compile" description="compiles your flex app">
<mxmlc file="${flex.webapp.src}\RSM.mxml"
output="${flex.webapp.deploy}\ant_test\RSM.swf"
use-network="true"
keep-generated-actionscript="true"
debug="true"
locale="en_US"
incremental="true"
actionscript-file-encoding="utf-8"
target-player="10.0.0"
>
<load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
<include-resource-bundles bundle="RSM"/>
<source-path path-element="${FLEX_HOME}/frameworks"/>
<source-path path-element="${flex.webapp.src}" />
<source-path path-element="${flex.webapp.dir}/locale/en_US" />
<source-path path-element="${flex.rsm.lib}" />
<sp path-element="${flex.core.dir}/locale/{locale}"/>
<sp path-element="${flex.facet.dir}/locale/{locale}" />
<compiler.library-path append="true" dir="${flex.framework.lib}">
<include name="*.swc"/>
<!--include name="../locale/${locale}"/-->
</compiler.library-path>
<compiler.library-path append="true" dir="${flex.rsm.lib}">
<include name="*.swc"/>
<include name="../locale/${locale}" />
<!--include name="rsm_rb.swc" /-->
</compiler.library-path>
</mxmlc>
</target>