Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor lockfile tasks to use configurations #49

Merged
merged 4 commits into from
Mar 14, 2023

Conversation

dellisd
Copy link
Collaborator

@dellisd dellisd commented Mar 14, 2023

This reworks the lockfile-handling portion of the plugin to use custom gradle configurations to pass generated files between projects instead of directly depending on tasks from other projects.

The plugin now creates a betterDynamicFeatures configuration on the base and feature modules of the project, and adds generated dependency graph reports (the .json files we use) as artifacts on this configuration. The base module's lockfile tasks can then depend on those artifacts from the configuration instead of needing to directly depend on the feature module's tasks and their outputs. This is a precursor to support project isolation (the resource scanning tasks still need to be rewritten) and in the meantime this fixes some issues when executing with configuration on demand enabled (fixes #43).

The CheckLockfileTask was reworked a bit as part of this refactor, and it now computes the lockfile diff entirely in-memory instead of needing to configure redundant tasks to write temporary files as before.

Lastly, this seems to have caught a bug with the way new transitive dependencies were being handled in lockfiles, sweet!

Sorry for the big PR-- it's difficult to split apart since everything was so interconnected (which this is "supposed" to solve).

* Rework CheckLockfileTask to compute diff in-memory, which simplifies gradle configuration
* Fix an apparent bug in transitive dependency lockfile updating
This will be shared across multiple sets of tasks in the future
Copy link
Member

@colinrtwhite colinrtwhite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My Gradle-fu isn't the best, but looks good to me 👍

dellisd added 2 commits March 14, 2023 19:05
This will enable other secondary variants to be added in the future
@dellisd dellisd enabled auto-merge (squash) March 14, 2023 23:07
@dellisd dellisd merged commit 31a22ea into main Mar 14, 2023
@dellisd dellisd deleted the derekellis/2023-03-14/configurations-for-lockfile branch March 14, 2023 23:11
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.

Configuration on demand can cause problems
2 participants