Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dokka fails after encountering an empty subproject #3494

Closed
Laxystem opened this issue Feb 11, 2024 · 2 comments
Closed

Dokka fails after encountering an empty subproject #3494

Laxystem opened this issue Feb 11, 2024 · 2 comments
Labels

Comments

@Laxystem
Copy link

Describe the bug
When declaring a gradle project like this:

// settings.gradle.kts
include("api:common")

Dokka will try to generate documentation for api, and fail.

Expected behaviour
Dokka will skip api.
Screenshots

> Task :api:dokkaHtmlMultiModule FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Some problems were found with the configuration of task ':api:dokkaHtmlMultiModule' (type 'DokkaMultiModuleTask').
  - Gradle detected a problem with the following location: '/home/laxystem/Projects/Gimli/api/client/build/dokka/htmlPartial'.
    
    Reason: Task ':api:dokkaHtmlMultiModule' uses this output of task ':dokkaHtmlMultiModule' 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 ':dokkaHtmlMultiModule' as an input of ':api:dokkaHtmlMultiModule'.
      2. Declare an explicit dependency on ':dokkaHtmlMultiModule' from ':api:dokkaHtmlMultiModule' using Task#dependsOn.
      3. Declare an explicit dependency on ':dokkaHtmlMultiModule' from ':api:dokkaHtmlMultiModule' using Task#mustRunAfter.
    
    For more information, please refer to https://docs.gradle.org/8.6/userguide/validation_problems.html#implicit_dependency in the Gradle documentation.
  - Gradle detected a problem with the following location: '/home/laxystem/Projects/Gimli/api/common/build/dokka/htmlPartial'.
    
    Reason: Task ':api:dokkaHtmlMultiModule' uses this output of task ':dokkaHtmlMultiModule' 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 ':dokkaHtmlMultiModule' as an input of ':api:dokkaHtmlMultiModule'.
      2. Declare an explicit dependency on ':dokkaHtmlMultiModule' from ':api:dokkaHtmlMultiModule' using Task#dependsOn.
      3. Declare an explicit dependency on ':dokkaHtmlMultiModule' from ':api:dokkaHtmlMultiModule' using Task#mustRunAfter.
    
    For more information, please refer to https://docs.gradle.org/8.6/userguide/validation_problems.html#implicit_dependency in the Gradle documentation.
  - Gradle detected a problem with the following location: '/home/laxystem/Projects/Gimli/api/server/build/dokka/htmlPartial'.
    
    Reason: Task ':api:dokkaHtmlMultiModule' uses this output of task ':dokkaHtmlMultiModule' 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 ':dokkaHtmlMultiModule' as an input of ':api:dokkaHtmlMultiModule'.
      2. Declare an explicit dependency on ':dokkaHtmlMultiModule' from ':api:dokkaHtmlMultiModule' using Task#dependsOn.
      3. Declare an explicit dependency on ':dokkaHtmlMultiModule' from ':api:dokkaHtmlMultiModule' using Task#mustRunAfter.
    
    For more information, please refer to https://docs.gradle.org/8.6/userguide/validation_problems.html#implicit_dependency in the Gradle documentation.

To Reproduce
There's a sample project on codeberg.

Dokka configuration

none yet

Installation

  • Operating system: Linux
  • Build tool: Gradle v6.8.0
  • Dokka version: 1.9.10
@Laxystem Laxystem added the bug label Feb 11, 2024
@Laxystem
Copy link
Author

Laxystem commented Feb 11, 2024

Found workaround.

plugins {
    kotlin("multiplatform")
    id("org.jetbrains.dokka")
}

// top-level build.gradle.kts
allprojects {
    subprojects.forEach {
        if (it.subprojects.isNotEmpty()) tasks.dokkaHtmlMultiModule {
            dependsOn(it.tasks.dokkaHtmlMultiModule)
        }
    }
}

I was wrong, this happens because dokka doesn't know what should depend on what.

@vmishenev
Copy link
Member

It looks like a duplication of #2954

Found workaround.

Yes, it is a possible solution.
There is also a simpler workaround #2954 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants