creadur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r1450955 - /creadur/rat/trunk/apache-rat-plugin/src/main/java/org/apache/rat/mp/AbstractRatMojo.java
Date Wed, 27 Feb 2013 21:00:21 GMT
Author: rdonkin
Date: Wed Feb 27 21:00:21 2013
New Revision: 1450955

URL: http://svn.apache.org/r1450955
Log:
RAT-126 Improve debugging messages. Thanks to Bernd Eckenfels for suggestions in https://issues.apache.org/jira/browse/RAT-126

Modified:
    creadur/rat/trunk/apache-rat-plugin/src/main/java/org/apache/rat/mp/AbstractRatMojo.java

Modified: creadur/rat/trunk/apache-rat-plugin/src/main/java/org/apache/rat/mp/AbstractRatMojo.java
URL: http://svn.apache.org/viewvc/creadur/rat/trunk/apache-rat-plugin/src/main/java/org/apache/rat/mp/AbstractRatMojo.java?rev=1450955&r1=1450954&r2=1450955&view=diff
==============================================================================
--- creadur/rat/trunk/apache-rat-plugin/src/main/java/org/apache/rat/mp/AbstractRatMojo.java
(original)
+++ creadur/rat/trunk/apache-rat-plugin/src/main/java/org/apache/rat/mp/AbstractRatMojo.java
Wed Feb 27 21:00:21 2013
@@ -280,11 +280,12 @@ public abstract class AbstractRatMojo ex
      */
     protected IReportable getResources()
     {
-        DirectoryScanner ds = new DirectoryScanner();
+        final DirectoryScanner ds = new DirectoryScanner();
         ds.setBasedir( basedir );
         setExcludes( ds );
         setIncludes( ds );
         ds.scan();
+        whenDebuggingLogExcludedFiles(ds);
         final String[] files = ds.getIncludedFiles();
         try
         {
@@ -296,6 +297,20 @@ public abstract class AbstractRatMojo ex
         }
     }
 
+    private void whenDebuggingLogExcludedFiles(final DirectoryScanner ds) {
+        if (getLog().isDebugEnabled()) {
+            final String[] excludedFiles = ds.getExcludedFiles();
+            if (excludedFiles.length == 0) {
+                getLog().debug("No excluded resources.");
+            } else {
+                getLog().debug("Excluded " + excludedFiles.length + " resources:");
+                for (final String resource : excludedFiles) {
+                    getLog().debug(" - excluded " + resource);
+                }
+            }
+        }
+    }
+
     private void setIncludes( DirectoryScanner ds )
     {
         if ( includes != null )



Mime
View raw message