Cheolho Jeon
03/23/2021, 7:16 AMonly .kt files
?
I'm trying to do this because we are currently trying to migrate to Kotlin from Java (android) and found that Javadoc HTML created by Dokka does not have 1. @since
information (reported at Github) 2. and failed to find a way to insert headers, footers, etc. to Dokka configs (like mentioned here).
Hence if we built all our sources (java
+ kt
) using Dokka we will be losing some information we currently have. So instead we are considering building only .kt
files using Dokka to minimize loss of information and wait for feature updates for the above. Is there a way to build only .kt
files or exclude .java
files from being built by Dokka? Thank you.Lukas K-G
03/23/2021, 8:11 AMLukas K-G
03/23/2021, 8:15 AMsuppressedFiles
? Haven’t tested or found any documentation though. Edit: sample usageMarcin Aman
03/23/2021, 11:55 AMCheolho Jeon
03/26/2021, 3:10 AM'org.jetbrains.dokka-android'
, but it seemed like this plugin do not support suppressedFiles
command (groovy Gradle does not compile) and I tried switching to standard plugin "org.jetbrains.dokka"
. But then gradlew dokkaJavadoc
produced an error. Below is the error message.
FAILURE: Build failed with an exception.
* What went wrong:
kotlin.jvm.internal.Reflection.typeOf(Ljava/lang/Class;)Lkotlin/reflect/KType;
Maybe an Android project is not suitable for latest dokka and dokka android plugin is not up-to-date with dokka. (the latest android dokka plugin update was March 2019. https://plugins.gradle.org/plugin/org.jetbrains.dokka-android)Marcin Aman
03/26/2021, 12:50 PMCheolho Jeon
03/27/2021, 5:48 AMbuildscript {
ext.kotlin_version = '1.4.31'
ext.dokka_version = "1.4.30"
repositories {
...
app-level build.gradle
apply plugin: "org.jetbrains.dokka"
...
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath("org.jetbrains.dokka:dokka-gradle-plugin:${dokka_version}")
}
}
...
tasks.named("dokkaHtml") {
outputDirectory.set(file("../doc"))
}
then when I run ./gradlew dokkaHtml
then below error message is printed:
FAILURE: Build failed with an exception.
* What went wrong:
kotlin.jvm.internal.Reflection.typeOf(Ljava/lang/Class;)Lkotlin/reflect/KType;
this is what is printed when I run ./gradlew dokkaHtml --stacktrace
I'm using gradle version 5.4.1
. Again, thank you so much for trying to help me out. 🙇♂️Marcin Aman
03/27/2021, 10:30 AMtypeOf
function that is present in kotlin since 1.3 and i think that gradles lower than 5.6
doesn’t have it. Its hard for me to confirm it for sure since i haven’t found any compatibility matrixes but upgrading to 5.6 makes dokka task pass.