Author: brett
Date: Fri Aug 22 01:46:21 2014
New Revision: 1619647

URL: http://svn.apache.org/r1619647
Log:
[NPANDAY-467] locate resx files in the current directory

This was the intended behaviour, but an incorrect condition on the
embeddedResources field was preventing it.

Submitted by: Anthony Whitford

Modified:
    
incubator/npanday/trunk/plugins/maven-resgen-plugin/src/main/java/npanday/plugin/resgen/ExistingResxGenerator.java
    incubator/npanday/trunk/pom.xml

Modified: 
incubator/npanday/trunk/plugins/maven-resgen-plugin/src/main/java/npanday/plugin/resgen/ExistingResxGenerator.java
URL: 
http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/maven-resgen-plugin/src/main/java/npanday/plugin/resgen/ExistingResxGenerator.java?rev=1619647&r1=1619646&r2=1619647&view=diff
==============================================================================
--- 
incubator/npanday/trunk/plugins/maven-resgen-plugin/src/main/java/npanday/plugin/resgen/ExistingResxGenerator.java
 (original)
+++ 
incubator/npanday/trunk/plugins/maven-resgen-plugin/src/main/java/npanday/plugin/resgen/ExistingResxGenerator.java
 Fri Aug 22 01:46:21 2014
@@ -131,7 +131,10 @@ public class ExistingResxGenerator exten
             for (EmbeddedResource embeddedResource : embeddedResources)
             {   
                File file = new File(project.getBuild().getSourceDirectory() + 
File.separator + embeddedResource.getSourceFile());
-               if(!file.exists()) continue;
+                if (!file.exists()) {
+                    getLog().warn("embeddedResource does not exist: " + 
embeddedResource.getSourceFile());
+                    continue;
+                }
                 commands = getCommands(file.getAbsoluteFile(), 
resourceDirectory, embeddedResource.getName());
                 netExecutableFactory.getExecutable(
                     new ExecutableRequirement( vendor, null, frameworkVersion, 
"RESGEN" ), commands, netHome
@@ -139,15 +142,15 @@ public class ExistingResxGenerator exten
                     .execute();
             }
           
-            if(embeddedResources == null)
+            if(embeddedResources.length == 0)
             {
                String sourceDirectory = project.getBasedir().getPath();
                   String[] resourceFilenames  = 
FileUtils.getFilesFromExtension(sourceDirectory, new String[]{"resx"});
                
                for(String resourceFilename : resourceFilenames)
                {
+                  getLog().debug("processing " + resourceFilename);
                  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('.'));
 

Modified: incubator/npanday/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/incubator/npanday/trunk/pom.xml?rev=1619647&r1=1619646&r2=1619647&view=diff
==============================================================================
--- incubator/npanday/trunk/pom.xml (original)
+++ incubator/npanday/trunk/pom.xml Fri Aug 22 01:46:21 2014
@@ -311,6 +311,9 @@ under the License.
     <contributor>
       <name>David Akehurst</name>
     </contributor>
+    <contributor>
+      <name>Anthony Whitford</name>
+    </contributor>
   </contributors>
   <modules>
     <module>components</module>


Reply via email to