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

Provide DSL to configure partial and non-partial tasks at the same time. #1867

Closed
rnett opened this issue Apr 21, 2021 · 3 comments
Closed
Labels
enhancement An issue for a feature or an overall improvement

Comments

@rnett
Copy link
Contributor

rnett commented Apr 21, 2021

Is your feature request related to a problem? Please describe
I have gotten tripped up several times now by configuring dokkaHtml and then using the multi module task, or configuring org.jetbrains.dokka.gradle.DokkaTask when I mean to use org.jetbrains.dokka.gradle.DokkaTaskPartial. I'm not actually trying to generate multi-module and single-module docs, but that is a possible use case as well.

Describe the solution you'd like
A way to configure format-specific tasks for partial (multi-module) and non-partial. Ideally something like a dokka.html{ block (not named that, probably), but at minimum lift dokkaSourceSets to AbstractDokkaTask since it's the same type in both subclasses. Ideally, though, the groupings of formats and partial/non-partial would be orthogonal, so I could configure groups like "all tasks", "all HTML tasks", "all partial tasks", "all (well, the) partial HTML task", etc.

Extensions for tasks.withType<org.jetbrains.dokka.gradle.DokkaTaskPartial>(), tasks.withType<org.jetbrains.dokka.gradle.DokkaTask>() , and tasks.withType<org.jetbrains.dokka.gradle.AbstractDokkaTask>() would also be nice if this route is taken.

Personally, I'd move away from the task based configuration as the default and use something more like plugin:

dokka{
    html{
        partial{
            // partial only
        }
        // all html
    }
    // all
    partial{
        // all partial
    }
}

but that's just personal preference.

Describe alternatives you've considered
See above, I'm not suggesting something specific.

@rnett rnett added the enhancement An issue for a feature or an overall improvement label Apr 21, 2021
@MarcinAman
Copy link
Contributor

I don't see a use case behind it except prototyping. The thing is projects are either single or multi module, there is no way that this changes dynamically. So you either configure partials for the multimodule or dokka tasks for single module. Any mix of those is invalid.

Could you elaborate more on your use case? Why do you switch between single and multimodule docs?

@rnett
Copy link
Contributor Author

rnett commented Apr 27, 2021

The change over was when I added modules during development. I'm publishing multiple sets of docs to work around #1888 and #1862, and one of those sets went from being a single module to multi module when I restructured the project. I have also been using the single module tasks to inspect a single module's docs without re-building the whole multi-module project. It's possible to use multi-module and single module at the same time if you aren't generating a single set of docs for the entire project.

Another use case is convention plugins and buildSrc utilities. I currently have all my dokka configuration in the root project, but would like to move it to a convention plugin at some point. I'm not planning on doing this, but a plugin like this could be applied to some single module projects and some multi module projects, depending on project structure or if it's published (i.e. as a organization's standard doc format).

@kamildoleglo
Copy link
Contributor

Closing #1891

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
Projects
None yet
Development

No branches or pull requests

3 participants