[
https://issues.apache.org/jira/browse/NPANDAY-467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13095606#comment-13095606
]
Anthony Whitford commented on NPANDAY-467:
------------------------------------------
I also don't understand why this code:
{code}if(!file.exists()) continue;{code}
follows {{FileUtils.getFilesFromExtension}} because presumably the getFiles
call would only return files that exist.
> resgen:generate-existing-resx-to-resource not finding resx files for
> translation to resources
> ---------------------------------------------------------------------------------------------
>
> Key: NPANDAY-467
> URL: https://issues.apache.org/jira/browse/NPANDAY-467
> Project: NPanday
> Issue Type: Bug
> Components: Maven Plugins
> Affects Versions: 1.4-incubating
> Environment: Windows XP, .Net Framework 3.5, Java 6
> Reporter: Anthony Whitford
> Priority: Critical
>
> The code says:{code}
> List commands = null;
> for (EmbeddedResource embeddedResource : embeddedResources)
> {
> File file = new File(project.getBuild().getSourceDirectory()
> + File.separator + embeddedResource.getSourceFile());
> if(!file.exists()) continue;
> commands = getCommands(file.getAbsoluteFile(),
> resourceDirectory, embeddedResource.getName());
> netExecutableFactory.getNetExecutableFor( vendor,
> frameworkVersion, "RESGEN",commands ,
> netHome ).execute();
> }
> if(embeddedResources == null)
> {
> String sourceDirectory = project.getBasedir().getPath();
> String[] resourceFilenames =
> FileUtils.getFilesFromExtension(sourceDirectory, new String[]{"resx"});
> for(String resourceFilename : resourceFilenames)
> {
> File file = new File(resourceFilename);
> if(!file.exists()) continue;
> String name =
> resourceFilename.substring(sourceDirectory.length() + 1).replace('\\', '.');
> name = project.getArtifactId() + "." + name.substring(0,
> name.lastIndexOf('.'));
> commands = getCommands(file.getAbsoluteFile(),
> resourceDirectory, name);
> netExecutableFactory.getNetExecutableFor( vendor,
> frameworkVersion, "RESGEN",commands ,
> netHome ).execute();
> }
> }
> {code}
> The {{if(embeddedResources == null)}} doesn't really make sense here because
> {{embeddedResources}} is an empty array. This needs to be changed to: {{if
> (0 == embeddedResources.length)}}. Without this fix, the plugin is not
> running this code that is designed to find the resx files and generate the
> resource files.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira