4

I want to use cobertura in my gradle build so I created task in this way:

ant.typedef(resource: 'tasks.properties', classpath:configurations.cobertura.asPath)

And now I want to run cobertura-instrument. The problem is that I don't know how to run this task because ant.cobertura-instrument(...) won't work. Is there some other way to run it? For example something like this ant.tasks['cobertura-instrument'](...)

pepuch
  • 6,346
  • 7
  • 51
  • 84

2 Answers2

7

You can also use the task like this ant."cobertura-instrument"(...).

Benjamin Muschko
  • 32,442
  • 9
  • 61
  • 82
1

Problem solved

Ant task name can be changed using name argument. For cobertura-instrument it looks like this:

ant.typedef(classname:'net.sourceforge.cobertura.ant.InstrumentTask', name:'coberturaInstrument', classpath:configurations.cobertura.asPath)

so task can be usd in this way:

ant.coberturaInstrument(...)
pepuch
  • 6,346
  • 7
  • 51
  • 84