com.netflix.nebula.lint.plugin.GradleSevenZeroLintPluginTaskConfigurer.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gradle-lint-plugin Show documentation
Show all versions of gradle-lint-plugin Show documentation
Pluggable and configurable linter tool for identifying and reporting on patterns of misuse or deprecations in Gradle scripts
package com.netflix.nebula.lint.plugin
import org.gradle.api.Action
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.execution.TaskExecutionListener
import org.gradle.api.plugins.JavaBasePlugin
import org.gradle.api.tasks.TaskProvider
import org.gradle.api.tasks.TaskState
import org.gradle.api.tasks.compile.AbstractCompile
class GradleSevenZeroLintPluginTaskConfigurer extends GradleLintPluginTaskConfigurer{
@Override
Action configureReportAction(Project project, GradleLintExtension extension) {
new Action() {
@Override
void execute(GradleLintReportTask gradleLintReportTask) {
gradleLintReportTask.reportOnlyFixableViolations.set(getReportOnlyFixableViolations(project, extension))
gradleLintReportTask.reports.all { report ->
report.conventionMapping.with {
enabled = { report.name == getReportFormat(project, extension) }
destination = {
def fileSuffix = report.name == 'text' ? 'txt' : report.name
new File(project.layout.buildDirectory.asFile.get(), "reports/gradleLint/${project.name}.$fileSuffix")
}
}
}
}
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy