Skip to content

Conversation

@jamesarich
Copy link
Collaborator

This commit introduces a new Gradle task to automatically generate and update module dependency graphs.

Key changes:

  • A new Graph.kt convention plugin is added to the build-logic to handle graph generation using Mermaid syntax.
  • graphDump and graphUpdate tasks are created. graphUpdate is added to the AndroidLibraryConventionPlugin and AndroidApplicationConventionPlugin.
  • README.md files are added to most modules to display the generated dependency graphs.
  • The scheduled updates workflow is updated to run the graphUpdate task, ensuring the graphs are kept current.
  • The dependency-analysis plugin has been removed.
  • Refactored build scripts to use the org.meshtastic package name and improve Gradle configuration logic.

@github-actions github-actions bot added the enhancement New feature or request label Dec 18, 2025
@codecov
Copy link

codecov bot commented Dec 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.60%. Comparing base (85435d7) to head (e5eceba).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #4042   +/-   ##
=====================================
  Coverage   0.60%   0.60%           
=====================================
  Files        406     406           
  Lines      24283   24283           
  Branches    3121    3121           
=====================================
  Hits         148     148           
  Misses     24112   24112           
  Partials      23      23           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces automated module dependency graph generation using Gradle tasks and Mermaid diagrams. The changes replace the removed dependency-analysis plugin with a custom solution that generates and maintains visual dependency graphs in module README files.

Key changes:

  • New Graph.kt convention plugin creates graphDump and graphUpdate Gradle tasks to generate Mermaid dependency graphs
  • Package namespace refactored from com.geeksville.mesh.buildlogic to org.meshtastic.buildlogic across all build-logic files
  • README.md files added to all modules containing auto-generated dependency graphs with collapsible legends

Reviewed changes

Copilot reviewed 47 out of 48 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
build-logic/convention/src/main/kotlin/org/meshtastic/buildlogic/Graph.kt New file implementing dependency graph generation logic with Mermaid syntax
build-logic/convention/src/main/kotlin/org/meshtastic/buildlogic/ProjectExtensions.kt New file with utility extensions for accessing version catalog and config properties
build-logic/convention/src/main/kotlin/com/geeksville/mesh/buildlogic/ProjectExtensions.kt Replaced with RootConventionPlugin to configure graph tasks on all subprojects
build-logic/convention/build.gradle.kts Updated group name and registered new root convention plugin
gradle/libs.versions.toml Removed dependency-analysis plugin, added meshtastic-root plugin
build.gradle.kts Removed dependency-analysis configuration, applied meshtastic-root plugin
.github/workflows/scheduled-updates.yml Added graphUpdate task to scheduled workflow
Multiple build-logic files Refactored package names from com.geeksville.mesh.buildlogic to org.meshtastic.buildlogic
Multiple module README.md files Added with generated dependency graphs
mesh_service_example/build.gradle.kts Updated imports and changed android block to configure
app/build.gradle.kts Refactored to use configProperties extension and configure
Comments suppressed due to low confidence (1)

gradle/libs.versions.toml:1

  • Commented-out code should be removed entirely rather than left as a comment. Since this plugin has been removed as part of the PR's purpose, the line should be deleted completely.

@@ -0,0 +1,17 @@
# `${projectPath.get()}`
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The README contains unprocessed template variables. This appears to be a template file that should have been processed by the graphUpdate task but wasn't. The file should either be regenerated or removed.

Copilot uses AI. Check for mistakes.
Comment on lines +36 to +38
(this as ExtensionAware).extensions.configure<KotlinMultiplatformAndroidLibraryTarget>("android") {
compileSdk = this@with.configProperties.getProperty("COMPILE_SDK").toInt()
minSdk = this@with.configProperties.getProperty("MIN_SDK").toInt()
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The nested scope references (this@with) and type cast make this code difficult to read. Consider extracting the android configuration to a separate variable or using a more explicit scope reference.

Copilot uses AI. Check for mistakes.

package org.meshtastic.buildlogic

import com.android.utils.associateWithNotNull
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using an internal Android utility function (com.android.utils.associateWithNotNull) creates a dependency on Android internal APIs that may change without notice. Consider implementing this function locally or using standard Kotlin collection operations.

Copilot uses AI. Check for mistakes.
This commit introduces a new Gradle task to automatically generate and update module dependency graphs.

Key changes:
- A new `Graph.kt` convention plugin is added to the `build-logic` to handle graph generation using Mermaid syntax.
- `graphDump` and `graphUpdate` tasks are created. `graphUpdate` is added to the `AndroidLibraryConventionPlugin` and `AndroidApplicationConventionPlugin`.
- `README.md` files are added to most modules to display the generated dependency graphs.
- The scheduled updates workflow is updated to run the `graphUpdate` task, ensuring the graphs are kept current.
- The `dependency-analysis` plugin has been removed.
- Refactored build scripts to use the `org.meshtastic` package name and improve Gradle configuration logic.

Signed-off-by: James Rich <[email protected]>
@jamesarich jamesarich force-pushed the feat/dependency-mermaids branch from a7af838 to e5eceba Compare December 18, 2025 23:30
@jamesarich jamesarich merged commit 42bc85b into main Dec 18, 2025
4 checks passed
@jamesarich jamesarich deleted the feat/dependency-mermaids branch December 18, 2025 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants