Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Flavor-specific documentation #345

Closed
rexmtorres opened this issue Aug 13, 2018 · 7 comments
Closed

Support Flavor-specific documentation #345

rexmtorres opened this issue Aug 13, 2018 · 7 comments
Labels
enhancement An issue for a feature or an overall improvement question A user question, can be resolved if the question is answered/resolved
Milestone

Comments

@rexmtorres
Copy link

I have a multi-flavor Android module that has different documentation for some of the classes:

  • myModule/src
    • flavor1
      • MyClass.kt
        /** This is flavor1's documentation */
        class MyClass { ... }
        
    • flavor2
      • MyClass.kt
        /** This is flavor2's documentation */
        class MyClass { ... }
        

I then configured my Dokka Gradle tasks like so:

    applicationVariants.all { variant ->
        task "dokka${variant.name.capitalize()}" (type: org.jetbrains.dokka.gradle.DokkaAndroidTask) {
            ...
            outputDirectory = "$buildDir/dokka/$variant.name"
            sourceDirs = files("src/${variant.flavorName}/java")
            ...
        }
    }

However, it seems that Dokka always uses the latest flavor that was configured (in this case flavor2) for all my Dokka tasks. So MyClass for both flavor1 and flavor2 will have the same documentation:

      /** This is flavor2's documentation */
      class MyClass
@semoro semoro added the question A user question, can be resolved if the question is answered/resolved label Oct 19, 2018
@semoro
Copy link
Contributor

semoro commented Oct 19, 2018

That's totally strange

@rexmtorres
Copy link
Author

That's totally strange

What's strange? My request/setup or the behavior of Dokka?

@semoro
Copy link
Contributor

semoro commented Oct 21, 2018

Dokka's behaviour

@kamildoleglo kamildoleglo added this to the 0.10.1 milestone Oct 2, 2019
@tedhenry100
Copy link

I'm seeing the same behaviour that @semoro observed. This must be a bug in Dokka.

@kamildoleglo
Copy link
Contributor

As of 0.10.0, dokka takes the first release flavor it encounters. Selecting the flavor to document is planned for the next release

@kamildoleglo kamildoleglo added the enhancement An issue for a feature or an overall improvement label Oct 22, 2019
@kamildoleglo
Copy link
Contributor

There's also a configuration option that you can use since version 0.10.0 to document specific flavour. It's called androidVariant and it's a String value with a name of your variant. Please note that it's not fully tested so it may not work and it for sure doesn't in the multiplatform mode

@kamildoleglo kamildoleglo modified the milestones: 0.11.0, 0.10.1 Oct 28, 2019
@kamildoleglo
Copy link
Contributor

Implemented in 2ff1c6e

@mshishkina mshishkina changed the title Flavor-specific documentation Support Flavor-specific documentation Feb 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An issue for a feature or an overall improvement question A user question, can be resolved if the question is answered/resolved
Projects
None yet
Development

No branches or pull requests

4 participants