2

I'm using Dokka v0.9.17 for Android. When I run ./gradlew dokka it generates the docs but it include so many packages that I don't care about like android.support.fragment and packages for all the third party libraries. How can I tell Dokka to only generate doc for my code?

How can I remove Dagger _Factory files from the doc?

My configuration is like this

dokka {
    moduleName = 'app'
    outputFormat = 'html'
    outputDirectory = "$buildDir/javadoc"
    includeNonPublic = true
    skipEmptyPackages = true
    noStdlibLink = true
}
4

1 回答 1

0

Paragones 对不同的问题有正确的答案

https://github.com/Kotlin/dokka/issues/258

即您需要添加此任务并将其修改为仅删除您要删除的内容:

task deleteUnusedDokkaAssets(type: Delete) {
  file("$rootDir/docs").listFiles().each {        
    if(it.name.contains("android.R")) project.delete it
    if(it.name.contains("android.support")) project.delete it
    if(it.name.contains("com.google")) project.delete it  
    if(it.name.contains("com.crashlytics")) project.delete it
  }
}

请注意,您不需要 android.R 行与 dokka 的更新版本

于 2018-10-02T19:08:09.180 回答