Wesley Hartford
10/20/2023, 10:13 PM./gradlew build dokkaHtml
I get an error from gradle which I interpret as meaning that dokka is generating documentation from generated code without the appropriate task dependency being declared:
> Task :metrics:kaptKotlin FAILED
FAILURE: Build failed with an exception.
* What went wrong:
A problem was found with the configuration of task ':metrics:kaptKotlin' (type 'KaptWithoutKotlincTask').
- Gradle detected a problem with the following location: '[redacted]/metrics/build/tmp/kapt3/classes/main'.
Reason: Task ':metrics:dokkaHtml' uses this output of task ':metrics:kaptKotlin' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
Possible solutions:
1. Declare task ':metrics:kaptKotlin' as an input of ':metrics:dokkaHtml'.
2. Declare an explicit dependency on ':metrics:kaptKotlin' from ':metrics:dokkaHtml' using Task#dependsOn.
3. Declare an explicit dependency on ':metrics:kaptKotlin' from ':metrics:dokkaHtml' using Task#mustRunAfter.
For more information, please refer to <https://docs.gradle.org/8.3/userguide/validation_problems.html#implicit_dependency> in the Gradle documentation.
I can work around this by declaring a dependency as described in the error message, but I think my preference would be for dokka to ignore generated code. Has anyone run into a similar problem? Any advice? Thanks.Ignat Beresnev
10/26/2023, 9:20 AMsuppressGeneratedFiles
, which is set to true
by default. It ignores generated files from build/generated
, but it's implementation is that it adds these files to the suppressedFiles
option, so it effectively still knows about them and it might be causing the undeclared dependency - this is just a guess though.
We're unlikely to fix it for the current Dokka Gradle plugin as we're focusing on the new plugin which will address this and other problems, so the best bet is to find a suitable local workaround for now. Sorry for the inconvenience.Wesley Hartford
10/26/2023, 2:54 PM