Modernization, Phase 5: Configuration cache compatibility for core lock tasks#293
Merged
OdysseusLives merged 10 commits intomainfrom Feb 10, 2026
Merged
Modernization, Phase 5: Configuration cache compatibility for core lock tasks#293OdysseusLives merged 10 commits intomainfrom
OdysseusLives merged 10 commits intomainfrom
Conversation
9775d3e to
015700e
Compare
…ible Changes: - Remove notCompatibleWithConfigurationCache() marker from SaveLockTask - Add globalLockFile property to capture global lock path at config time - Check for global lock conflict at execution time without project reference - Removed doFirst block that accessed project.rootProject at execution time - Remove notCompatibleWithConfigurationCache() from Delete tasks SaveLockTask now uses only Property API and has zero project references.
…ible Changes: - Remove notCompatibleWithConfigurationCache() marker from DiffLockTask - Add note about PathAwareDiffReportGenerator limitation (opt-in feature) DiffLockTask's default diff path uses only Property API and is configuration cache compatible. The experimental path-aware diff feature (enabled via nebula.features.pathAwareDependencyDiff) requires future work.
…figuration cache compatible - Add Resolution API properties (resolutionResults, peerProjectCoordinates) to capture dependency graphs using Gradle's official APIs instead of Configuration objects - Refactor GenerateLockFromConfigurations to support: * NEW API: lock(Map<String, Provider<ResolvedComponentResult>>, List<String>) for config cache * OLD API: lock(Collection<Configuration>) for global lock (will be fixed in later phase) - Update @TaskAction methods to use captured properties instead of project access - Wire properties in DependencyLockTaskConfigurer using zip() for proper provider timing - Add wireTaskProperties() helpers to GenerateLockTaskSpec and UpdateLockTaskSpec - Handle projects with no configurations (create empty lock file instead of throwing exception)
…uration paths This commit implements clean separation between NEW API (config cache compatible) and OLD API (global lock legacy) code paths. Changes: - Add includeTransitives to conventionMapping for global lock tasks - Use unique aggregate configuration names to avoid conflicts - Modify setupLockProperties to skip resolutionResults for global lock (skipResolutionResults parameter) - Fix Property API syntax in UpdateLockTaskSpec (use .set() instead of direct assignment) - Update LockTaskSpec.wireTaskProperties() to use proper lockableConfigurations() filtering logic - Add deprecation suppression to global lock integration tests This allows global lock to use OLD API (conventionMapping.configurations) while regular locks use NEW API (Resolution APIs). Both code paths coexist cleanly via resolutionResults.isPresent() check. Test changes: - Centralize global lock deprecation suppression using trait - Create GlobalLockDeprecations trait that provides a factory method for the JUnit rule that suppresses 'Invocation of Task.project at execution time' deprecation warnings from global lock tasks - Global lock tasks intentionally use the OLD API (conventionMapping) which is not configuration cache compatible. This trait centralizes the documentation and logic in one place while working properly with Spock tests (which require @rule to be declared on the spec class itself).
Fix test pollution issue where the test would pass in isolation but fail when run as part of the full test suite. Changes: - Changed keepFiles from true to false to avoid file pollution between tests - Added cleanup() method to explicitly delete lock files after each test - Removed duplicate disableConfigurationCache() call in test method (already in setup()) This ensures each test starts with a clean slate and doesn't interfere with subsequent tests.
…tible Refactor PathAwareDiffReportGenerator to use Resolution APIs instead of Project. Changes: - Refactor DiffReportGenerator interface to accept ResolvedComponentResult map - Update PathAwareDiffReportGenerator implementation to use resolution results - Add resolutionResults property to DiffLockTask - Wire resolution results at configuration time in DependencyLockTaskConfigurer - Remove execution-time project access from PathAwareDiff code path
…onfig cache tests Validate configuration cache compatibility for all regular and global lock tasks.
015700e to
9a9ac45
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Make the dependency-lock plugin compatible with Gradle's configuration cache where feasible by:
ResolvedComponentResult,ResolvedArtifactResult) instead ofConfigurationobjects for lock generation, per Gradle guidance.Most-used lock tasks (
generateLock,updateLock,saveLock,diffLock,commitLock) are configuration-cache compatible.Global lock and migration tasks remain optionally incompatible by design.
The dependency resolution verifier is unchanged.
Changes by commit
globalLockFile, removedoFirst/project access, removenotCompatibleWithConfigurationCache()from SaveLockTask and Delete tasks.lockFromResolutionResults()(using new API) vslock(Collection<Configuration>)(using old API), wire in configurer,wireTaskProperties()in specs, empty-config handling.includeTransitivesvia conventionMapping for global lock, unique aggregate config names,setupLockPropertiesskip for global lock, LockTaskSpec wiring, GlobalLockDeprecations trait.DiffReportGeneratortakes resolution result map; PathAwareDiffReportGenerator and DiffLockTask useresolutionResults; no execution-time project/Configuration access.Breaking changes
None for normal plugin usage. Build scripts that only apply the plugin and use standard tasks are unchanged.
Internal / integration:
Map<String, Provider<ResolvedComponentResult>>(resolution results) instead ofProject. Only PathAwareDiffReportGenerator is updated; custom implementations would need to follow the new signature.notCompatibleWithConfigurationCache(). Tests that run with--configuration-cacheand exercise global lock usedisableConfigurationCache()where required.