Skip to content

Conversation

@garghimanshu0786
Copy link

@garghimanshu0786 garghimanshu0786 commented Dec 8, 2025

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.

@CLAassistant
Copy link

CLAassistant commented Dec 8, 2025

CLA assistant check
All committers have signed the CLA.

@garghimanshu0786 garghimanshu0786 force-pushed the feature/submodule-support branch 2 times, most recently from 98a3222 to cdb0a7c Compare December 9, 2025 08:07
@garghimanshu0786 garghimanshu0786 changed the title feat: Add submoduleToProjectMapping configuration feat: Add submodule support Dec 9, 2025
@garghimanshu0786 garghimanshu0786 force-pushed the feature/submodule-support branch from cdb0a7c to f76c2ae Compare December 9, 2025 10:22
@garghimanshu0786 garghimanshu0786 changed the title feat: Add submodule support feat: Add Git Submodule Support Dec 9, 2025
@garghimanshu0786
Copy link
Author

@changusmc @chris-mitchell @joshafeinberg Can you please consider this feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants