In the PMD addon, check that the source directory exists before adding to sources directories to include
Project: http://git-wip-us.apache.org/repos/asf/buildr/repo Commit: http://git-wip-us.apache.org/repos/asf/buildr/commit/26267440 Tree: http://git-wip-us.apache.org/repos/asf/buildr/tree/26267440 Diff: http://git-wip-us.apache.org/repos/asf/buildr/diff/26267440 Branch: refs/heads/master Commit: 262674403c4f54412e7ba06df5f76ae36b70c2f9 Parents: 73d5fbd Author: Peter Donald <[email protected]> Authored: Tue Mar 1 08:39:07 2016 +1100 Committer: Peter Donald <[email protected]> Committed: Tue Mar 1 08:39:07 2016 +1100 ---------------------------------------------------------------------- CHANGELOG | 2 ++ addon/buildr/pmd.rb | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/buildr/blob/26267440/CHANGELOG ---------------------------------------------------------------------- diff --git a/CHANGELOG b/CHANGELOG index 02dcc70..4a734b0 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,6 @@ 1.4.24 (Pending) +* Fixed: In the PMD addon, check that the source directory exists before adding to + sources directories to include. * Fixed: BUILDR-709 - Fix "Exception in jacoco.rb [TypeError : can't convert Array into String]". Submitted By Ross Mahony. * Added: Define the 'activate_jruby_facet' addon that activates the jruby facet in http://git-wip-us.apache.org/repos/asf/buildr/blob/26267440/addon/buildr/pmd.rb ---------------------------------------------------------------------- diff --git a/addon/buildr/pmd.rb b/addon/buildr/pmd.rb index bf17bbf..94f7a89 100644 --- a/addon/buildr/pmd.rb +++ b/addon/buildr/pmd.rb @@ -50,7 +50,7 @@ module Buildr ant.pmd :shortFilenames => true, :rulesetfiles => rule_sets.join(',') do ant.formatter :type => format, :toFile => "#{output_file_prefix}.#{format}" source_paths.each do |src| - ant.fileset :dir=> src, :includes=>'**/*.java' + ant.fileset :dir=> src, :includes=>'**/*.java' if File.directory?(src) end end @@ -70,7 +70,7 @@ module Buildr ant.taskdef :name=> 'cpd', :classpath => cp.join(';'), :classname => 'net.sourceforge.pmd.cpd.CPDTask' 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' + ant.fileset :dir=> src, :includes=>'**/*.java' if File.directory?(src) end end
