You are viewing a plain text version of this content. The canonical link for it is here.
Posted to npanday-dev@incubator.apache.org by "Brett Porter (JIRA)" <ji...@apache.org> on 2014/08/22 01:47:11 UTC
[jira] [Resolved] (NPANDAY-467)
resgen:generate-existing-resx-to-resource not finding resx files for
translation to resources
[ https://issues.apache.org/jira/browse/NPANDAY-467?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Brett Porter resolved NPANDAY-467.
----------------------------------
Resolution: Fixed
Assignee: Brett Porter
Applied - thanks for the patch and sorry for the significant delay!
> 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
> Assignee: Brett Porter
> Priority: Critical
> Fix For: 1.5.0-incubating
>
> Attachments: ExistingResxGenerator.patch
>
>
> 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 was sent by Atlassian JIRA
(v6.2#6252)