Skip to content

Commit

Permalink
detektGenerateConfig adds the configuration of plugins (#4844)
Browse files Browse the repository at this point in the history
  • Loading branch information
BraisGabin committed May 22, 2022
1 parent 486c894 commit a066c7f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Expand Up @@ -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)
Expand Down Expand Up @@ -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,
)
}
Expand Down
Expand Up @@ -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))
}
}

Expand Down

0 comments on commit a066c7f

Please sign in to comment.