How to configure Dokka for a root project and a child project

188 views Asked by At

I have attempted to follow the documentation at https://kotlinlang.org/docs/dokka-gradle.html#multi-project-configuration, but I am not getting the results I want. To start with, my project is set up as:

.
├── build.gradle
├── settings.gradle
├── packages.md
└── src
   └── main
      └── kotlin
          └── HelloFromA.kt
├── subproject-B
    ├── build.gradle
    ├── packages.md
    └── src
        └── main
            └── kotlin
                └── HelloFromB.kt

Which does not appear to be a case covered in the Dokka documentation. I am trying to get documentation for both the root and child projects to build. Here's the relevant code in the root build.gradle file.

    allprojects {
        apply plugin: 'org.jetbrains.dokka'

        // configure all format tasks at once
        tasks.withType(DokkaTaskPartial.class).configureEach {
            dokkaSourceSets.configureEach {
                includes.from("packages.md")
            }
        }

    }
    tasks.withType(DokkaTask.class).configureEach {
        dokkaSourceSets.configureEach {
            documentedVisibilities.set([
                Visibility.PUBLIC,
                Visibility.PRIVATE,
                Visibility.PROTECTED,
                Visibility.INTERNAL,
                Visibility.PACKAGE // for java
            ])
        }
    }

When I run dokkaHtmlMultiModule, the generated HTML only contains documentation for the child package. I would like HTML documentation that contains either both the root and the child, or if that is not possible, HTML documentation for the root and the child in separate webpages.

0

There are 0 answers