detektGenerateConfig adds the configuration of plugins (#4844)

This commit is contained in:
Brais Gabín
2022-05-22 17:56:22 +02:00
committed by GitHub
parent 486c894a9e
commit a066c7fe18
2 changed files with 5 additions and 1 deletions

View File

@@ -36,6 +36,9 @@ open class DetektGenerateConfigTask @Inject constructor(
@get:Classpath
val detektClasspath: ConfigurableFileCollection = project.objects.fileCollection()
@get:Classpath
val pluginClasspath: ConfigurableFileCollection = objects.fileCollection()
@get:InputFiles
@get:Optional
@get:PathSensitive(PathSensitivity.RELATIVE)
@@ -70,7 +73,7 @@ open class DetektGenerateConfigTask @Inject constructor(
DetektInvoker.create(task = this, isDryRun = isDryRun).invokeCli(
arguments = arguments.get(),
classpath = detektClasspath,
classpath = detektClasspath.plus(pluginClasspath),
taskName = name,
)
}

View File

@@ -97,6 +97,7 @@ class DetektPlugin : Plugin<Project> {
project.tasks.withType(DetektGenerateConfigTask::class.java).configureEach {
it.detektClasspath.setFrom(project.configurations.getAt(CONFIGURATION_DETEKT))
it.pluginClasspath.setFrom(project.configurations.getAt(CONFIGURATION_DETEKT_PLUGINS))
}
}