I’m using detekt gradle plugin with type resolutio...
# detekt
s
I’m using detekt gradle plugin with type resolution. With detekt type resolution, I think
detektMain
task should dependsOn some tasks like
compileKotlin
to leverage already compiled results. But in source code,
detektMain
do not depends on any task regarding kotlin compiler. Is this intented behavior? then how detekt gradle plugin can get compiled kotlin result?
g
Yes it’s the intended behavior. We use
kotlin-compiler-embeddable
to run a compilation inside detekt. What you’re looking for is the detekt compiler plugin which will run during the
compileKotlin
task.
s
Thanks for the answer 😸 Then I have another question, Depending gradle detekt task (with type resolution) on a task like
compileKotlin
to guarantee the existence of build-time generated kotlin files (like grpc stubs) is recommended usage? If this recommended, what do you think about adding explicit dependency to
compileKotlin
on detekt gradle tasks with type resolution?
a
@sanggggg I think there is also an option of adding more class path for detekt run. I think you can add the new generated classpaths