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/java/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
You can also specify the top level directory to which the top level cobertura tasks will generate reports by setting the value of the Buildr::Cobertura.report_dir
configuration parameter.
Defined Under Namespace
Modules: CoberturaExtension Classes: CoberturaCheck, CoberturaConfig
Constant Summary collapse
- VERSION =
'1.9.4.1'
- REQUIRES =
ArtifactNamespace.for(self).tap do |ns| ns.cobertura! "net.sourceforge.cobertura:cobertura:jar:#{version}", '>=1.9' ns.log4j! 'log4j:log4j:jar:1.2.9', ">=1.2.9" ns.asm! 'asm:asm:jar:2.2.1', '>=2.2.1' ns.asm_tree! 'asm:asm-tree:jar:2.2.1', '>=2.2.1' ns.oro! 'oro:oro:jar:2.0.8', '>=2.0.8' end
Class Attribute Summary collapse
Class Method Summary collapse
Class Attribute Details
.report_dir ⇒ Object
70 71 72 |
# File 'lib/buildr/java/cobertura.rb', line 70 def report_dir @report_dir || "reports/cobertura" end |
Class Method Details
.data_file ⇒ Object
78 79 80 |
# File 'lib/buildr/java/cobertura.rb', line 78 def data_file File.("#{report_dir}.ser") end |
.dependencies ⇒ Object
60 61 62 63 64 65 66 |
# File 'lib/buildr/java/cobertura.rb', line 60 def dependencies if (VersionRequirement.create('>=1.9.1').satisfied_by?(REQUIRES.cobertura.version)) [:asm, :asm_tree].each { |s| REQUIRES[s] = '3.0' unless REQUIRES[s].selected? } end REQUIRES.artifacts end |
.report_to(file = nil) ⇒ Object
74 75 76 |
# File 'lib/buildr/java/cobertura.rb', line 74 def report_to(file = nil) File.(File.join(*[report_dir, file.to_s].compact)) end |