$ show dropbox/dependency-guard
Dependency Guard is a Gradle plugin that monitors and protects against unintentional dependency changes in JVM-based projects. It creates baseline files of project dependencies for specified configurations and compares current dependencies against these baselines during build execution. When unintended changes are detected, it fails the build and provides a clear diff of what changed, allowing developers to either re-baseline for intentional changes or investigate problematic dependency drift. The plugin supports both simple list format and hierarchical tree format for dependency reporting, with the list format being recommended for CI usage due to less noise. It integrates with Gradle's lifecycle by automatically attaching to the 'check' task and provides clear commands for creating and updating baselines.
The LLM identified 3 files worth highlighting for reuse:
Provides a clean, efficient implementation for comparing two lists of dependencies and identifying additions and removals. The component is highly isolated, depending only on basic data structures, and could be easily extracted for use in any list comparison scenario. It demonstrates good functional programming practices with clear separation of concerns between diff calculation and result formatting.
Implements a clean visitor pattern for traversing Gradle's dependency resolution results to collect all dependencies in a configuration. The component is self-contained with minimal dependencies and shows strong understanding of Gradle's API for dependency resolution. It could be extracted and used in any project needing to analyze Gradle dependency graphs with minimal modification.
A simple but well-designed data class that tracks removed and added items and provides formatted output with +/- prefixes. The component is completely isolated with no external dependencies and demonstrates excellent encapsulation of a common formatting need. It could be reused in any context requiring clear visualization of changes between two sets of items.