AffectedModuleDetector icon indicating copy to clipboard operation
AffectedModuleDetector copied to clipboard

feat: Add Git Submodule Support

Open garghimanshu0786 opened this issue 5 months ago • 2 comments

Git Submodule Support

This feature automatically detects git submodules by parsing the .gitmodules file in the project root. When a submodule pointer changes (i.e., the submodule is updated to a different commit), all Gradle projects located under that submodule path are marked as affected.

How It Works

  1. Auto-Detection: The plugin reads .gitmodules to discover all submodule paths
  2. Change Detection: When git reports a submodule path as changed, the plugin finds all Gradle projects under that path
  3. Dependency Propagation: Affected submodule projects and their dependents are included in the affected set

Example

Given this project structure:

my-project/
├── .gitmodules
├── libs/
│   └── my-submodule/          # git submodule
│       ├── core/              # Gradle project :core
│       └── utils/             # Gradle project :utils
└── app/                       # Gradle project :app (depends on :core)

When libs/my-submodule is updated to a new commit:

  • :core and :utils are marked as changed projects
  • :app is marked as a dependent project (because it depends on :core)

Nested Submodules

The plugin handles nested submodules correctly. When a nested submodule changes, git reports the immediate parent submodule as changed, and the plugin finds all projects under that parent path.

garghimanshu0786 avatar Dec 08 '25 13:12 garghimanshu0786