teogor / ceres

🪐 Ceres is a comprehensive Android development framework designed to streamline your app development process. Powered by the latest technologies like Jetpack Compose, Hilt, Coroutines, and Flow, Ceres empowers developers to build modern and efficient Android applications.
https://source.teogor.dev/ceres
Apache License 2.0
65 stars 4 forks source link

Focus Dokka Multi-Module on Relevant Modules (Exclude bom & app) #192

Closed teogor closed 6 months ago

teogor commented 6 months ago

Optimized DokkaHtmlMultiModule Task Execution

This pull request refines the execution of the dokkaHtmlMultiModule task to generate documentation only for desired modules within the project.

Previous Approach:

Previously, the code relied on the following logic:

tasks.dokkaHtmlMultiModule {
  childProjects.values.forEach {
    dependsOn(":${it.name}:dokkaHtmlMultiModule")
  }
}

This approach triggered the dokkaHtmlMultiModule task for all child projects, potentially generating documentation for modules that don't require it (e.g., BOM or application module).

Updated Approach:

The code has been updated to selectively execute the task for specific modules:

tasks.dokkaHtmlMultiModule {
  childProjects.values.map { it.name }.filter {
    it != "app" && it != "bom"
  }.forEach {
    val taskPath = ":${it}:dokkaHtmlMultiModule"
    dependsOn(taskPath)
  }
}

This revised approach:

Benefits: