title: Using ant, does anyone know how to build a SWF made up of SWCs (that you've built) that include resource bundles?
body: <p>I'm trying to write an ant build script to build my group's flex app, and I've run into some roadblocks that I'm hoping someone on SO has seen before.</p>
  
  <p>We have two projects that we build into SWCs and these components contain resource bundles. One SWC requires the other SWC. We have one project that we build into our application (the SWF) which uses both SWCs.</p>
  
  <p>When I build the SWCs, I get no complaints about resource bundles not being found, and when I open the SWCs in winzip, I can see the bundles (in /locale/EN_US, for example)</p>
  
  <p>When I build the SWF, however, I get complaints about not being able to find the resource bundles in the two swc's, but no complaints about not being able to find any other resource bundles (like the flex framework ones).
  This is the kind of message I get from ant:</p>
  
  <pre><code>[mxmlc] Error: Unable to resolve resource bundle "whatever" for locale "en_US".
  [mxmlc]
  </code></pre>
  
  <p>Surely, I am not the first person to hit this gotcha, so does anyone know what the problem is here? 
  Am I building the SWCs wrong, or the SWF?</p>
  
  <p>For reference, here's one of my build tasks using compc (for some reason, I can't get the opening target tag to show up)</p>
  
  <p></p>
  
  <pre><code>    &lt;path id="facet.sourcePath"&gt;
          &lt;pathelement location="${flex.facet.src}"/&gt;
      &lt;/path&gt;
      &lt;property name="facet.sourcePath" refid="facet.sourcePath"/&gt;
      &lt;echo message="sourcePath is ${facet.sourcePath}"/&gt;
      &lt;fileset dir="${facet.sourcePath}" id="facet.sources"&gt;
          &lt;include name="**/*.as"/&gt;
      &lt;/fileset&gt;
      &lt;pathconvert property="facet.classes" pathsep=" " refid="facet.sources"&gt;
          &lt;compositemapper&gt;
              &lt;chainedmapper&gt;
                  &lt;globmapper from="*.as" to="*"/&gt;
                  &lt;globmapper from="${facet.sourcePath}\*" to="*" handledirsep="true" /&gt;
              &lt;/chainedmapper&gt;
              &lt;chainedmapper&gt;
                  &lt;globmapper from="*.mxml" to="*"/&gt;      
                  &lt;globmapper from="${facet.sourcePath}\*" to="*" handledirsep="true" /&gt;
              &lt;/chainedmapper&gt;
          &lt;/compositemapper&gt;                     
      &lt;/pathconvert&gt;           
      &lt;echo message="classes: ${facet.classes}"/&gt;
      &lt;compc output="${flex.lib.output}/${facet.swc.name}" locale="EN_US" 
                  include-classes="${facet.classes}" directory="false"
                  target-player="10.0.0" 
                  &gt;
          &lt;load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/&gt;
          &lt;include-resource-bundles bundle="foo"/&gt;
          &lt;include-resource-bundles bundle="bar"/&gt;
          &lt;include-resource-bundles bundle="whatever"/&gt;
          &lt;sp path-element="${flex.facet.dir}/locale/{locale}"/&gt;
          &lt;keep-as3-metadata name="Bindable"/&gt;
          &lt;keep-as3-metadata name="Remotable"/&gt;
          &lt;keep-as3-metadata name="Embed"/&gt;
          &lt;keep-as3-metadata name="Event"/&gt;
          &lt;keep-as3-metadata name="ResourceBundle"/&gt;
          &lt;source-path path-element="${flex.facet.src}"/&gt;
      &lt;compiler.library-path append="true" dir="${flex.framework.lib}"&gt;
        &lt;include name="*.swc"/&gt;
        &lt;include name="../locale/${locale}"/&gt;
      &lt;/compiler.library-path&gt;
      &lt;compiler.library-path append="true" dir="${flex.rsm.lib}"&gt;
        &lt;include name="*.swc"/&gt;
      &lt;/compiler.library-path&gt;
    &lt;/compc&gt;
  &lt;/target&gt;
  </code></pre>
  
  <p>and here's my mxmlc task:</p>
  
  <pre><code>&lt;target name="flex.webapp.compile" description="compiles your flex app"&gt;
        &lt;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" 
          &gt;
          &lt;load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/&gt;
          &lt;include-resource-bundles bundle="RSM"/&gt;
          &lt;source-path path-element="${FLEX_HOME}/frameworks"/&gt;   
          &lt;source-path path-element="${flex.webapp.src}" /&gt;         
          &lt;source-path path-element="${flex.webapp.dir}/locale/en_US" /&gt;
          &lt;source-path path-element="${flex.rsm.lib}" /&gt;
          &lt;sp path-element="${flex.core.dir}/locale/{locale}"/&gt;
          &lt;sp path-element="${flex.facet.dir}/locale/{locale}" /&gt; 
          &lt;compiler.library-path append="true" dir="${flex.framework.lib}"&gt;
              &lt;include name="*.swc"/&gt;
              &lt;!--include name="../locale/${locale}"/--&gt;
          &lt;/compiler.library-path&gt;
          &lt;compiler.library-path append="true" dir="${flex.rsm.lib}"&gt;
              &lt;include name="*.swc"/&gt;
              &lt;include name="../locale/${locale}" /&gt;          
              &lt;!--include name="rsm_rb.swc" /--&gt;
          &lt;/compiler.library-path&gt;
      &lt;/mxmlc&gt;
  &lt;/target&gt;
  </code></pre>