refactor(oss-licenses): replace eager dependency resolution with lazy ArtifactView providers#381
Draft
timothyfroehlich wants to merge 2 commits intomainfrom
Draft
refactor(oss-licenses): replace eager dependency resolution with lazy ArtifactView providers#381timothyfroehlich wants to merge 2 commits intomainfrom
timothyfroehlich wants to merge 2 commits intomainfrom
Conversation
dff5638 to
d84b4a3
Compare
liutikas
reviewed
Mar 11, 2026
66c7d5d to
64a11e5
Compare
64a11e5 to
b9839ad
Compare
Member
Author
|
@liutikas I did a full rewrite to get things right and managed to significantly simplify things in the process. The Licenses task now separate arguments consisting of the I did use Gemini to help me get it straight, and had it add comments to help me (or other maintainers) remember for next time. I'm running an extra --scan now to double check things, but it should be pretty clean. |
Collaborator
|
I'm out of office for a week. I'll review this when I get back |
5 tasks
b1c72e0 to
c0f4d58
Compare
7d0d00b to
8e2123d
Compare
c0f4d58 to
c007df8
Compare
… ArtifactView providers - Shift resolution from configuration phase to execution phase using lazy ArtifactView providers. - Improve Configuration Cache compatibility by avoiding Project object capture in closures. - Fix ABSENT_ARTIFACT reference in error messages. - Move POM missing warnings to info level. - Add E2E test assertions to verify no configuration-time resolution.
c007df8 to
f51d90c
Compare
…task re-execution - Add SHA-256 hashing for -SNAPSHOT dependencies in DependencyTask. - Wire artifact files to DependencyTask via a lazy MapProperty. - Include the hash in the generated dependencies.json to trigger downstream task re-runs. - Add unit and E2E tests to verify snapshot change detection.
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.
Summary
This PR refactors the
oss-licenses-pluginto fully support the Gradle Configuration Cache by replacing eager configuration-phase dependency resolution with lazyArtifactViewproviders. It also introduces SHA-256 hashing for-SNAPSHOTdependencies to ensure license data remains fresh during active development.Key Changes
ArtifactViewandresolvedArtifactsproviders.DependencyUtilandArtifactFiles.Projectobject in closures by extracting necessary handlers (likeDependencyHandler) into local variables. This avoids "cannot serialize object of type DefaultProject" errors.@Nested MapProperty<String, ArtifactFiles>to isolated@Internal MapProperty<String, File>inputs to optimize hashing and ensure compatibility.-SNAPSHOTversions inDependencyTask. This hash is included in thedependencies.jsonreport, forcingLicensesTaskto re-run if a snapshot is re-published with changes.EMPTY_ARTIFACT(nowABSENT_ARTIFACT) in error messages.errortoinfoto reduce noise from expected missing metadata in some libraries (e.g.,androidx,org.jetbrains).testSnapshotChangeTriggersExecutionto verify the "Change Snapshot -> Re-run Task" cycle.DependencyTaskTest.testAction_snapshotVersions_includeHashesto verify correct SHA-256 calculation.EndToEndTest.testConfigurationCacheto assert that no configurations are resolved during the configuration phase.Verification Results
problems=fail).