mirror of
https://github.com/jlengrand/detekt.git
synced 2026-03-10 08:11:23 +00:00
detektGenerateConfig adds the configuration of plugins (#4844)
This commit is contained in:
@@ -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,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user