Open ZacSweers opened 3 years ago
Haven't got time to check that yet, but are you sure that this is not a problem on your side? The fragment
'moshi-metadata-reflect:javadocsJar' uses this output of task ':moshi-adapters:dokkaHtml' without declaring an explicit or implicit dependency.
indicates that you have a task called javadocsJar
that has a definition like (I'm guessing):
task javadocsJar {
from(dokkaHtml.outputDir)
}
while it should have a dependsOn
also:
task javadocsJar {
dependsOn(dokkaHtml)
from(dokkaHtml.outputDir)
}
The only thing that could be setting them is this plugin, which does set explicit dependencies: https://github.com/vanniktech/gradle-maven-publish-plugin/blob/0.14.2/src/main/kotlin/com/vanniktech/maven/publish/tasks/JavadocsJar.kt
This looks like a wider issue with Dokka reading outputs from tasks in a generic way. Here is the same issue but using generated code from another plugin (Wire)
- Gradle detected a problem with the following location: '/home/runner/work/slack-gradle-plugin/slack-gradle-plugin/slack-plugin/build/generated/source/wire'. Reason: Task ':slack-plugin:dokkaHtml' uses this output of task ':slack-plugin:generateMainProtos' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to docs.gradle.org/7.0/userguide/validation_problems.html#implicit_dependency for more details about this problem.
Hi all. Is there some flag to break the build if gradle detects a problem?
Thank you in advance
UPDATE: Answer found ./gradlew build --warning-mode=fail
This looks like a wider issue with Dokka reading outputs from tasks in a generic way. Here is the same issue but using generated code from another plugin (Wire)
- Gradle detected a problem with the following location: '/home/runner/work/slack-gradle-plugin/slack-gradle-plugin/slack-plugin/build/generated/source/wire'. Reason: Task ':slack-plugin:dokkaHtml' uses this output of task ':slack-plugin:generateMainProtos' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to docs.gradle.org/7.0/userguide/validation_problems.html#implicit_dependency for more details about this problem.
Hi @ZacSweers , How did you solved this issue?
I got this error when I replaced dependsOn
with .mustRunAfter
. It was needed for other task to fix error "Cannot change dependencies of dependency configuration after it has been resolved." after downgrading to Gradle plugin 7.2.2
Describe the bug Gradle 7.0 reports this issue for multiple dokka tasks
Expected behaviour
Dokka should not have gradle issues
Screenshots
N/A
To Reproduce Run Dokka with Gradle 7.0
Here's an example: https://github.com/ZacSweers/MoshiX/runs/2310971282
Dokka configuration Configuration of dokka used to reproduce the bug
Installation
Additional context None