Has anyone ever done multiple Dokka reports from t...
# dokka
k
Has anyone ever done multiple Dokka reports from the same codebase? E.g., I want separate Dokka html report/site for all "api" modules. And a different Dokka report for "all android device tests". And a different one for "test framework which is a bunch of different modules as well a subset of a module". The way multimodule is setup it, it seems like you can only do one report at the root.
m
Try dokkatoo? I do an aggregation in a dedicated module that is not the root. I see no reason it wouldn't work for multiple modules
k
How did I know about this? 😮 Thanks! 🎉 This should be built into Dokka 😛 😞
💯 1
m
@Adam S is the one to thank, I'm just the messenger 🙂
👍 1
❤️ 1
k
wrote up a Feature request issue: https://github.com/adamko-dev/dokkatoo/issues/174 I don't think it'll support aggregations...looks like it's just a friendlier layer over Dokka...
m
What doesn't work with this:?
Copy code
plugins {
  id("dev.adamko.dokkatoo-html") version "$dokkatooVersion"
}

dependencies {
  // aggregate both subproject-hello and subproject-world
  // the subprojects must also have Dokkatoo applied
  dokkatoo(project(":subproject-hello"))
  dokkatoo(project(":subproject-world"))

  // If using Dokkatoo v2.1.0+ a dependency on all-modules-page-plugin is no longer required,
  // see <https://github.com/adamko-dev/dokkatoo/issues/14>
  //dokkatooPluginHtml("org.jetbrains.dokka:all-modules-page-plugin") 

  // Earlier versions of Dokkatoo must manually add a dependency:
  dokkatooPluginHtml(
     dokkatoo.versions.jetbrainsDokka.map { dokkaVersion ->
        "org.jetbrains.dokka:all-modules-page-plugin:$dokkaVersion"
     }
  )
}
k
I want something like this:
Copy code
dokkatooPluginHtml {
   dokkatoo(project(":subproject-a"))
   outputdir = something
}
dokkatooPluginHtml {
   val projects = projects.filter { name.endsWith("test") }
   outputdir = somethingelse
}
dokkatooPluginHtml {
   val projects = projects.filter { name.endsWith("api") }
   dokkatoo(projects)
   outputdir = apidocs
}
m
you can do this with different modules: • core-kdoc • test-kdoc • api-kdoc
If you want this in the root module, dokkatoo doesn't support multiple aggregations in the same module
So that's an issue. But I think the multiple module is fine? Might even be a feature to avoid having too many things in the root module/separation of concerns/etc...
k
ahhh...that's a good hack. Thanks 🙂
💙 1
a
you should be able to manually create multiple aggregated publications from a single project with both DGP and Dokkatoo - you'll just have to set it up manually
🤔 1
but yes, creating multiple Gradle subprojects would be better and easier for a whole load of reasons
👍 1