title: How to create xml report of JaCoCo with Gradle
body: <p>I have Android project.<br>
  And I am trying to use JaCoCo code coverage with Gradle.   </p>
  
  <p>This is my JaCoCo configuration:</p>
  
  <pre><code>apply plugin: 'jacoco'
  
  project.afterEvaluate {
  
  def buildTypes = android.buildTypes.collect { type -&gt; type.name }
  def productFlavors = android.productFlavors.collect { flavor -&gt; flavor.name }
  
  if (!productFlavors) productFlavors.add('')
  productFlavors.each { productFlavorName -&gt; buildTypes.each {
                        buildTypeName -&gt; def sourceName, sourcePath
                        if (!productFlavorName) {
                        sourceName = sourcePath = "${buildTypeName}" }
  else {
  sourceName = "${productFlavorName}${buildTypeName.capitalize()}"
  sourcePath = "${productFlavorName}/${buildTypeName}"
  }
  
  def testTaskName = "test${sourceName.capitalize()}UnitTest"
  
  task "${testTaskName}Coverage" (type:JacocoReport, dependsOn: "$testTaskName") {
        group = "Reporting"
        description = "Generate Jacoco coverage reports on the ${sourceName.capitalize()} build."
        classDirectories = fileTree(
            dir: "${project.buildDir}/intermediates/classes/${sourcePath}",
            excludes: [
               '**/R.class',
               '**/R$*.class',
               '**/*$ViewInjector*.*',
               '**/*$ViewBinder*.*',
               '**/BuildConfig.*',
               '**/Manifest*.*'
            ]
        )
        def coverageSourceDirs = [
            "src/main/java",
            "src/$productFlavorName/java",
            "src/$buildTypeName/java"
       ]
           additionalSourceDirs = files(coverageSourceDirs)
           sourceDirectories = files(coverageSourceDirs)
           executionData = files("${project.buildDir}/jacoco/${testTaskName}.exec")
           reports {
              xml.enabled = true
              html.enabled = true
          }
        }
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>But it generates only <code>.exec</code> files, <strong>there are no xml or html</strong>.</p>
  
  <p><strong>What am I missing?</strong> Are this lines not enough?</p>
  
  <pre><code>executionData = files("${project.buildDir}/jacoco/${testTaskName}.exec")
           reports {
              xml.enabled = true
              html.enabled = true
          }
  </code></pre>