Module: Buildr::Emma

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

Overview

Provides the emma:html and emma:xml tasks. Require explicitly using require "buildr/emma".

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

project_name:emma:html

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

define 'someModule' do 
   emma.include 'some.package.*'
   emma.exclude 'some.foo.util.SimpleUtil'
end

Defined Under Namespace

Modules: EmmaExtension Classes: EmmaConfig

Constant Summary collapse

VERSION =
'2.0.5312'

Class Method Summary collapse

Class Method Details

.antObject



60
61
62
63
64
65
66
67
68
69
# File 'lib/buildr/java/emma.rb', line 60

def ant
  
  Buildr.ant 'emma' do |ant|
    ant.taskdef :resource=>'emma_ant.properties',
      :classpath=>Buildr.artifacts(dependencies).each(&:invoke).map(&:to_s).join(File::PATH_SEPARATOR)
    ant.emma :verbosity=>(Buildr.application.options.trace ? 'verbose' : 'warning') do
      yield ant
    end
  end
end

.data_fileObject



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

def data_file()
  File.join(report_to, 'coverage.es')
end

.dependenciesObject



48
49
50
# File 'lib/buildr/java/emma.rb', line 48

def dependencies
  @dependencies ||= ["emma:emma_ant:jar:#{version}", "emma:emma:jar:#{version}"]
end

.report_to(format = nil) ⇒ Object



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

def report_to format=nil
  File.expand_path('reports/emma')
end

.versionObject



44
45
46
# File 'lib/buildr/java/emma.rb', line 44

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