Module: Buildr::Cobertura

Defined in:
lib/buildr/java/cobertura.rb

Overview

Provides the cobertura:html, cobertura:xml and cobertura:check tasks. Require explicitly using require "buildr/cobertura".

You can generate cobertura reports for a single project using the project name as prefix:

project_name:cobertura:html

You can also specify which classes to include/exclude from instrumentation by passing a class name regexp to the cobertura.include or cobertura.exclude methods.

define 'someModule' do 
   cobertura.include 'some.package.*'
   cobertura.include /some.(foo|bar).*/
   cobertura.exclude 'some.foo.util.SimpleUtil'
   cobertura.exclude /*.Const(ants)?/i
end

Defined Under Namespace

Modules: CoberturaExtension Classes: CoberturaCheck, CoberturaConfig

Constant Summary collapse

VERSION =
'1.9'

Class Method Summary collapse

Class Method Details

.data_fileObject



60
61
62
# File 'lib/buildr/java/cobertura.rb', line 60

def data_file()
  File.expand_path("reports/cobertura.ser")
end

.dependenciesObject



51
52
53
54
# File 'lib/buildr/java/cobertura.rb', line 51

def dependencies
  @dependencies ||= [ "net.sourceforge.cobertura:cobertura:jar:#{version}", "log4j:log4j:jar:1.2.9",
                      "asm:asm:jar:2.2.1", "asm:asm-tree:jar:2.2.1", "oro:oro:jar:2.0.8"]
end

.report_to(file = nil) ⇒ Object



56
57
58
# File 'lib/buildr/java/cobertura.rb', line 56

def report_to(file = nil)
  File.expand_path(File.join(*["reports/cobertura", file.to_s].compact))
end

.versionObject



47
48
49
# File 'lib/buildr/java/cobertura.rb', line 47

def version
  Buildr.settings.build['cobertura'] || VERSION
end