Why do we need the dependency on jar file in `gene...
# detekt
v
Why do we need the dependency on jar file in
generateDocumentation
task? https://github.com/detekt/detekt/blob/59bedc9eeda131b404dda44330e5cf4645e81fa1/detekt-generator/build.gradle.kts#L46
Copy code
file("${rootProject.rootDir}/detekt-generator/build/libs/detekt-generator-${Versions.DETEKT}-all.jar"),
b
🤔 to generateDocumentation we need that jar compiled, right? I mean,
generateDocumentation
basically executes that jar to do its job.
v
I'm afraid not
It is the dependency on input file
b
And it is an input dependecy. Isn't it? I mean, you need that file to make
generateDocumentation
work. And it that jar changes you should re-execute
generateDocumentation
because the output could change. (Probably I'm missing something here, what's the problem with that line?)
v
There's no problem, just curious. I don't understand how it works. Would something bad happen if I remove the dependency?
b
Yes. You can test it yourself: • remove it • run
./gradlew generateDocumentation
• change something inside :detekt-generator that forces a change inside
detekt-default-config.yml
• run
./gradlew generateDocumentation
<- This task should be UP-TO-DATE and the expected change inside
detekt-default-config.yml
should not be applied.
(at least that's what I expect)
v
thanks for explanation, I'll make an experiment :)
But you know, there was no
detekt-generator-all.jar
file before (it is me who added that file and you helped me with that). And everything worked fine. 🙄
b
No idea for how long that line is there...
v
From the very beginning. I tracked git history till the end 🙂