Using ant, does anyone know how to create a SWF consisting of the SWC (which you created) that includes the resource packages?

I am trying to write an ant build script to create my group flex application, and I came across some obstacles that I hope that one of them has already seen.

We have two projects that we create in SWC, and these components contain resource packages. One SWC requires another SWC. We have one project that we embed in our application (SWF), which uses both SWCs.

When I create SWC, I have no complaints about resource packages not found, and when I open SWC in winzip, I can see the packages (for example, in / locale / EN _US)

However, when I create SWF, I receive complaints that I could not find resource packages in two swc, but no complaints that you can not find any other resource packages (for example, flex framework). This is the message I get from ant:

[mxmlc] Error: Unable to resolve resource bundle "whatever" for locale "en_US".
[mxmlc]

Of course, I'm not the first person to get into this game, and does anyone know what the problem is? Am I building SWC incorrectly or SWF?

For reference, here is one of my build tasks using compc (for some reason I cannot get the opening target tag to display)

    <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>

and here is my mxmlc task:

<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>
+3
source share
2 answers

Arrgh!

, .
compc "locale =" EN_US ", mxmlc " locale = "en_US".
- - " , - ?", .

+5

btw ( Linux-!), , , libs...

daemonna@NES-KOS-29:~/Desktop/FlexUnit4Turnkey_4.0_sdk_4.0.fxp_FILES/src$ mxmlc -library-path=../libs -locale=en_US App.mxml 
Loading configuration file /home/daemonna/Frameworks/flex_sdk_4.1.0.16076/frameworks/flex-config.xml
Error: Unable to resolve resource bundle "components" for locale "en_US".
....bla bla bla...
Error: Unable to resolve resource bundle "controls" for locale "en_US".

daemonna@NES-KOS-29:~/Desktop/FlexUnit4Turnkey_4.0_sdk_4.0.fxp_FILES/src$ mxmlc -library-path=../libs -library-**path=/home/daemonna/Frameworks/flex_sdk_4.1.0.16076/frameworks/locale/en_US/** -locale=en_US App.mxml 
Loading configuration file /home/daemonna/Frameworks/flex_sdk_4.1.0.16076/frameworks/flex-config.xml
/home/daemonna/Desktop/FlexUnit4Turnkey_4.0_sdk_4.0.fxp_FILES/src/App.swf (37964 bytes)
0

Source: https://habr.com/ru/post/1703120/