Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #32 from pjastrz/flexmojos-4.x

Flexmojos 4.x
  • Loading branch information...
commit 47c4bfa4dd3b1e9920a8fc76add44f4ada02de98 2 parents b3d34de + 9623fc0
@velo velo authored
View
23 flexmojos-maven-plugin/src/main/java/org/sonatype/flexmojos/plugin/compiler/AbstractFlexCompilerMojo.java
@@ -585,7 +585,23 @@
* @parameter default-name="${project.build.finalName}" expression="${flex.finalName}"
*/
protected String finalName;
-
+
+ /**
+ * Pattern to be used for locales resurce bundles names generation. Accepts special tokens:
+ *
+ * <pre>
+ * {locale} - replace by locale name
+ * {artifactId} - replace by artifactId
+ * {groupId} - replace by groupId
+ * {version} - replace by version
+ * {classifier} - replace by classifier
+ *
+ * </pre>
+ *
+ * @parameter
+ */
+ protected String resourceBundleNamePattern;
+
/**
* Fonts configurations to be used on SWF compilation
* <p>
@@ -1556,7 +1572,10 @@ protected void configureResourceBundle( String locale, AbstractFlexCompilerMojo<
{
cfg.classifier = locale;
}
-
+ if(resourceBundleNamePattern != null){
+ cfg.finalName = MavenUtils.getRuntimeLocaleOutputName(resourceBundleNamePattern, project.getArtifact(), cfg.classifier);
+ }
+
cfg.includeResourceBundles = getResourceBundleListContent();
cfg.getCache().put( EXTERNAL_LIBRARY_PATH, MavenUtils.getFiles( getDependencies( type( SWC ) ) ) );
cfg.getCache().put( LIBRARY_PATH, MavenUtils.getFiles( cfg.getCompiledResouceBundles() ) );
View
6 flexmojos-maven-plugin/src/main/java/org/sonatype/flexmojos/plugin/test/TestCompilerMojo.java
@@ -585,6 +585,12 @@ protected File getSourceFile()
files.addAll( PathUtil.existingFilesList( testCompileSourceRoots ) );
files.addAll( Arrays.asList( super.getSourcePath() ) );
+
+ if ( getLocale() != null ) {
+ if ( localesSourcePath.getParentFile().exists() ) {
+ files.add( localesSourcePath );
+ }
+ }
return files.toArray( new File[0] );
}
View
8 flexmojos-maven-plugin/src/main/java/org/sonatype/flexmojos/plugin/utilities/MavenUtils.java
@@ -301,7 +301,13 @@ public static String getRuntimeLocaleOutputPath( String sample, Artifact artifac
return path;
}
-
+ public static String getRuntimeLocaleOutputName( String sample, Artifact artifact, String locale )
+ {
+ String path = replaceArtifactCoordinatesTokens( sample, artifact );
+ path = path.replace( "{locale}", locale );
+
+ return path;
+ }
public static Set<File> getFilesSet( Collection<Artifact>... dependenciesSet )
{
if ( dependenciesSet == null )
Please sign in to comment.
Something went wrong with that request. Please try again.