buildr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject svn commit: r1189100 - in /buildr/trunk: CHANGELOG lib/buildr/java/cobertura.rb
Date Wed, 26 Oct 2011 09:54:57 GMT
Author: donaldp
Date: Wed Oct 26 09:54:56 2011
New Revision: 1189100

URL: http://svn.apache.org/viewvc?rev=1189100&view=rev
Log:
Parameterize the the directory where the top level cobertura tasks will generate reports.
Specify using Buildr::Cobertura.report_dir = '....'

Modified:
    buildr/trunk/CHANGELOG
    buildr/trunk/lib/buildr/java/cobertura.rb

Modified: buildr/trunk/CHANGELOG
URL: http://svn.apache.org/viewvc/buildr/trunk/CHANGELOG?rev=1189100&r1=1189099&r2=1189100&view=diff
==============================================================================
--- buildr/trunk/CHANGELOG (original)
+++ buildr/trunk/CHANGELOG Wed Oct 26 09:54:56 2011
@@ -1,4 +1,6 @@
 1.4.7 (Pending)
+* Change: Parameterize the the directory where the top level cobertura tasks will generate
+          reports. Specify using Buildr::Cobertura.report_dir = '....'
 * Fixed:  BUILDR-611 Buildr should not unnecessarily recompile Java files
           explicitly added to compile.from
 * Added:  ScalaTest now automatically loads the Mockito library

Modified: buildr/trunk/lib/buildr/java/cobertura.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/java/cobertura.rb?rev=1189100&r1=1189099&r2=1189100&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/java/cobertura.rb (original)
+++ buildr/trunk/lib/buildr/java/cobertura.rb Wed Oct 26 09:54:56 2011
@@ -34,6 +34,10 @@ module Buildr
   #      cobertura.exclude /*.Const(ants)?/i
   #   end
   #
+  # You can also specify the top level directory to which the top level cobertura tasks
+  # will generate reports by setting the value of the <code>Buildr::Cobertura.report_dir</code>
+  # configuration parameter.
+  #
   module Cobertura
 
     VERSION = '1.9.4.1'
@@ -61,12 +65,18 @@ module Buildr
         REQUIRES.artifacts
       end
 
+      attr_writer :report_dir
+
+      def report_dir
+        @report_dir || "reports/cobertura"
+      end
+
       def report_to(file = nil)
-        File.expand_path(File.join(*["reports/cobertura", file.to_s].compact))
+        File.expand_path(File.join(*[report_dir, file.to_s].compact))
       end
 
-      def data_file()
-        File.expand_path("reports/cobertura.ser")
+      def data_file
+        File.expand_path("#{report_dir}/cobertura.ser")
       end
 
     end



Mime
View raw message