dest = FileUtils.createTempFile( baseRbSwc.getArtifactId(), requestedLocale, getOutputDirectory() );
unzip.extract( "locale/" + baseRbSwc.getClassifier(), dest );
}
catch ( Exception e )
{
throw new MavenRuntimeException( "Unable to extract base locale", e );
}
File resourceBundleBaseDir = new File( dest, "locale/" + baseRbSwc.getClassifier() );
List<String> bundles = new ArrayList<String>();
for ( String bundle : resourceBundleBaseDir.list() )
{
bundles.add( bundle.replace( ".properties", "" ) );
}
ICompcConfiguration cfg = mock( ICompcConfiguration.class, RETURNS_NULL );
when( cfg.getLoadConfig() ).thenReturn( getLoadConfig() );
when( cfg.getIncludeResourceBundles() ).thenReturn( bundles );
String output = PathUtil.path( baseRbSwc.getFile() ).replace( baseRbSwc.getClassifier(), rbSwc.getClassifier() );
when( cfg.getOutput() ).thenReturn( output );
ICompilerConfiguration compilerCfg = mock( ICompilerConfiguration.class, RETURNS_NULL );
when( compilerCfg.getTheme() ).thenReturn( Collections.EMPTY_LIST );
when( compilerCfg.getFontsConfiguration() ).thenReturn( getFontsConfiguration() );
when( compilerCfg.getLocale() ).thenReturn( new String[] { requestedLocale } );
when( compilerCfg.getSourcePath() ).thenReturn( new File[] { resourceBundleBaseDir } );
when( compilerCfg.getExternalLibraryPath() ).thenReturn( this.getExternalLibraryPath() );
when( compilerCfg.getLibraryPath() ).thenReturn( this.getLibraryPath( false ) );
when( cfg.getCompilerConfiguration() ).thenReturn( compilerCfg );
try
{
checkResult( compiler.compileSwc( cfg, true ) );
}
catch ( Exception e )
{
throw new MavenRuntimeException( "Unable to compile adapted resource bundle", e );
}
rbSwc.setFile( new File( output ) );
rbSwc.setResolved( true );
return rbSwc;