net.twisterrob.gradle.quality.gather.TaskReportGatherer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of twister-quality Show documentation
Show all versions of twister-quality Show documentation
All quality plugins bundled in one.
The newest version!
package net.twisterrob.gradle.quality.gather
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.tasks.TaskCollection
import se.bjurr.violations.lib.model.Violation
import java.io.File
abstract class TaskReportGatherer(
private val taskType: Class
) where T : Task {
abstract fun getParsableReportLocation(task: T): File
abstract fun getHumanReportLocation(task: T): File
abstract fun getName(task: T): String
abstract fun getDisplayName(task: T): String
fun getViolations(task: T): List? {
val report = getParsableReportLocation(task)
return if (report.exists()) {
findViolations(report)
} else {
//println("${this} > report '${report}' does not exist.")
null
}
}
abstract fun findViolations(report: File): List
open fun allTasksFrom(project: Project): TaskCollection =
project.tasks.withType(taskType)
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy