简体   繁体   中英

Android Dokka - Only generate docs for my code and skip everything else

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
}

Paragones had the correct answer to a different so issue

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

namely you need to add this task and modify it to only delete the stuff you want deleted:

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
  }
}

note you will not need the android.R line with the updated version of dokka

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM