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

Prefer defaultResolver().resolveDeps over Lib.resolveDependencies #4727

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

alexarchambault
Copy link
Collaborator

@alexarchambault alexarchambault commented Mar 14, 2025

Whenever possible, this tries to make modules defined in Mill use CoursierModule#defaultResolver or CoursierModule#millResolver to resolve dependencies, rather than calling lower level helpers like Lib. resolveDependencies. The former automatically take into account customizations of resolution defined on CoursierModule and JavaModule (repositoriesTask, mapDependencies, etc.), while these have to be passed manually to Lib.resolveDependencies.

This helps when adding more parameters - these have to be passed to defaultResolver / millResolver, and that's it, rather than also having to inspect all calls to Lib.resolveDependencies, and passing the new parameter there too.

This also tries to make resolution log to the task logger of the task requesting the resolution, rather than the logger of CoursierModule#{defaultResolver,millResolver}.

alexarchambault and others added 5 commits March 14, 2025 17:04
defaultResolver or millResolver (the latter being aware of the current
build modules)

defaultResolver automatically takes into account more resolution parameters
that can be customized on CoursierModule / JavaModule, while calling
Lib.resolveDependencies ignores them by default.
So that resolution logging goes to the task logger of the task requesting
the resolution, rather than the one of
`CoursierModule#{defaultResolver,millResolver}`
Copy link
Member

@lefou lefou left a comment

Choose a reason for hiding this comment

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

Looks good to me. But we need to introduce the new API in Mill 0.12 too and mark the old as deprecated. Otherwise migration can become hard.

@alexarchambault alexarchambault marked this pull request as ready for review March 18, 2025 14:43
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.

2 participants