ProjectGuard: protect your project's dependency graph
As projects grow, so does their complexity. We slice our apps into modules, hoping to achieve clean architecture, faster build times, and better scalability. But with hundreds of modules, how do we prevent the dependency graph from turning into a mess? We’ve all seen it happen:
- A new module is created and depends on a
:legacymodule for convenience, even though there’s a replacement already. - A
:domainlayer, which should be pure Kotlin, suddenly gets a dependency on:networkor:databasemodule - A library our team decided to replace months ago quietly slips back into a new module.
These occurrences accumulate over time, leading to technical debt and slower builds, depending on how big your dependency graph is. Even with code reviews, mistakes can always happen, and it’s always better to have some kind of automated check that verifies for consistency. To help solve this problem, I’m introducing ProjectGuard, a Gradle plugin that verifies that your project structure rules are being applied.