I have a framework swc that is used across Applications. I want to
distribute the app's code along with it's resource strings and images in
one swc. I've tried many dozens of combinations and have read the localization
wiki page
<http://docs.sonatype.org/display/FLEXMOJOS/Application+Localization>and
the groups, but to no avail. This seems simple, does anyone have a wokring
example? This is for FlexMojos 3.8.
There's no compilation error, the problem is that when I open up the swc
using Nemo440, I don't see the property files or images that are in
src/main/locales/en_US. If I change the [ResourceBundle] in the code to
use a name that's not the name of the property file, I get a compilation
error, so things seem to be in the right place.
Here's my current pom. I've had simpler ones, but figured I might have to
get resource filtering to work at some point, so I left that in. I even
went so far as to explicitly include certain files (I hope I don't have to
explicitly state each asset).
<build>
<sourceDirectory>src/main/flex</sourceDirectory>
<testSourceDirectory>src/test/flex</testSourceDirectory>
<resources>
<resource>
<directory>${basedir}/src/main/resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.sonatype.flexmojos</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
<version>3.8</version>
<extensions>true</extensions>
<configuration>
<allowSourcePathOverlap>true</allowSourcePathOverlap>
<resourceBundlePath>${basedir}/src/main/locales/{locale}</resourceBundlePath>
<optimize>false</optimize>
<mergeResourceBundle>true</mergeResourceBundle>
<includeResourceBundles>
<bundle>mylib</bundle>
<bundle>ValidationMessages</bundle>
</includeResourceBundles>
<locales>
<locale>en_US</locale>
</locales>
<sourcePaths>
<path>${basedir}/src/main/flex</path>
<path>${basedir}/src/main/locales/{locale}</path>
<path>${basedir}/src/main/resources</path>
</sourcePaths>
<includeSources>
<sources>${basedir}/src/main/flex</sources>
</includeSources>
<fullSynchronization>true</fullSynchronization>
<includeFiles>
<file>${project.basedir}/src/main/locales/en_US/mylib.properties</file>
<file>${project.basedir}/src/main/locales/en_US/images/12x12Icons/closeButton.png</file>
</includeFiles>
</configuration>
</plugin>
<!-- Allow resources to be processed -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-resources</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/locales</outputDirectory>
<resources>
<resource>
<directory>src/main/locales</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugin>
</plugins>
</build>
The compiler output:
[INFO] --- flexmojos-maven-plugin:3.8:compile-swc (default-compile-swc) @
sage ---
[INFO] Flexmojos 3.8
[INFO] Apache License - Version 2.0 (NO WARRANTY) - See COPYRIGHT file
[INFO] Flex compiler configurations:
-compiler.external-library-path c:\...lots of swc's
-compiler.include-libraries=
-compiler.library-path c:\...lots of swc's
-compiler.theme
c:\....repo\com\adobe\flex\framework\halo\4.1.0.16076\halo-4.1.0.16076.swc
-compiler.accessible=false
-compiler.allow-source-path-overlap=true
-compiler.as3=true
-compiler.debug=true
-compiler.es=false
-compiler.fonts.managers flash.fonts.JREFontManager
flash.fonts.BatikFontManager flash.fonts.AFEFontManager
flash.fonts.CFFFontManager
-compiler.fonts.local-fonts-snapshot C:\...mylib\target\classes\fonts.ser
-compiler.keep-as3-metadata Inject Metadata DefaultProperty Required Event
AssignableTo InjectConstructor Publish Subscribe PublishSubscribe Factory
Init Destroy Observe AsyncInit ManagedEvents MessageDispatcher
MessageHandler MessageBindin
g MessageInterceptor MessageError Command CommandComplete CommandResult
CommandError CommandStatus ResourceBinding Selector Target Autoremove
RemovedEvent Internal ObjectDefinition DynamicObject AssertFalse AssertTrue
DecimalMax DecimalMin
Digits Future Max Min NotNull Null Past Pattern Size
-compiler.keep-generated-actionscript=false
-licenses.license flexbuilder4 12345
-compiler.locale en_US
-compiler.optimize=false
-compiler.source-path c:...\mylib\src\main\flex
c:...\mylib\src\main\locales\{locale} <dir that's parent to mylib>
sage\src\main\resources
-compiler.strict=true
-use-network=true
-compiler.verbose-stacktraces=true
-compiler.actionscript-file-encoding UTF-8
-target-player 10.1.53
-default-background-color 8821927
-default-frame-rate 24
-default-script-limits 1000 60
-default-size 500 375
-compiler.headless-server=false
-compiler.keep-all-type-selectors=false
-compiler.use-resource-bundle-metadata=true
-metadata.date Fri Jul 27 16:59:40 EDT 2012
-metadata.localized-title MyLib Flex Framework x-default
-verify-digests=true
-compute-digest=true
-compiler.namespaces.namespace+=http://ns.adobe.com/mxml/2009,c:...\mylib\target\classes\config-4.1.0.16076\mxml-2009-manifest.xml
-compiler.namespaces.namespace+=library://ns.adobe.com/flex/spark,c:...\mylib\target\classes\config-4.1.0.16076\spark-manifest.xml
-compiler.namespaces.namespace+=library://ns.adobe.com/flex/mx,c:...\mylib\target\classes\config-4.1.0.16076\mx-manifest.xml
-compiler.namespaces.namespace+=http://www.adobe.com/2006/mxml,c:...\mylib\target\classes\config-4.1.0.16076\mxml-manifest.xml
-static-link-runtime-shared-libraries=false -load-config=
-metadata.language+=en_US
Thanks!
Michael Bushe
--
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
http://flexmojos.sonatype.org/