Skip to content

Commit

Permalink
Add validation for missing JaCoCo test report tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
azizutku committed Nov 8, 2023
1 parent ca927df commit 2e7891c
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,17 @@ internal class JacocoAggregateCoveragePlugin : Plugin<Project> {
project.layout.buildDirectory.dir(PLUGIN_OUTPUT_PATH)
)
val jacocoTestReportTasks = getJacocoTestReportTasks(project, pluginExtension)
if (jacocoTestReportTasks.isEmpty()) {
val jacocoTestReportTask = pluginExtension.jacocoTestReportTask.get()
project.logger.error(
"""
There are no tasks named '$jacocoTestReportTask' in your project. Please
ensure that you set the `jacocoTestReportTask` property in the plugin
extension to the name of the task you use to generate JaCoCo test reports.
""".trimIndent()
)
return@configure
}
copyReportsTaskProvider.get().mustRunAfter(jacocoTestReportTasks)
dependsOn(copyReportsTaskProvider)
dependsOn(jacocoTestReportTasks)
Expand Down

0 comments on commit 2e7891c

Please sign in to comment.