JaCoCo Addon: Projects that have jacoco disabled will no longer appear in the 
JaCoCo reports.


Project: http://git-wip-us.apache.org/repos/asf/buildr/repo
Commit: http://git-wip-us.apache.org/repos/asf/buildr/commit/b6a894a6
Tree: http://git-wip-us.apache.org/repos/asf/buildr/tree/b6a894a6
Diff: http://git-wip-us.apache.org/repos/asf/buildr/diff/b6a894a6

Branch: refs/heads/master
Commit: b6a894a654c2d058c28218bae781b8ee26b6641b
Parents: 0265b87
Author: Peter Donald <pe...@realityforge.org>
Authored: Sun Oct 29 18:08:34 2017 +1100
Committer: Peter Donald <pe...@realityforge.org>
Committed: Sun Oct 29 18:08:58 2017 +1100

----------------------------------------------------------------------
 CHANGELOG              | 1 +
 addon/buildr/jacoco.rb | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/buildr/blob/b6a894a6/CHANGELOG
----------------------------------------------------------------------
diff --git a/CHANGELOG b/CHANGELOG
index 5e7dcff..aa4fcea 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,4 +1,5 @@
 1.5.4 (Pending)
+* Fixed:  JaCoCo Addon: Projects that have jacoco disabled will no longer 
appear in the JaCoCo reports.
 * Change: JaCoCo Addon: Update JaCoCo version to 0.7.9.
 * Fixed:  BUILDR-733 - Escape classpath entries in the pathing jar manifest. 
Submitted by Glenn Croes.
 * Fixed:  Ensure that the pom is attached to the jar artifact with empty 
classifier rather than the last

http://git-wip-us.apache.org/repos/asf/buildr/blob/b6a894a6/addon/buildr/jacoco.rb
----------------------------------------------------------------------
diff --git a/addon/buildr/jacoco.rb b/addon/buildr/jacoco.rb
index 8ad0c6f..a4b5e56 100644
--- a/addon/buildr/jacoco.rb
+++ b/addon/buildr/jacoco.rb
@@ -185,19 +185,19 @@ module Buildr
             end
             ant.report do |ant|
               ant.executiondata do |ant|
-                Buildr.projects.each do |project|
+                Buildr.projects.select{|p|p.jacoco.enabled?}.each do |project|
                   ant.fileset :file=>project.jacoco.destfile if 
File.exist?(project.jacoco.destfile)
                 end
               end
 
               ant.structure(:name => 'Jacoco Report') do |ant|
                 ant.classfiles do |ant|
-                  
Buildr.projects.map(&:compile).map(&:target).flatten.map(&:to_s).each do |src|
+                  
Buildr.projects.select{|p|p.jacoco.enabled?}.map(&:compile).map(&:target).flatten.map(&:to_s).each
 do |src|
                     ant.fileset :dir=>src.to_s if File.exist?(src)
                   end
                 end
                 ant.sourcefiles(:encoding => 'UTF-8') do |ant|
-                  
Buildr.projects.map(&:compile).map(&:sources).flatten.map(&:to_s).each do |src|
+                  
Buildr.projects.select{|p|p.jacoco.enabled?}.map(&:compile).map(&:sources).flatten.map(&:to_s).each
 do |src|
                     ant.fileset :dir=>src.to_s if File.exist?(src)
                   end
                 end

Reply via email to