Skip to content

Commit 1b1f716

Browse files
authored
Remove: some unnecessary code (#55)
- Applying the the JacocoPlugin within addSubProjectInternal() is duplicate code, since this check is already done in addSubProject(). - logJacocoHasBeenApplied() is also no longer needed, since this plugin should no longer warn users about JaCoCo being applied.
1 parent 0b28266 commit 1b1f716

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

plugin/src/main/kotlin/org/neotech/plugin/rootcoverage/RootCoveragePlugin.kt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,6 @@ class RootCoveragePlugin : Plugin<Project> {
153153
androidComponents.onVariants { variant ->
154154
val buildType = buildTypes.find { it.name == variant.buildType }!!
155155
if (buildType.isTestCoverageEnabled && variant.name.replaceFirstChar(Char::titlecase) == buildVariant.replaceFirstChar(Char::titlecase)) {
156-
if (subProject.plugins.withType(JacocoPlugin::class.java).isEmpty()) {
157-
subProject.plugins.apply(JacocoPlugin::class.java)
158-
subProject.logJacocoHasBeenApplied()
159-
}
160156
addSubProjectVariant(subProject, variant)
161157
}
162158
}
@@ -220,11 +216,5 @@ class RootCoveragePlugin : Plugin<Project> {
220216
}
221217
}
222218
}
223-
224-
private fun Project.logJacocoHasBeenApplied() {
225-
project.logger.info(
226-
"Note: Jacoco plugin was not found for project '${project.name}', it has been applied automatically: ${project.buildFile}"
227-
)
228-
}
229219
}
230220

0 commit comments

Comments
 (0)