Hi folks, im having trouble to generate docs for p...
# dokka
g
Hi folks, im having trouble to generate docs for project which mixes java and kotlin. It seems it only generates docs for java files only, im using maven. (i will post plugin config in thread). Thanks in advance for any help !
Copy code
<plugin>
    <groupId>org.jetbrains.dokka</groupId>
    <artifactId>dokka-maven-plugin</artifactId>
    <version>${dokka.version}</version>
    <executions>
        <execution>
            <phase>pre-site</phase>
            <goals>
                <goal>dokka</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <dokkaPlugins>
            <plugin>
                <groupId>org.jetbrains.dokka</groupId>
                <artifactId>kotlin-as-java-plugin</artifactId>
                <version>${dokka.version}</version>
            </plugin>
        </dokkaPlugins>

        <!-- Dokka configuration -->
        <moduleName>Csp</moduleName>

        <sourceDirectories>
            <dir>src/main/java/org/whispersystems/textsecuregcm/imahub/controllers/</dir>
            <dir>src/main/java/org/whispersystems/textsecuregcm/controllers/</dir>
        </sourceDirectories>
        <sourceLinks>
            <Link>
                <path>${project.basedir}/src/main/java/org/whispersystems/textsecuregcm</path>
                <url>
                    <https://gitlab.com/IMA-HUB/csp-server/-/tree/main/service/src/main/java/org/whispersystems/textsecuregcm>
                </url>
            </Link>
        </sourceLinks>

        <skipDeprecated>true</skipDeprecated>

        <reportUndocumented>false</reportUndocumented>

        <skipEmptyPackages>true</skipEmptyPackages>

        <noStdlibLink>true</noStdlibLink>

        <noJdkLink>true</noJdkLink>

    </configuration>
</plugin>
dokka version
1.7.20
v
Copy code
<sourceDirectories>
            <dir>src/main/java/org/whispersystems/textsecuregcm/imahub/controllers/</dir>
            <dir>src/main/java/org/whispersystems/textsecuregcm/controllers/</dir>
        </sourceDirectories>
Are you sure you have source directories for Kotlin?
g
no i don't have separate source dir for kotlin. I have kt files in
***/imahub/***
path.
v
Do you use
kotlin-as-java-plugin
plugin intentionally?
g
no, i pretty much followed the guide. I figured im ok with just dokka-base plugin
It is necessary to have kt files in a separate sourceDir?
🚫 1
v
Ok, dokka-base plugin is applied by default. So you can remove
Copy code
<dokkaPlugins>
            <plugin>
                <groupId>org.jetbrains.dokka</groupId>
                <artifactId>kotlin-as-java-plugin</artifactId>
                <version>${dokka.version}</version>
            </plugin>
        </dokkaPlugins>
👌 1