title: Gradle | Jacoco Task | test report
body: <p>In some blog, I found below task to generate the jacoco report:</p>
  
  <pre><code>task jacocoTestReport(type: JacocoReport, dependsOn: "testDebugUnitTest") {
      group = "Verification"
      description = "Generate Jacoco coverage reports after running tests."
      reports {
          xml.enabled = true
          html.enabled = true
      }
  
      classDirectories = fileTree(
          dir: "${project.buildDir}/intermediates/classes/debug",
          excludes: ['**/R.class', 
                     '**/R$*.class', 
                     '**/BuildConfig.*', 
                     '**/Manifest*.*', 
                     'android/**/*.*'
          ])
  
      additionalSourceDirs = files(coverageSourceDirs)
      sourceDirectories = files(coverageSourceDirs)
      executionData = files('build/jacoco/testDebugUnitTest.exec')
  }
  </code></pre>
  
  <p>I am new to Gradle and I want to understand each step of this task in detail. Below are my queries:</p>
  
  <ol>
  <li><p>What is the functionality of <strong>dependsOn: "testDebugUnitTest"</strong>  while creating a new task? Even if I don't put this statement, still I am able to generate the report.</p></li>
  <li><p>What is testDebugUnitTest? How &amp; where it's generated?</p></li>
  <li><p>What is the difference between the pattern </p>
  
  <p>' * * /R.class' and  ' * * /R$*.class'</p>
  
  <p>Both are excluding the R files from report then what is the difference?</p></li>
  <li><p>Why different pattern for R class and Android classes? </p>
  
  <p>'* * /R.class' vs 'android/* * /* . * '</p></li>
  <li><p>What is the difference between additionalSourceDirs &amp; source directories? As per the documentation, description is same for both </p></li>
  </ol>
  
  <blockquote>
    <p>Source sets that coverage should be reported for.</p>
  </blockquote>
  
  <ol start="6">
  <li>What is <strong>executionData</strong>  &amp; <strong>testDebugUnitTest.exec</strong>? Is testDebugUnitTest.exec autogeenerated and why we need to mention this ?</li>
  </ol>