You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current design requires to add all projects manually in the dependency block of the root project:
dependencies {
dokkatoo(projects.foo)
}
Adding some default mechanism would be nice to not add all projects manually. This is somehow annoying with projects containing many projects.
One option:
Use a build service to register a project when the dokkatoo plugin is applied.
The root project should create the build service (it is evaluated at first) and could depend on the registered projects using dependencies.addLater.
if subproject-alpha has a dependency dokkatoo{projects.subprojectGamma),
and the root project depends on dokkatoo(projects.subprojectAlpha),
then the root project gets both subproject-alpha and subproject-gamma
In the meantime, could you try this workaround? It should automatically add all subprojects.
// build.gradle.kts
plugins {
id("dev.adamko.dokkatoo-html")
}
configurations.dokkatoo.configure {
dependencies.addAllLater(
// lazily add subprojects
provider {
// get all projects
rootProject.allprojects
// don't add _this_ subproject as a self-dependency
.filter { it.path != project.path }
// only get projects that have the Dokkatoo HTML plugin // (adjust to include the other plugins if necessary)
.filter { it.pluginManager.hasPlugin("dev.adamko.dokkatoo-html") }
// create a dependency on the other project
.map { project.dependencies.create(it) }
}
)
}
Filtering by plugin is necessary because current Dokkatoo doesn't use artifactView { lenient(true) }. If Dokkatoo was updated to fetch dependencies leniently, then it should be possible to just add all projects as dependencies and then Dokkatoo won't complain if a subproject doesn't have the plugin.
The current design requires to add all projects manually in the dependency block of the root project:
Adding some default mechanism would be nice to not add all projects manually. This is somehow annoying with projects containing many projects.
One option:
Use a build service to register a project when the dokkatoo plugin is applied.
The root project should create the build service (it is evaluated at first) and could depend on the registered projects using dependencies.addLater.
Originally posted by @hfhbd in #14 (comment)
The text was updated successfully, but these errors were encountered: