lib/buildr/cobertura.rb in buildr-1.2.2 vs lib/buildr/cobertura.rb in buildr-1.2.3

- old
+ new

@@ -49,28 +49,26 @@ end desc "Run the test cases and produce code coverage reports in #{report_to(:html)}" task "html"=>["instrument", "test:all"] do puts "Creating test coverage reports in #{report_to(:html)}" - projects = Buildr.projects Buildr.ant "cobertura" do |ant| ant.taskdef :classpath=>requires.join(File::PATH_SEPARATOR), :resource=>"tasks.properties" ant.send "cobertura-report", :destdir=>report_to(:html), :format=>"html", :datafile=>data_file do - ant.projects.map(&:compile).map(&:sources).flatten.each do |src| + Buildr.projects.map(&:compile).map(&:sources).flatten.each do |src| ant.fileset(:dir=>src.to_s) { ant.include :name=>"**/*.java" } if File.exist?(src.to_s) end end end end desc "Run the test cases and produce code coverage reports in #{report_to(:xml)}" task "xml"=>["instrument", "test:all"] do puts "Creating test coverage reports in #{report_to(:xml)}" - projects = Buildr.projects Buildr.ant "cobertura" do |ant| ant.taskdef :classpath=>requires.join(File::PATH_SEPARATOR), :resource=>"tasks.properties" ant.send "cobertura-report", :destdir=>report_to(:xml), :format=>"xml", :datafile=>data_file do - ant.projects.map(&:compile).map(&:sources).flatten.each do |src| + Buildr.projects.map(&:compile).map(&:sources).flatten.each do |src| ant.fileset :dir=>src.to_s if File.exist?(src.to_s) end end end end