Why can't you just let flexmojos compile the resource bundle and just ignore? I know, it does take some seconds, but common, your approach to build is complete out of the chart. And, the tests do need this information, otherwise I would have to add a testLocales, something that I would do, because it will turn something already complicated in something extreme complicated. People already get confused with compileLocales/runtimeLocales, imagine what would happen if I introduce a testLocales....
So, right now, flexmojos do not support building SWF w/o localization. By definition each application SWF need to have resources. The error you got while running the tests prove that. Application SWF needs resource-bundle information. Take it away and it will blow at runtime. I see no much options here..... allowing users to produce unlocalized resources will result in a disaster in the long term, and you already have a viable workaround (do runtime localization and w8 a few extra seconds to be built, then ignore the localizations you don't wanna use). I think this is the first time in 2 years someone wanna do something like that. It is much more complicated to do then the regular runtime localization (which is already more complicated then compiled localization). Runtime and compile localization are both handled by flexmojos greatly (IMHO). Adding support for building probably broken SWFs is not a viable option right now. Right now I see no positive reason to add this "feature" to flexmojos and I also do not see anything you can't do with flexmojos as it is. It will take time to build the extra runtime resource bundle? Yes! Twice longer as you stated? Never! Do some benchmark, if you can prove me it take muuuuuch more time to build this extra locales I can rethink that. But right now I'm much more concern with the potential issues this can raise. One alternative I see is disable test compilation then add an execution to do that. But I have no idea how flexmojos will behave. VELO On Thu, Feb 18, 2010 at 5:14 PM, Collin Peters <[email protected]>wrote: > I apologize for the length of this post. It requires a long > explanation. > This post is a continuation of the discussion at > https://issues.sonatype.org/browse/FLEXMOJOS-273. > > What I am trying to accomplish is to build an application SWF that > excludes the resources (e.g. resourceBundle metadata tag including > framework resources). The resulting SWF should not have ANY resources > compiled in. According to the instructions at Adobe (http:// > livedocs.adobe.com/flex/3/html/help.html?content=l10n_5.html) this > means that if you forget to use the resourceModuleURLs attribute in > your HTML template, the SWF will entirely fail to load with an RSL > error. > > Using the command line compiler, this is a three step process. > 1) Determine which resource bundles should be used. The command here > is: "mxmlc -locale= -resource-bundle-list=myresources.txt MyApp.mxml". > This produces a file which contains the resource bundles used. The > example on their page is "bundles = RegistrationForm collections > containers controls core effects skins styles" where RegistrationForm > is the custom one and the remainder are the Flex framework resource > bundles > 2) Compile your resource bundles. The command here is "mxmlc - > locale=en_US -source-path=locale/{locale} -include-resource- > > bundles=RegistrationForm,collections,containers,controls,core,effects,skins,styles > -output en_US_ResourceModule.swf". This would produce a resource > module swf for en_US with the specified bundles > 3) Compile your application. The command here is "mxmlc -locale= > MyApp.mxml". Note that no locale is specified here which instructs > the compiler to not compile in any resources. The resulting > application SWF is smaller as it is excluding these resources > > Now... step 1 is not really the job of Flex Mojos. It is more of a > one time operation that would be performed by the developer. > > Steps 2 and 3 are accomplished nicely by Flex Mojos through the > <runtimeLocales> argument. This will cause Flex Mojos to compile the > application, and then compile the specified locales as resource > modules, all in one go. > > The problem for me is twofold. > > First, I am running a multi-application project here and one resource > bundle for all of them. So I do not wish to have each application > compile their own resource bundles as that is pointless work. To > overcome this I have defined a single project/pom which does the work > of compiling the resource modules and this works great. Now the next > step is to get all the applications to NOT compile in the resources, > similar to omitting the locale such as the mxmlc example above. I > cannot use <runtimeLocales> here as this would cause each application > to unnecessarily generate the resource modules. I cannot use > <compiledLocales> as this would obviously compile in resources which I > don't want. Looking through the options I tried a number of options > including not specifying any items within <runtimeLocales> and > <compiledLocales> but this results in the error 'Unable to resolve > resource bundle "CoreResources" for locale "en_US"' . I found the > option <useDefaultLocale> which is undocumented and does work, however > it breaks on the unit tests part of the build (as dicussed below). I > was also instructed that this shouldn't be used and is deprecated. I > am now trying <useResourceBundleMetadata>false</ > useResourceBundleMetadata> which also works but suffers from the same > problem of breaking the unit tests. So the first problem is that I > can't find the option to exclude resources, without using > <runtimeLocales> which would duplicate the compilation of resources > modules in every application (of which there are about 15) > > Second problem: As mentioned, using <useResourceBundleMetadata>false</ > useResourceBundleMetadata> does result in an application SWF that > correctly excludes the resources, but the tests fail to run. I see > the flash player launch for the test, then I get the error: > An ActionScript error has occurred: > Error: Could not find compiled resource bundle 'collections' for > locale 'en_US'. > at mx.resources::ResourceManagerImpl/ > http://www.adobe.com/2006/flex/ > mx/internal::installCompiledResourceBundle()[C<http://www.adobe.com/2006/flex/%0Amx/internal::installCompiledResourceBundle%28%29[C> > :\autobuild > \3.3.0\frameworks\projects\framework\src\mx\resources > \ResourceManagerImpl.as:306] > at > mx.resources::ResourceManagerImpl/installCompiledResourceBundles() > [C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\resources > \ResourceManagerImpl.as:235] > at mx.managers::SystemManager/installCompiledResourceBundles()[C: > \autobuild\3.3.0\frameworks\projects\framework\src\mx\managers > \SystemManager.as:3127] > at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/ > internal::docFrameHandler()[C:\autobuild\3.3.0\frameworks\projects > \framework\src\mx\managers\SystemManager.as:3101] > at mx.managers::SystemManager/docFrameListener()[C:\autobuild > \3.3.0\frameworks\projects\framework\src\mx\managers\SystemManager.as: > 2955] > > So it appears that the test swf also contains no resources compiled > in, and then it promptly fails as the test framework is not expecting > this (I assume). If I compile with -DskipTests then then the build > does succeed, but obviously the tests don't run. > > Hopefully this is enough information to fully explain the issue. I > believe the ultimate issue is the error in running tests but I am > wondering if there is a more proper way of specifying the arguments. > I would suspect that the tests should always compile in the resources > (i.e. <useResourceBundleMetadata> doesn't apply). > > Please ask for any more info needed. > > Regards, > Collin Peters > > -- > You received this message because you are subscribed to the Google > Groups "Flex Mojos" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected]<flex-mojos%[email protected]> > For more options, visit this group at > http://groups.google.com/group/flex-mojos?hl=en?hl=en > > http://flexmojos.sonatype.org/ > -- You received this message because you are subscribed to the Google Groups "Flex Mojos" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/flex-mojos?hl=en?hl=en http://flexmojos.sonatype.org/
