title: JaCoCo with Gradle Kotlin multi-module Android project - what does isTestCoverageEnabled actually do?
body: <p>I'm configuring an Android multi-module Gradle project that uses Kotlin for both the app AND the Gradle build files (gradle.build.kts).</p>
  <p>I'm using Gradle 7.3.3.</p>
  <p>First I add the Jacoco plugin to the module-level build.gradle.kts:</p>
  <pre><code>...
  plugins {
      ...
      jacoco
  }
  ...
  </code></pre>
  <p>Then I click the icon in Android Studio to &quot;sync project with gradle files.&quot;</p>
  <p>Next, I find the debug build type and add this:</p>
  <p><code>isTestCoverageEnabled = true</code></p>
  <p>When I subsequently run <code>./gradlew testDebugUnitTest</code>, a file is generated in the module at <code>&lt;MODULE&gt;/build/outputs/unit_test_code_coverage/debugUnitTest/testDebugUnitTest.exec</code>.</p>
  <p>If, however, I don't add the line <code>isTestCoverageEnabled = true</code>, or if I set <code>isTestCoverageEnabled = false</code>, a coverage results file is generated in the module at <code>&lt;MODULE&gt;/build/jacoco/testDebugUnitTest.exec</code>.</p>
  <p>When I generate each .exec file's HTML report, the &quot;Total&quot; rows at the bottom have matching counts.</p>
  <p>Are these two files equivalent, but just located in different directories depending on the value of <code>isTestCoverageEnabled</code>?</p>
  <p>If so, it seems that, as long as jacoco is included in the plugins, coverage results are generated regardless of whether the <code>isTestCoverageEnabled = true</code> line is added. Does <code>isTestCoverageEnabled</code> do anything else besides change the output directory? What am I missing?</p>