You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2014/07/06 11:48:05 UTC

svn commit: r1608180 - in /maven/plugins/trunk/maven-checkstyle-plugin/src: main/java/org/apache/maven/plugin/checkstyle/ main/java/org/apache/maven/plugin/checkstyle/exec/ test/java/org/apache/maven/plugin/checkstyle/ test/java/org/apache/maven/plugin...

Author: hboutemy
Date: Sun Jul  6 09:48:05 2014
New Revision: 1608180

URL: http://svn.apache.org/r1608180
Log:
refactoring: move CheckstyleExecutor component to its a new dedicated exec package: CheckstyleReportListener is part of this component too

Added:
    maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/exec/CheckstyleReportListener.java
      - copied, changed from r1607987, maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReportListener.java
    maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/exec/CheckstyleReportListenerMultiSourceTest.java
      - copied, changed from r1607987, maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/CheckstyleReportListenerMultiSourceTest.java
    maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/exec/CheckstyleReportListenerTest.java
      - copied, changed from r1607987, maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/CheckstyleReportListenerTest.java
Removed:
    maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReportListener.java
    maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/CheckstyleReportListenerMultiSourceTest.java
    maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/CheckstyleReportListenerTest.java
Modified:
    maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/exec/DefaultCheckstyleExecutor.java

Copied: maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/exec/CheckstyleReportListener.java (from r1607987, maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReportListener.java)
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/exec/CheckstyleReportListener.java?p2=maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/exec/CheckstyleReportListener.java&p1=maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReportListener.java&r1=1607987&r2=1608180&rev=1608180&view=diff
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReportListener.java (original)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/exec/CheckstyleReportListener.java Sun Jul  6 09:48:05 2014
@@ -1,4 +1,4 @@
-package org.apache.maven.plugin.checkstyle;
+package org.apache.maven.plugin.checkstyle.exec;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -25,7 +25,6 @@ import com.puppycrawl.tools.checkstyle.a
 import com.puppycrawl.tools.checkstyle.api.Configuration;
 import com.puppycrawl.tools.checkstyle.api.SeverityLevel;
 
-import org.apache.maven.plugin.checkstyle.exec.CheckstyleResults;
 import org.codehaus.plexus.util.StringUtils;
 
 import java.io.File;

Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/exec/DefaultCheckstyleExecutor.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/exec/DefaultCheckstyleExecutor.java?rev=1608180&r1=1608179&r2=1608180&view=diff
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/exec/DefaultCheckstyleExecutor.java (original)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/exec/DefaultCheckstyleExecutor.java Sun Jul  6 09:48:05 2014
@@ -36,7 +36,6 @@ import org.apache.commons.io.IOUtils;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.DependencyResolutionRequiredException;
 import org.apache.maven.model.Resource;
-import org.apache.maven.plugin.checkstyle.CheckstyleReportListener;
 import org.apache.maven.project.MavenProject;
 import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.component.annotations.Requirement;
@@ -198,22 +197,22 @@ public class DefaultCheckstyleExecutor
             checker.addListener( request.getConsoleListener() );
         }
 
-        CheckstyleReportListener sinkListener = new CheckstyleReportListener( configuration );
+        CheckstyleReportListener checkerListener = new CheckstyleReportListener( configuration );
         if ( request.isAggregate() )
         {
             for ( MavenProject childProject : request.getReactorProjects() )
             {
-                addSourceDirectory( sinkListener, new File( childProject.getBuild().getSourceDirectory() ),
+                addSourceDirectory( checkerListener, new File( childProject.getBuild().getSourceDirectory() ),
                                     new File( childProject.getBuild().getTestSourceDirectory() ),
                                     childProject.getResources(), request );
             }
         }
         else
         {
-            addSourceDirectory( sinkListener, sourceDirectory, testSourceDirectory, request.getResources(), request );
+            addSourceDirectory( checkerListener, sourceDirectory, testSourceDirectory, request.getResources(), request );
         }
 
-        checker.addListener( sinkListener );
+        checker.addListener( checkerListener );
 
         List<File> filesList = Arrays.asList( files );
         int nbErrors = checker.process( filesList );
@@ -250,7 +249,7 @@ public class DefaultCheckstyleExecutor
             request.getLog().info( "There are " + nbErrors + " checkstyle errors." );
         }
 
-        return sinkListener.getResults();
+        return checkerListener.getResults();
     }
 
     protected void addSourceDirectory( CheckstyleReportListener sinkListener, File sourceDirectory,

Copied: maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/exec/CheckstyleReportListenerMultiSourceTest.java (from r1607987, maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/CheckstyleReportListenerMultiSourceTest.java)
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/exec/CheckstyleReportListenerMultiSourceTest.java?p2=maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/exec/CheckstyleReportListenerMultiSourceTest.java&p1=maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/CheckstyleReportListenerMultiSourceTest.java&r1=1607987&r2=1608180&rev=1608180&view=diff
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/CheckstyleReportListenerMultiSourceTest.java (original)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/exec/CheckstyleReportListenerMultiSourceTest.java Sun Jul  6 09:48:05 2014
@@ -1,4 +1,4 @@
-package org.apache.maven.plugin.checkstyle;
+package org.apache.maven.plugin.checkstyle.exec;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -29,6 +29,7 @@ import java.io.File;
 import java.util.HashMap;
 import java.util.Map;
 
+import org.apache.maven.plugin.checkstyle.exec.CheckstyleReportListener;
 import org.apache.maven.plugin.checkstyle.exec.CheckstyleResults;
 
 /**

Copied: maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/exec/CheckstyleReportListenerTest.java (from r1607987, maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/CheckstyleReportListenerTest.java)
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/exec/CheckstyleReportListenerTest.java?p2=maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/exec/CheckstyleReportListenerTest.java&p1=maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/CheckstyleReportListenerTest.java&r1=1607987&r2=1608180&rev=1608180&view=diff
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/CheckstyleReportListenerTest.java (original)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/exec/CheckstyleReportListenerTest.java Sun Jul  6 09:48:05 2014
@@ -1,4 +1,4 @@
-package org.apache.maven.plugin.checkstyle;
+package org.apache.maven.plugin.checkstyle.exec;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -29,6 +29,7 @@ import java.io.File;
 import java.util.HashMap;
 import java.util.Map;
 
+import org.apache.maven.plugin.checkstyle.exec.CheckstyleReportListener;
 import org.apache.maven.plugin.checkstyle.exec.CheckstyleResults;
 
 /**