You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by do...@apache.org on 2011/12/04 10:40:21 UTC

svn commit: r1210086 - in /buildr/trunk: CHANGELOG addon/buildr/pmd.rake

Author: donaldp
Date: Sun Dec  4 09:40:21 2011
New Revision: 1210086

URL: http://svn.apache.org/viewvc?rev=1210086&view=rev
Log:
Make minimumTokenCount and encoding configurable for the PMD/CPD action and default encoding to UTF-8 for compatibility with external tools (i.e. Jenkins)

Modified:
    buildr/trunk/CHANGELOG
    buildr/trunk/addon/buildr/pmd.rake

Modified: buildr/trunk/CHANGELOG
URL: http://svn.apache.org/viewvc/buildr/trunk/CHANGELOG?rev=1210086&r1=1210085&r2=1210086&view=diff
==============================================================================
--- buildr/trunk/CHANGELOG (original)
+++ buildr/trunk/CHANGELOG Sun Dec  4 09:40:21 2011
@@ -1,4 +1,6 @@
 1.4.8 (Pending)
+* Change: Make minimumTokenCount and encoding configurable for the PMD/CPD action
+          and default encoding to UTF-8 for compatibility with external tools (i.e. Jenkins)
 * Fixed:  BUILDR-617 pom exclusion does not work (Kafka Liu)
 * Change: BUILDR-615 VersionRequirement.version? now returns true for
           versions following pattern "r9999", e.g. "r09"

Modified: buildr/trunk/addon/buildr/pmd.rake
URL: http://svn.apache.org/viewvc/buildr/trunk/addon/buildr/pmd.rake?rev=1210086&r1=1210085&r2=1210086&view=diff
==============================================================================
--- buildr/trunk/addon/buildr/pmd.rake (original)
+++ buildr/trunk/addon/buildr/pmd.rake Sun Dec  4 09:40:21 2011
@@ -54,13 +54,15 @@ module Buildr
       def cpd(format, output_file_prefix, source_paths, options = {})
         dependencies = (options[:dependencies] || []) + self.dependencies
         cp = Buildr.artifacts(dependencies).each(&:invoke).map(&:to_s)
+        minimum_token_count = options[:minimum_token_count] || 100
+        encoding = options[:encoding] || 'UTF-8'
 
         puts "PMD-CPD: Analyzing source code..."
         mkdir_p File.dirname(output_file_prefix)
 
         Buildr.ant("cpd-report") do |ant|
           ant.taskdef :name=> 'cpd', :classpath => cp.join(';'), :classname => 'net.sourceforge.pmd.cpd.CPDTask'
-          ant.cpd :format => format, :minimumTokenCount => 100, :outputFile => "#{output_file_prefix}.#{format}" do
+          ant.cpd :format => format, :minimumTokenCount => minimum_token_count, :encoding => encoding, :outputFile => "#{output_file_prefix}.#{format}" do
             source_paths.each do |src|
               ant.fileset :dir=> src, :includes=>'**/*.java'
             end