title: Remove some java files from jacoco test coverage using gradle
body: <p>I want to exclude some source files in Jacaco Test coverage report.For other generated code I have done like this:</p>
  
  <pre><code>classDirectories = fileTree(
              dir: "${project.buildDir}/intermediates/classes/debug/com",
              excludes: [
                      '**/R.class',
                      '**/R$*.class']
                      )  
  </code></pre>
  
  <p>But for excluding Java files when I am trying to do like this: </p>
  
  <pre><code>   dir: "${project.buildDir}/intermediates/classes/debug/com",
              excludes: [
                   'src//java/com/example/application/Constants.java'] 
  </code></pre>
  
  <p>have also tried like this:  <code>'**/application/Constants.class'</code>.It doesn't work. Do I need to include the path here:  <code>dir: "${project.buildDir}/intermediates/classes/debug/com"</code>? </p>
  
  <p>I am using Android studio 3.0 (i don't think it matters here). Full code that I am trying:</p>
  
  <pre><code>task jacocoTestReport(type: JacocoReport) {
          group = "Reporting"
          description = "Generate Jacoco coverage reports"
          reports {
              xml.enabled = true
              html.enabled = true
          }
  
   sourceDirectories = files(sourceSets)
  
   classDirectories = fileTree(
              dir: "${project.buildDir}/intermediates/classes/debug/com",
              excludes: [
                      'src//java/com/example/application/Constants.java',     //this is not working
                      '**/R.class',
                      '**/R$*.class',
                      '**/BuildConfig.*',
                      '**/Manifest*.*',
                      '**/*$ViewInjector*.*',
                      '**/*$ViewBinder*.*',
                      '**/*$Lambda$*.*', // Jacoco can not handle several "$" in class name.
                      '**/*Module.*', // Modules for Dagger.
                      '**/*Dagger*.*', // Dagger auto-generated code.
                      '**/*MembersInjector*.*', // Dagger auto-generated code.
                      '**/*_Provide*Factory*.*',
                      '**/*_Factory.*', //Dagger auto-generated code
                      '**/*$*$*.*', // Anonymous classes generated by kotlin
                      //add libraries
                      'android/**/*.*',
                      'com/**/*.*',
                      'uk/**/*.*',
                      'io/**/*.*',
                      //remove what we don't test
                      'androidTest/**/*.*',
                      'test/**/*.*',
                      '**/injector/**/*.*',
                      '**/model/**/*.*',
                      '**/mock/**/*.*',
                      '**/event/**/*.*',
                      '**/**_ViewBinding**',
                      '**/*EventType.*',
                      '**/**Mocked'
              ]
  
      )
      executionData = fileTree(dir: 'build/jacoco', include: '**/*.exec')
  
  }
  </code></pre>